Layer supports Layer.run() and Layer.$(...).run() (builder style), and returns a Promise result.
// 1) Static run
Layer.run({ title: 'Hello', text: 'Layer.run(...)', icon: 'info' });
// 2) Builder style
Layer.$()
.config({ title: 'Confirm?', icon: 'warning', showCancelButton: true })
.run()
.then((res) => console.log(res));
<button class="btn primary">Layer.run()</button> <button class="btn">Layer.$().config().run()</button>
/* Local styles for buttons only */