dialog.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. "use strict";
  2. var __defProp = Object.defineProperty;
  3. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  4. var __getOwnPropNames = Object.getOwnPropertyNames;
  5. var __hasOwnProp = Object.prototype.hasOwnProperty;
  6. var __export = (target, all) => {
  7. for (var name in all)
  8. __defProp(target, name, { get: all[name], enumerable: true });
  9. };
  10. var __copyProps = (to, from, except, desc) => {
  11. if (from && typeof from === "object" || typeof from === "function") {
  12. for (let key of __getOwnPropNames(from))
  13. if (!__hasOwnProp.call(to, key) && key !== except)
  14. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  15. }
  16. return to;
  17. };
  18. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  19. var dialog_exports = {};
  20. __export(dialog_exports, {
  21. Dialog: () => Dialog
  22. });
  23. module.exports = __toCommonJS(dialog_exports);
  24. var import_channelOwner = require("./channelOwner");
  25. var import_page = require("./page");
  26. class Dialog extends import_channelOwner.ChannelOwner {
  27. static from(dialog) {
  28. return dialog._object;
  29. }
  30. constructor(parent, type, guid, initializer) {
  31. super(parent, type, guid, initializer);
  32. this._page = import_page.Page.fromNullable(initializer.page);
  33. }
  34. page() {
  35. return this._page;
  36. }
  37. type() {
  38. return this._initializer.type;
  39. }
  40. message() {
  41. return this._initializer.message;
  42. }
  43. defaultValue() {
  44. return this._initializer.defaultValue;
  45. }
  46. async accept(promptText) {
  47. await this._channel.accept({ promptText });
  48. }
  49. async dismiss() {
  50. await this._channel.dismiss();
  51. }
  52. }
  53. // Annotate the CommonJS export names for ESM import in node:
  54. 0 && (module.exports = {
  55. Dialog
  56. });