@itwin/core-frontend 3.0.0-dev.97 → 3.0.0-extension.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/lib/cjs/IModelApp.d.ts +7 -1
  2. package/lib/cjs/IModelApp.d.ts.map +1 -1
  3. package/lib/cjs/IModelApp.js +10 -2
  4. package/lib/cjs/IModelApp.js.map +1 -1
  5. package/lib/cjs/core-frontend.d.ts +7 -6
  6. package/lib/cjs/core-frontend.d.ts.map +1 -1
  7. package/lib/cjs/core-frontend.js +7 -6
  8. package/lib/cjs/core-frontend.js.map +1 -1
  9. package/lib/cjs/extension/Extension.d.ts +39 -0
  10. package/lib/cjs/extension/Extension.d.ts.map +1 -0
  11. package/lib/cjs/extension/Extension.js +39 -0
  12. package/lib/cjs/extension/Extension.js.map +1 -0
  13. package/lib/cjs/extension/ExtensionAdmin.d.ts +70 -0
  14. package/lib/cjs/extension/ExtensionAdmin.d.ts.map +1 -0
  15. package/lib/cjs/extension/ExtensionAdmin.js +105 -0
  16. package/lib/cjs/extension/ExtensionAdmin.js.map +1 -0
  17. package/lib/cjs/extension/ExtensionHost.d.ts +20 -0
  18. package/lib/cjs/extension/ExtensionHost.d.ts.map +1 -0
  19. package/lib/cjs/extension/ExtensionHost.js +19 -0
  20. package/lib/cjs/extension/ExtensionHost.js.map +1 -0
  21. package/lib/cjs/extension/ExtensionImpl.d.ts +16 -0
  22. package/lib/cjs/extension/ExtensionImpl.d.ts.map +1 -0
  23. package/lib/cjs/extension/ExtensionImpl.js +40 -0
  24. package/lib/cjs/extension/ExtensionImpl.js.map +1 -0
  25. package/lib/cjs/extension/ExtensionLoader.d.ts +20 -0
  26. package/lib/cjs/extension/ExtensionLoader.d.ts.map +1 -0
  27. package/lib/cjs/extension/ExtensionLoader.js +11 -0
  28. package/lib/cjs/extension/ExtensionLoader.js.map +1 -0
  29. package/lib/cjs/extension/ExtensionRuntime.d.ts +2 -0
  30. package/lib/cjs/extension/ExtensionRuntime.d.ts.map +1 -0
  31. package/lib/cjs/extension/ExtensionRuntime.js +60 -0
  32. package/lib/cjs/extension/ExtensionRuntime.js.map +1 -0
  33. package/lib/cjs/extension/extensions.d.ts +18 -0
  34. package/lib/cjs/extension/extensions.d.ts.map +1 -0
  35. package/lib/cjs/extension/extensions.js +35 -0
  36. package/lib/cjs/extension/extensions.js.map +1 -0
  37. package/lib/esm/IModelApp.d.ts +7 -1
  38. package/lib/esm/IModelApp.d.ts.map +1 -1
  39. package/lib/esm/IModelApp.js +10 -2
  40. package/lib/esm/IModelApp.js.map +1 -1
  41. package/lib/esm/core-frontend.d.ts +7 -6
  42. package/lib/esm/core-frontend.d.ts.map +1 -1
  43. package/lib/esm/core-frontend.js +7 -6
  44. package/lib/esm/core-frontend.js.map +1 -1
  45. package/lib/esm/extension/Extension.d.ts +39 -0
  46. package/lib/esm/extension/Extension.d.ts.map +1 -0
  47. package/lib/esm/extension/Extension.js +38 -0
  48. package/lib/esm/extension/Extension.js.map +1 -0
  49. package/lib/esm/extension/ExtensionAdmin.d.ts +70 -0
  50. package/lib/esm/extension/ExtensionAdmin.d.ts.map +1 -0
  51. package/lib/esm/extension/ExtensionAdmin.js +101 -0
  52. package/lib/esm/extension/ExtensionAdmin.js.map +1 -0
  53. package/lib/esm/extension/ExtensionHost.d.ts +20 -0
  54. package/lib/esm/extension/ExtensionHost.d.ts.map +1 -0
  55. package/lib/esm/extension/ExtensionHost.js +15 -0
  56. package/lib/esm/extension/ExtensionHost.js.map +1 -0
  57. package/lib/esm/extension/ExtensionImpl.d.ts +16 -0
  58. package/lib/esm/extension/ExtensionImpl.d.ts.map +1 -0
  59. package/lib/esm/extension/ExtensionImpl.js +35 -0
  60. package/lib/esm/extension/ExtensionImpl.js.map +1 -0
  61. package/lib/esm/extension/ExtensionLoader.d.ts +20 -0
  62. package/lib/esm/extension/ExtensionLoader.d.ts.map +1 -0
  63. package/lib/esm/extension/ExtensionLoader.js +10 -0
  64. package/lib/esm/extension/ExtensionLoader.js.map +1 -0
  65. package/lib/esm/extension/ExtensionRuntime.d.ts +2 -0
  66. package/lib/esm/extension/ExtensionRuntime.d.ts.map +1 -0
  67. package/lib/esm/extension/ExtensionRuntime.js +58 -0
  68. package/lib/esm/extension/ExtensionRuntime.js.map +1 -0
  69. package/lib/esm/extension/extensions.d.ts +18 -0
  70. package/lib/esm/extension/extensions.d.ts.map +1 -0
  71. package/lib/esm/extension/extensions.js +23 -0
  72. package/lib/esm/extension/extensions.js.map +1 -0
  73. package/package.json +24 -24
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ /** @packageDocumentation
7
+ * @module Extensions
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ /** Represents an Extension that we are attempting to load.
11
+ * @beta
12
+ */
13
+ // export class PendingExtension {
14
+ // public resolve: ResolveFunc | undefined = undefined;
15
+ // public reject: RejectFunc | undefined = undefined;
16
+ // public promise: Promise<LocalExtensionProps>;
17
+ // public constructor(private _tarFileUrl: string, public loader: ExtensionLoader, public args?: string[]) {
18
+ // this.promise = new Promise(this.executor.bind(this));
19
+ // }
20
+ // public executor(resolve: ResolveFunc, reject: RejectFunc) {
21
+ // this.resolve = resolve;
22
+ // this.reject = reject;
23
+ // const head = document.getElementsByTagName("head")[0];
24
+ // if (!head)
25
+ // reject(new Error("no head element found"));
26
+ // // create the script element. We handle onerror and resolve a ExtensionLoadResult failure in the onerror handler,
27
+ // // but we don't resolve success until the loaded extension calls "register" (see Extension.register)
28
+ // const scriptElement = document.createElement("script");
29
+ // scriptElement.onerror = this.cantLoad.bind(this);
30
+ // scriptElement.async = true;
31
+ // scriptElement.src = this._tarFileUrl;
32
+ // head.insertBefore(scriptElement, head.lastChild);
33
+ // }
34
+ // // called when we can't load the URL
35
+ // private cantLoad(_ev: string | Event) {
36
+ // this.resolve!(IModelApp.i18n.translate("iModelJs:ExtensionErrors.CantFind", { extensionUrl: this._tarFileUrl }));
37
+ // }
38
+ // }
39
+ //# sourceMappingURL=Extension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Extension.js","sourceRoot":"","sources":["../../../src/extension/Extension.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;AA0CH;;IAEI;AACJ,kCAAkC;AAClC,yDAAyD;AACzD,uDAAuD;AACvD,kDAAkD;AAElD,8GAA8G;AAC9G,4DAA4D;AAC5D,MAAM;AAEN,gEAAgE;AAChE,8BAA8B;AAC9B,4BAA4B;AAE5B,6DAA6D;AAC7D,iBAAiB;AACjB,oDAAoD;AAEpD,wHAAwH;AACxH,2GAA2G;AAC3G,8DAA8D;AAE9D,wDAAwD;AAExD,kCAAkC;AAClC,4CAA4C;AAC5C,wDAAwD;AACxD,MAAM;AAEN,yCAAyC;AACzC,4CAA4C;AAC5C,wHAAwH;AACxH,MAAM;AACN,IAAI","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Extensions\r\n */\r\n\r\ntype ResolveFunc = (() => Promise<any>);\r\n\r\n/** Defines the format of an Extension manifest */\r\nexport interface ExtensionManifest {\r\n readonly name: string;\r\n readonly displayName?: string;\r\n readonly version: string;\r\n readonly description?: string;\r\n /** The main module file to load. This should be a path to the javascript file\r\n * e.g \"./lib/main.js\"\r\n */\r\n readonly main?: string;\r\n /** The version of iTwin.js Core. */\r\n readonly engines?: { itwinjs: string };\r\n /** List of activation events this Extension supports. */\r\n readonly activationEvents?: string[];\r\n readonly enableProposedApi?: boolean;\r\n}\r\n\r\nexport interface BuildExtensionManifest extends ExtensionManifest {\r\n /** Only valid when the Extension is loaded at build-time.\r\n *\r\n * Defines how to load the Extension manifest and\r\n */\r\n readonly module?: string;\r\n}\r\n\r\n/** Describes an Extension that has already been downloaded and has a location files can be easily executed. */\r\nexport interface LocalExtensionProps {\r\n readonly manifest: ExtensionManifest;\r\n readonly mainFunc?: ResolveFunc;\r\n /** Identifies a location of the Extension that it can be loaded.\r\n *\r\n * WIP:\r\n * - Could be a URL to the location of the Extension\r\n * - Could be a file path to an installed location locally.\r\n */\r\n // readonly location: string;\r\n}\r\n\r\n/** Represents an Extension that we are attempting to load.\r\n * @beta\r\n */\r\n// export class PendingExtension {\r\n// public resolve: ResolveFunc | undefined = undefined;\r\n// public reject: RejectFunc | undefined = undefined;\r\n// public promise: Promise<LocalExtensionProps>;\r\n\r\n// public constructor(private _tarFileUrl: string, public loader: ExtensionLoader, public args?: string[]) {\r\n// this.promise = new Promise(this.executor.bind(this));\r\n// }\r\n\r\n// public executor(resolve: ResolveFunc, reject: RejectFunc) {\r\n// this.resolve = resolve;\r\n// this.reject = reject;\r\n\r\n// const head = document.getElementsByTagName(\"head\")[0];\r\n// if (!head)\r\n// reject(new Error(\"no head element found\"));\r\n\r\n// // create the script element. We handle onerror and resolve a ExtensionLoadResult failure in the onerror handler,\r\n// // but we don't resolve success until the loaded extension calls \"register\" (see Extension.register)\r\n// const scriptElement = document.createElement(\"script\");\r\n\r\n// scriptElement.onerror = this.cantLoad.bind(this);\r\n\r\n// scriptElement.async = true;\r\n// scriptElement.src = this._tarFileUrl;\r\n// head.insertBefore(scriptElement, head.lastChild);\r\n// }\r\n\r\n// // called when we can't load the URL\r\n// private cantLoad(_ev: string | Event) {\r\n// this.resolve!(IModelApp.i18n.translate(\"iModelJs:ExtensionErrors.CantFind\", { extensionUrl: this._tarFileUrl }));\r\n// }\r\n// }\r\n"]}
@@ -0,0 +1,70 @@
1
+ /** @packageDocumentation
2
+ * @module Extensions
3
+ */
4
+ import { ExtensionLoader } from "./ExtensionLoader";
5
+ /** The Extensions loading system has 3 goals:
6
+ * 1. Only fetch what is needed when it is required
7
+ * 1. Load a manifest file
8
+ * 2. Load the the main module when necessary
9
+ * 2. Download the needed files from
10
+ *
11
+ * 3 ways to load an Extension into the system:
12
+ *
13
+ * 1. At build-time provide the function to load both the Extension Manifest and import the main module of the extension.
14
+ * The main module must contain the activate() function.
15
+ * 2. A minimum set of ExtensionLoaderProps that provide enough information to get the manifest
16
+ *
17
+ * An Extension can be in 3 different states:
18
+ * - Known
19
+ * - The Extension Admin has the minimal information needed to fetch the manifest for the Extension.
20
+ * knows the Extension exists but has not yet loaded the manifest
21
+ * - Installed
22
+ * - The Extension has the full manifest loaded and can be executed on the activation events
23
+ * - Disabled
24
+ * - The Extension has the full manifest but is not currently enabled and will not be executed based on the
25
+ * activation events.
26
+ */
27
+ declare type ResolveFunc = (() => Promise<any>);
28
+ /** The Extension Admin controls the list of currently known, loaded and executing an Extension.
29
+ * Handles the loading of Extensions and maintains a list of the currently loaded Extensions.
30
+ *
31
+ * On application startup, an initial list of Extensions is gathered by searching in known locations for
32
+ *
33
+ * @alpha
34
+ */
35
+ export declare class ExtensionAdmin {
36
+ /** The list of places to download an Extension. */
37
+ private _extensionLoaders;
38
+ /** Defines the set of extensions that are currently known and can be invoked during activation events. */
39
+ private _installedExtensions;
40
+ /**
41
+ * Fired when an Extension has been added or removed.
42
+ */
43
+ onStartup: () => Promise<void>;
44
+ constructor();
45
+ /** Adds an ExtensionLoader to the front of the list of extension loaders in use. Extension loaders will be invoked front to back.
46
+ * By default, the list consists of public Extension Service context, unless disabled via props.
47
+ * @param extensionLoader Extension loader to add
48
+ */
49
+ addExtensionLoaderFront(extensionLoader: ExtensionLoader): void;
50
+ /** Adds an ExtensionLoader to the list of extension loaders in use.
51
+ * By default, the list consists of public Extension Service context, unless disabled via props.
52
+ * @param extensionLoader Extension loader to add
53
+ */
54
+ addExtensionLoader(extensionLoader: ExtensionLoader): void;
55
+ /** Add an Extension to be bundled during compilation.
56
+ * @param manifestLoader A function that loads the manifest file.
57
+ * @param mainFunc The main function to be executed upon
58
+ */
59
+ addBuildExtension(manifestPromise: Promise<any>, mainFunc?: ResolveFunc): Promise<void>;
60
+ /** Loops over all enabled Extensions and triggers each one if the provided event is defined. */
61
+ private activateExtensionEvents;
62
+ /** Resolves an import function provided for build-time Extensions that should return a valid
63
+ * Extension Manifest.
64
+ */
65
+ private getManifest;
66
+ private parseManifest;
67
+ private execute;
68
+ }
69
+ export {};
70
+ //# sourceMappingURL=ExtensionAdmin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExtensionAdmin.d.ts","sourceRoot":"","sources":["../../../src/extension/ExtensionAdmin.ts"],"names":[],"mappings":"AAIA;;GAEG;AAKH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,aAAK,WAAW,GAAG,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;AAOxC;;;;;;GAMG;AACH,qBAAa,cAAc;IACzB,oDAAoD;IACpD,OAAO,CAAC,iBAAiB,CAAyB;IAElD,2GAA2G;IAC3G,OAAO,CAAC,oBAAoB,CAA4E;IAExG;;QAEI;IAGG,SAAS,sBAEd;;IAMF;;;OAGG;IACI,uBAAuB,CAAC,eAAe,EAAE,eAAe;IAI/D;;;QAGI;IACG,kBAAkB,CAAC,eAAe,EAAE,eAAe;IAI1D;;;OAGG;IACU,iBAAiB,CAAC,eAAe,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAKpG,gGAAgG;YAClF,uBAAuB;IAYrC;;OAEG;YACW,WAAW;YAMX,aAAa;YAiBb,OAAO;CAKtB"}
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ /** @packageDocumentation
7
+ * @module Extensions
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.ExtensionAdmin = void 0;
11
+ // import { Extension, ExtensionLoader, ExtensionManifest, LocalExtensionProps, PendingExtension } from "./Extension";
12
+ const IModelApp_1 = require("../IModelApp");
13
+ // type RejectFunc = ((arg: Error) => void);
14
+ var ActivationEvents;
15
+ (function (ActivationEvents) {
16
+ ActivationEvents["onStartupApp"] = "onStartupApp";
17
+ })(ActivationEvents || (ActivationEvents = {}));
18
+ /** The Extension Admin controls the list of currently known, loaded and executing an Extension.
19
+ * Handles the loading of Extensions and maintains a list of the currently loaded Extensions.
20
+ *
21
+ * On application startup, an initial list of Extensions is gathered by searching in known locations for
22
+ *
23
+ * @alpha
24
+ */
25
+ class ExtensionAdmin {
26
+ constructor() {
27
+ /** The list of places to download an Extension. */
28
+ this._extensionLoaders = [];
29
+ /** Defines the set of extensions that are currently known and can be invoked during activation events. */
30
+ this._installedExtensions = new Map();
31
+ /**
32
+ * Fired when an Extension has been added or removed.
33
+ */
34
+ // public readonly onInstallExtension = new BeEvent<(added: readonly ExtensionProps[], removed: readonly ExtensionProps[]) => void>();
35
+ this.onStartup = async () => {
36
+ await this.activateExtensionEvents(ActivationEvents.onStartupApp);
37
+ };
38
+ IModelApp_1.IModelApp.onBeforeStartup.addListener(this.onStartup);
39
+ }
40
+ /** Adds an ExtensionLoader to the front of the list of extension loaders in use. Extension loaders will be invoked front to back.
41
+ * By default, the list consists of public Extension Service context, unless disabled via props.
42
+ * @param extensionLoader Extension loader to add
43
+ */
44
+ addExtensionLoaderFront(extensionLoader) {
45
+ this._extensionLoaders.unshift(extensionLoader);
46
+ }
47
+ /** Adds an ExtensionLoader to the list of extension loaders in use.
48
+ * By default, the list consists of public Extension Service context, unless disabled via props.
49
+ * @param extensionLoader Extension loader to add
50
+ */
51
+ addExtensionLoader(extensionLoader) {
52
+ this._extensionLoaders.push(extensionLoader);
53
+ }
54
+ /** Add an Extension to be bundled during compilation.
55
+ * @param manifestLoader A function that loads the manifest file.
56
+ * @param mainFunc The main function to be executed upon
57
+ */
58
+ async addBuildExtension(manifestPromise, mainFunc) {
59
+ const manifest = await this.getManifest(manifestPromise);
60
+ this._installedExtensions.set(manifest.name, { manifest, mainFunc });
61
+ }
62
+ /** Loops over all enabled Extensions and triggers each one if the provided event is defined. */
63
+ async activateExtensionEvents(event) {
64
+ for (const extension of this._installedExtensions.values()) {
65
+ if (!extension.manifest.activationEvents)
66
+ continue;
67
+ for (const activationEvent of extension.manifest.activationEvents) {
68
+ if (activationEvent === event) {
69
+ this.execute(extension); // eslint-disable-line @typescript-eslint/no-floating-promises
70
+ }
71
+ }
72
+ }
73
+ }
74
+ /** Resolves an import function provided for build-time Extensions that should return a valid
75
+ * Extension Manifest.
76
+ */
77
+ async getManifest(loader) {
78
+ const raw = await loader;
79
+ const manifest = this.parseManifest(raw);
80
+ return manifest;
81
+ }
82
+ async parseManifest(raw) {
83
+ try {
84
+ if ("object" === typeof (raw))
85
+ return raw;
86
+ if ("string" === typeof (raw))
87
+ return JSON.parse(raw);
88
+ }
89
+ catch (err) { }
90
+ throw new Error("Extension is invalid: package.json is not JSON.");
91
+ }
92
+ // Important: The Function constructor is used here to isolate the context in which the Extension javascript has access.
93
+ // By using the Function constructor to create and then execute the extension it will only have access to two scopes:
94
+ // 1. It's own function scope
95
+ // 2. The global scope
96
+ //
97
+ // The global scope is important for an Extension as that is where the reference to the Extension Implementation is supplied
98
+ // from the application side.
99
+ async execute(extension) {
100
+ if (extension.mainFunc)
101
+ return extension.mainFunc();
102
+ }
103
+ }
104
+ exports.ExtensionAdmin = ExtensionAdmin;
105
+ //# sourceMappingURL=ExtensionAdmin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExtensionAdmin.js","sourceRoot":"","sources":["../../../src/extension/ExtensionAdmin.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sHAAsH;AACtH,4CAAyC;AA4BzC,4CAA4C;AAE5C,IAAK,gBAEJ;AAFD,WAAK,gBAAgB;IACnB,iDAA6B,CAAA;AAC/B,CAAC,EAFI,gBAAgB,KAAhB,gBAAgB,QAEpB;AAED;;;;;;GAMG;AACH,MAAa,cAAc;IAgBzB;QAfA,oDAAoD;QAC5C,sBAAiB,GAAsB,EAAE,CAAC;QAElD,2GAA2G;QACnG,yBAAoB,GAAqC,IAAI,GAAG,EAA+B,CAAC;QAExG;;YAEI;QACJ,sIAAsI;QAE/H,cAAS,GAAG,KAAK,IAAI,EAAE;YAC5B,MAAM,IAAI,CAAC,uBAAuB,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;QACpE,CAAC,CAAC;QAGA,qBAAS,CAAC,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACxD,CAAC;IAED;;;OAGG;IACI,uBAAuB,CAAC,eAAgC;QAC7D,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IAClD,CAAC;IAED;;;QAGI;IACG,kBAAkB,CAAC,eAAgC;QACxD,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAC/C,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,iBAAiB,CAAC,eAA6B,EAAE,QAAsB;QAClF,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;QACzD,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;IACvE,CAAC;IAED,gGAAgG;IACxF,KAAK,CAAC,uBAAuB,CAAC,KAAa;QACjD,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,oBAAoB,CAAC,MAAM,EAAE,EAAE;YAC1D,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,gBAAgB;gBACtC,SAAS;YACX,KAAK,MAAM,eAAe,IAAI,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE;gBACjE,IAAI,eAAe,KAAK,KAAK,EAAE;oBAC7B,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,8DAA8D;iBACxF;aACF;SACF;IACH,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,WAAW,CAAC,MAAoB;QAC5C,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC;QACzB,MAAM,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QACzC,OAAO,QAAQ,CAAC;IAClB,CAAC;IAEO,KAAK,CAAC,aAAa,CAAC,GAAY;QACtC,IAAI;YACF,IAAI,QAAQ,KAAK,OAAO,CAAC,GAAG,CAAC;gBAC3B,OAAO,GAAwB,CAAC;YAClC,IAAI,QAAQ,KAAK,OAAO,CAAC,GAAG,CAAC;gBAC3B,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAsB,CAAC;SAC/C;QAAC,OAAO,GAAQ,EAAE,GAAG;QACtB,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IACrE,CAAC;IAED,wHAAwH;IACxH,qHAAqH;IACrH,8BAA8B;IAC9B,uBAAuB;IACvB,EAAE;IACF,4HAA4H;IAC5H,6BAA6B;IACrB,KAAK,CAAC,OAAO,CAAC,SAA8B;QAClD,IAAI,SAAS,CAAC,QAAQ;YACpB,OAAO,SAAS,CAAC,QAAQ,EAAE,CAAC;IAChC,CAAC;CAEF;AAzFD,wCAyFC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Extensions\r\n */\r\n\r\n// import { Extension, ExtensionLoader, ExtensionManifest, LocalExtensionProps, PendingExtension } from \"./Extension\";\r\nimport { IModelApp } from \"../IModelApp\";\r\nimport { ExtensionManifest, LocalExtensionProps } from \"./Extension\";\r\nimport { ExtensionLoader } from \"./ExtensionLoader\";\r\n\r\n/** The Extensions loading system has 3 goals:\r\n * 1. Only fetch what is needed when it is required\r\n * 1. Load a manifest file\r\n * 2. Load the the main module when necessary\r\n * 2. Download the needed files from\r\n *\r\n * 3 ways to load an Extension into the system:\r\n *\r\n * 1. At build-time provide the function to load both the Extension Manifest and import the main module of the extension.\r\n * The main module must contain the activate() function.\r\n * 2. A minimum set of ExtensionLoaderProps that provide enough information to get the manifest\r\n *\r\n * An Extension can be in 3 different states:\r\n * - Known\r\n * - The Extension Admin has the minimal information needed to fetch the manifest for the Extension.\r\n * knows the Extension exists but has not yet loaded the manifest\r\n * - Installed\r\n * - The Extension has the full manifest loaded and can be executed on the activation events\r\n * - Disabled\r\n * - The Extension has the full manifest but is not currently enabled and will not be executed based on the\r\n * activation events.\r\n */\r\n\r\ntype ResolveFunc = (() => Promise<any>);\r\n// type RejectFunc = ((arg: Error) => void);\r\n\r\nenum ActivationEvents {\r\n onStartupApp = \"onStartupApp\",\r\n}\r\n\r\n/** The Extension Admin controls the list of currently known, loaded and executing an Extension.\r\n * Handles the loading of Extensions and maintains a list of the currently loaded Extensions.\r\n *\r\n * On application startup, an initial list of Extensions is gathered by searching in known locations for\r\n *\r\n * @alpha\r\n */\r\nexport class ExtensionAdmin {\r\n /** The list of places to download an Extension. */\r\n private _extensionLoaders: ExtensionLoader[] = [];\r\n\r\n /** Defines the set of extensions that are currently known and can be invoked during activation events. */\r\n private _installedExtensions: Map<string, LocalExtensionProps> = new Map<string, LocalExtensionProps>();\r\n\r\n /**\r\n * Fired when an Extension has been added or removed.\r\n */\r\n // public readonly onInstallExtension = new BeEvent<(added: readonly ExtensionProps[], removed: readonly ExtensionProps[]) => void>();\r\n\r\n public onStartup = async () => {\r\n await this.activateExtensionEvents(ActivationEvents.onStartupApp);\r\n };\r\n\r\n public constructor() {\r\n IModelApp.onBeforeStartup.addListener(this.onStartup);\r\n }\r\n\r\n /** Adds an ExtensionLoader to the front of the list of extension loaders in use. Extension loaders will be invoked front to back.\r\n * By default, the list consists of public Extension Service context, unless disabled via props.\r\n * @param extensionLoader Extension loader to add\r\n */\r\n public addExtensionLoaderFront(extensionLoader: ExtensionLoader) {\r\n this._extensionLoaders.unshift(extensionLoader);\r\n }\r\n\r\n /** Adds an ExtensionLoader to the list of extension loaders in use.\r\n * By default, the list consists of public Extension Service context, unless disabled via props.\r\n * @param extensionLoader Extension loader to add\r\n */\r\n public addExtensionLoader(extensionLoader: ExtensionLoader) {\r\n this._extensionLoaders.push(extensionLoader);\r\n }\r\n\r\n /** Add an Extension to be bundled during compilation.\r\n * @param manifestLoader A function that loads the manifest file.\r\n * @param mainFunc The main function to be executed upon\r\n */\r\n public async addBuildExtension(manifestPromise: Promise<any>, mainFunc?: ResolveFunc): Promise<void> {\r\n const manifest = await this.getManifest(manifestPromise);\r\n this._installedExtensions.set(manifest.name, { manifest, mainFunc });\r\n }\r\n\r\n /** Loops over all enabled Extensions and triggers each one if the provided event is defined. */\r\n private async activateExtensionEvents(event: string) {\r\n for (const extension of this._installedExtensions.values()) {\r\n if (!extension.manifest.activationEvents)\r\n continue;\r\n for (const activationEvent of extension.manifest.activationEvents) {\r\n if (activationEvent === event) {\r\n this.execute(extension); // eslint-disable-line @typescript-eslint/no-floating-promises\r\n }\r\n }\r\n }\r\n }\r\n\r\n /** Resolves an import function provided for build-time Extensions that should return a valid\r\n * Extension Manifest.\r\n */\r\n private async getManifest(loader: Promise<any>): Promise<ExtensionManifest> {\r\n const raw = await loader;\r\n const manifest = this.parseManifest(raw);\r\n return manifest;\r\n }\r\n\r\n private async parseManifest(raw: unknown): Promise<ExtensionManifest> {\r\n try {\r\n if (\"object\" === typeof (raw))\r\n return raw as ExtensionManifest;\r\n if (\"string\" === typeof (raw))\r\n return JSON.parse(raw) as ExtensionManifest;\r\n } catch (err: any) { }\r\n throw new Error(\"Extension is invalid: package.json is not JSON.\");\r\n }\r\n\r\n // Important: The Function constructor is used here to isolate the context in which the Extension javascript has access.\r\n // By using the Function constructor to create and then execute the extension it will only have access to two scopes:\r\n // 1. It's own function scope\r\n // 2. The global scope\r\n //\r\n // The global scope is important for an Extension as that is where the reference to the Extension Implementation is supplied\r\n // from the application side.\r\n private async execute(extension: LocalExtensionProps): Promise<void> {\r\n if (extension.mainFunc)\r\n return extension.mainFunc();\r\n }\r\n\r\n}\r\n"]}
@@ -0,0 +1,20 @@
1
+ import type { ToolAdmin } from "../tools/ToolAdmin";
2
+ import type { AccuSnap } from "../AccuSnap";
3
+ import type { NotificationManager } from "../NotificationManager";
4
+ import type { ViewManager } from "../ViewManager";
5
+ import type { ElementLocateManager } from "../ElementLocateManager";
6
+ import type { Localization } from "@itwin/core-common";
7
+ /**
8
+ * Subset of IModelApp exposed to Extensions
9
+ * @beta
10
+ */
11
+ export declare class ExtensionHost {
12
+ protected constructor();
13
+ static get toolAdmin(): ToolAdmin;
14
+ static get notifications(): NotificationManager;
15
+ static get viewManager(): ViewManager;
16
+ static get locateManager(): ElementLocateManager;
17
+ static get accuSnap(): AccuSnap;
18
+ static get localization(): Localization;
19
+ }
20
+ //# sourceMappingURL=ExtensionHost.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExtensionHost.d.ts","sourceRoot":"","sources":["../../../src/extension/ExtensionHost.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;GAGG;AACH,qBAAa,aAAa;IACxB,SAAS;IAET,WAAkB,SAAS,IAAI,SAAS,CAAgC;IACxE,WAAkB,aAAa,IAAI,mBAAmB,CAAoC;IAC1F,WAAkB,WAAW,IAAI,WAAW,CAAkC;IAC9E,WAAkB,aAAa,IAAI,oBAAoB,CAAoC;IAC3F,WAAkB,QAAQ,IAAI,QAAQ,CAA+B;IACrE,WAAkB,YAAY,IAAI,YAAY,CAAmC;CAClF"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExtensionHost = void 0;
4
+ const IModelApp_1 = require("../IModelApp");
5
+ /**
6
+ * Subset of IModelApp exposed to Extensions
7
+ * @beta
8
+ */
9
+ class ExtensionHost {
10
+ constructor() { }
11
+ static get toolAdmin() { return IModelApp_1.IModelApp.toolAdmin; }
12
+ static get notifications() { return IModelApp_1.IModelApp.notifications; }
13
+ static get viewManager() { return IModelApp_1.IModelApp.viewManager; }
14
+ static get locateManager() { return IModelApp_1.IModelApp.locateManager; } // internal ?
15
+ static get accuSnap() { return IModelApp_1.IModelApp.accuSnap; }
16
+ static get localization() { return IModelApp_1.IModelApp.localization; } // re think this, should be contribution point
17
+ }
18
+ exports.ExtensionHost = ExtensionHost;
19
+ //# sourceMappingURL=ExtensionHost.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExtensionHost.js","sourceRoot":"","sources":["../../../src/extension/ExtensionHost.ts"],"names":[],"mappings":";;;AAAA,4CAAyC;AAQzC;;;GAGG;AACH,MAAa,aAAa;IACxB,gBAA0B,CAAC;IAEpB,MAAM,KAAK,SAAS,KAAgB,OAAO,qBAAS,CAAC,SAAS,CAAC,CAAC,CAAC;IACjE,MAAM,KAAK,aAAa,KAA0B,OAAO,qBAAS,CAAC,aAAa,CAAC,CAAC,CAAC;IACnF,MAAM,KAAK,WAAW,KAAkB,OAAO,qBAAS,CAAC,WAAW,CAAC,CAAC,CAAC;IACvE,MAAM,KAAK,aAAa,KAA2B,OAAO,qBAAS,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,aAAa;IAClG,MAAM,KAAK,QAAQ,KAAe,OAAO,qBAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC9D,MAAM,KAAK,YAAY,KAAmB,OAAO,qBAAS,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,8CAA8C;CACjI;AATD,sCASC","sourcesContent":["import { IModelApp } from \"../IModelApp\";\r\nimport type { ToolAdmin } from \"../tools/ToolAdmin\";\r\nimport type { AccuSnap } from \"../AccuSnap\";\r\nimport type { NotificationManager } from \"../NotificationManager\";\r\nimport type { ViewManager } from \"../ViewManager\";\r\nimport type { ElementLocateManager } from \"../ElementLocateManager\";\r\nimport type { Localization } from \"@itwin/core-common\";\r\n\r\n/**\r\n * Subset of IModelApp exposed to Extensions\r\n * @beta\r\n */\r\nexport class ExtensionHost {\r\n protected constructor() { }\r\n\r\n public static get toolAdmin(): ToolAdmin { return IModelApp.toolAdmin; }\r\n public static get notifications(): NotificationManager { return IModelApp.notifications; }\r\n public static get viewManager(): ViewManager { return IModelApp.viewManager; }\r\n public static get locateManager(): ElementLocateManager { return IModelApp.locateManager; } // internal ?\r\n public static get accuSnap(): AccuSnap { return IModelApp.accuSnap; }\r\n public static get localization(): Localization { return IModelApp.localization; } // re think this, should be contribution point\r\n}\r\n"]}
@@ -0,0 +1,16 @@
1
+ import { ToolType } from "../tools/Tool";
2
+ import { CommonToolbarItem, ToolbarOrientation, ToolbarUsage, UiItemsProvider } from "@itwin/appui-abstract";
3
+ export declare class ToolProvider implements UiItemsProvider {
4
+ readonly id: string;
5
+ private _toolId;
6
+ private _toolIcon;
7
+ private _toolLabel;
8
+ constructor(tool: ToolType);
9
+ provideToolbarButtonItems(_stageId: string, stageUsage: string, toolbarUsage: ToolbarUsage, toolbarOrientation: ToolbarOrientation): CommonToolbarItem[];
10
+ }
11
+ export declare class ExtensionImpl {
12
+ private _id;
13
+ constructor(_id: string);
14
+ registerTool(tool: ToolType, onRegistered?: () => any): Promise<void>;
15
+ }
16
+ //# sourceMappingURL=ExtensionImpl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExtensionImpl.d.ts","sourceRoot":"","sources":["../../../src/extension/ExtensionImpl.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,iBAAiB,EAAoC,kBAAkB,EAAE,YAAY,EAAkB,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE/J,qBAAa,YAAa,YAAW,eAAe;IAClD,SAAgB,EAAE,SAAC;IACnB,OAAO,CAAC,OAAO,CAAM;IACrB,OAAO,CAAC,SAAS,CAAC;IAClB,OAAO,CAAC,UAAU,CAAC;gBAEA,IAAI,EAAE,QAAQ;IAO1B,yBAAyB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,GAAG,iBAAiB,EAAE;CAIhK;AAED,qBAAa,aAAa;IACZ,OAAO,CAAC,GAAG;gBAAH,GAAG,EAAE,MAAM;IAElB,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;CASnF"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.ExtensionImpl = exports.ToolProvider = void 0;
8
+ const IModelApp_1 = require("../IModelApp");
9
+ const appui_abstract_1 = require("@itwin/appui-abstract");
10
+ class ToolProvider {
11
+ constructor(tool) {
12
+ this._toolId = "";
13
+ this.id = `ToolProvider:${tool.toolId}`;
14
+ this._toolId = tool.toolId;
15
+ this._toolIcon = tool.iconSpec;
16
+ this._toolLabel = tool.description;
17
+ }
18
+ provideToolbarButtonItems(_stageId, stageUsage, toolbarUsage, toolbarOrientation) {
19
+ const toolbarItem = appui_abstract_1.ToolbarItemUtilities.createActionButton(this._toolId, 0, this._toolIcon, this._toolLabel, async () => { await IModelApp_1.IModelApp.tools.run(this._toolId); });
20
+ return stageUsage === appui_abstract_1.StageUsage.General && toolbarUsage === appui_abstract_1.ToolbarUsage.ContentManipulation && toolbarOrientation === appui_abstract_1.ToolbarOrientation.Horizontal ? [toolbarItem] : [];
21
+ }
22
+ }
23
+ exports.ToolProvider = ToolProvider;
24
+ class ExtensionImpl {
25
+ constructor(_id) {
26
+ this._id = _id;
27
+ }
28
+ async registerTool(tool, onRegistered) {
29
+ try {
30
+ IModelApp_1.IModelApp.tools.register(tool);
31
+ appui_abstract_1.UiItemsManager.register(new ToolProvider(tool));
32
+ onRegistered === null || onRegistered === void 0 ? void 0 : onRegistered();
33
+ }
34
+ catch (e) {
35
+ console.log(`Error registering tool: ${e}`); // eslint-disable-line
36
+ }
37
+ }
38
+ }
39
+ exports.ExtensionImpl = ExtensionImpl;
40
+ //# sourceMappingURL=ExtensionImpl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExtensionImpl.js","sourceRoot":"","sources":["../../../src/extension/ExtensionImpl.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAG/F,4CAAyC;AACzC,0DAA+J;AAE/J,MAAa,YAAY;IAMvB,YAAmB,IAAc;QAJzB,YAAO,GAAG,EAAE,CAAC;QAKnB,IAAI,CAAC,EAAE,GAAG,gBAAgB,IAAI,CAAC,MAAM,EAAE,CAAC;QACxC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC;IACrC,CAAC;IAEM,yBAAyB,CAAC,QAAgB,EAAE,UAAkB,EAAE,YAA0B,EAAE,kBAAsC;QACvI,MAAM,WAAW,GAAG,qCAAoB,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,EAAE,KAAK,IAAI,EAAE,GAAG,MAAM,qBAAS,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACxK,OAAO,UAAU,KAAK,2BAAU,CAAC,OAAO,IAAI,YAAY,KAAK,6BAAY,CAAC,mBAAmB,IAAI,kBAAkB,KAAK,mCAAkB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7K,CAAC;CACF;AAjBD,oCAiBC;AAED,MAAa,aAAa;IACxB,YAAoB,GAAW;QAAX,QAAG,GAAH,GAAG,CAAQ;IAAI,CAAC;IAE7B,KAAK,CAAC,YAAY,CAAC,IAAc,EAAE,YAAwB;QAChE,IAAI;YACF,qBAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC/B,+BAAc,CAAC,QAAQ,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;YAChD,YAAY,aAAZ,YAAY,uBAAZ,YAAY,EAAI,CAAC;SAClB;QAAC,OAAO,CAAM,EAAE;YACf,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,EAAE,CAAC,CAAC,CAAC,sBAAsB;SACpE;IACH,CAAC;CACF;AAZD,sCAYC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { ToolType } from \"../tools/Tool\";\r\nimport { IModelApp } from \"../IModelApp\";\r\nimport { CommonToolbarItem, StageUsage, ToolbarItemUtilities, ToolbarOrientation, ToolbarUsage, UiItemsManager, UiItemsProvider } from \"@itwin/appui-abstract\";\r\n\r\nexport class ToolProvider implements UiItemsProvider {\r\n public readonly id;\r\n private _toolId = \"\";\r\n private _toolIcon;\r\n private _toolLabel;\r\n\r\n public constructor(tool: ToolType) {\r\n this.id = `ToolProvider:${tool.toolId}`;\r\n this._toolId = tool.toolId;\r\n this._toolIcon = tool.iconSpec;\r\n this._toolLabel = tool.description;\r\n }\r\n\r\n public provideToolbarButtonItems(_stageId: string, stageUsage: string, toolbarUsage: ToolbarUsage, toolbarOrientation: ToolbarOrientation): CommonToolbarItem[] {\r\n const toolbarItem = ToolbarItemUtilities.createActionButton(this._toolId, 0, this._toolIcon, this._toolLabel, async () => { await IModelApp.tools.run(this._toolId); });\r\n return stageUsage === StageUsage.General && toolbarUsage === ToolbarUsage.ContentManipulation && toolbarOrientation === ToolbarOrientation.Horizontal ? [toolbarItem] : [];\r\n }\r\n}\r\n\r\nexport class ExtensionImpl {\r\n constructor(private _id: string) { }\r\n\r\n public async registerTool(tool: ToolType, onRegistered?: () => any): Promise<void> {\r\n try {\r\n IModelApp.tools.register(tool);\r\n UiItemsManager.register(new ToolProvider(tool));\r\n onRegistered?.();\r\n } catch (e: any) {\r\n console.log(`Error registering tool: ${e}`); // eslint-disable-line\r\n }\r\n }\r\n}\r\n"]}
@@ -0,0 +1,20 @@
1
+ import { ExtensionManifest, LocalExtensionProps } from "./Extension";
2
+ /** THe minimum information required to download an Extension */
3
+ export interface ExtensionLoaderProps {
4
+ name: string;
5
+ version: string;
6
+ }
7
+ export interface BuiltInExtensionLoaderProps {
8
+ manifest: Promise<any>;
9
+ loader: (() => Promise<any>);
10
+ }
11
+ /** Describes what is needed in order to write an Extension Loader.
12
+ * @alpha
13
+ */
14
+ export interface ExtensionLoader {
15
+ /** Retrieves an Extension manifest for the provided Extension identifier */
16
+ getManifest(arg: ExtensionLoaderProps): Promise<ExtensionManifest>;
17
+ /** Downloads an Extension provided the name of the Extension */
18
+ downloadExtension(arg: ExtensionLoaderProps): Promise<LocalExtensionProps>;
19
+ }
20
+ //# sourceMappingURL=ExtensionLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExtensionLoader.d.ts","sourceRoot":"","sources":["../../../src/extension/ExtensionLoader.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAErE,gEAAgE;AAChE,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IACvB,MAAM,EAAE,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,4EAA4E;IAC5E,WAAW,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACnE,gEAAgE;IAChE,iBAAiB,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC5E"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ // export class BuiltInExtensionLoader {
8
+ // public async getManifest(name: string): Promise<ExtensionManifest> {
9
+ // }
10
+ // }
11
+ //# sourceMappingURL=ExtensionLoader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExtensionLoader.js","sourceRoot":"","sources":["../../../src/extension/ExtensionLoader.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;AAyB/F,wCAAwC;AACxC,yEAAyE;AAEzE,MAAM;AACN,IAAI","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { ExtensionManifest, LocalExtensionProps } from \"./Extension\";\r\n\r\n/** THe minimum information required to download an Extension */\r\nexport interface ExtensionLoaderProps {\r\n name: string;\r\n version: string;\r\n}\r\n\r\nexport interface BuiltInExtensionLoaderProps {\r\n manifest: Promise<any>;\r\n loader: (() => Promise<any>);\r\n}\r\n\r\n/** Describes what is needed in order to write an Extension Loader.\r\n * @alpha\r\n */\r\nexport interface ExtensionLoader {\r\n /** Retrieves an Extension manifest for the provided Extension identifier */\r\n getManifest(arg: ExtensionLoaderProps): Promise<ExtensionManifest>;\r\n /** Downloads an Extension provided the name of the Extension */\r\n downloadExtension(arg: ExtensionLoaderProps): Promise<LocalExtensionProps>;\r\n}\r\n\r\n// export class BuiltInExtensionLoader {\r\n// public async getManifest(name: string): Promise<ExtensionManifest> {\r\n\r\n// }\r\n// }\r\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ExtensionRuntime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExtensionRuntime.d.ts","sourceRoot":"","sources":["../../../src/extension/ExtensionRuntime.ts"],"names":[],"mappings":""}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ /* eslint-disable @typescript-eslint/naming-convention */
8
+ const AccuDraw_1 = require("../AccuDraw");
9
+ const AuxCoordSys_1 = require("../AuxCoordSys");
10
+ const CoordSystem_1 = require("../CoordSystem");
11
+ const ElementLocateManager_1 = require("../ElementLocateManager");
12
+ const FlashSettings_1 = require("../FlashSettings");
13
+ const FrontendLoggerCategory_1 = require("../FrontendLoggerCategory");
14
+ const HitDetail_1 = require("../HitDetail");
15
+ const NotificationManager_1 = require("../NotificationManager");
16
+ const SelectionSet_1 = require("../SelectionSet");
17
+ const StandardView_1 = require("../StandardView");
18
+ const ViewRect_1 = require("../ViewRect");
19
+ const ViewStatus_1 = require("../ViewStatus");
20
+ const Viewport_1 = require("../Viewport");
21
+ const GraphicBuilder_1 = require("../render/GraphicBuilder");
22
+ const Pixel_1 = require("../render/Pixel");
23
+ const RenderTexture_1 = require("../render/RenderTexture");
24
+ const ScreenSpaceEffectBuilder_1 = require("../render/ScreenSpaceEffectBuilder");
25
+ const internal_1 = require("../tile/internal");
26
+ const ClipViewTool_1 = require("../tools/ClipViewTool");
27
+ const PrimitiveTool_1 = require("../tools/PrimitiveTool");
28
+ const SelectTool_1 = require("../tools/SelectTool");
29
+ const Tool_1 = require("../tools/Tool");
30
+ const ToolAdmin_1 = require("../tools/ToolAdmin");
31
+ const ToolAssistance_1 = require("../tools/ToolAssistance");
32
+ const ViewTool_1 = require("../tools/ViewTool");
33
+ const core_common_1 = require("@itwin/core-common");
34
+ const ExtensionImpl_1 = require("./ExtensionImpl");
35
+ const ExtensionHost_1 = require("./ExtensionHost");
36
+ const globalSymbol = Symbol.for("itwin.core.frontend.globals");
37
+ if (globalThis[globalSymbol])
38
+ throw new Error("Multiple @itwin/core-frontend imports detected!");
39
+ const getExtensionApi = (id) => {
40
+ return {
41
+ exports: {
42
+ InteractiveTool: Tool_1.InteractiveTool, PrimitiveTool: PrimitiveTool_1.PrimitiveTool, ViewTool: ViewTool_1.ViewTool, Tool: Tool_1.Tool,
43
+ ToolAssistance: ToolAssistance_1.ToolAssistance, BeButtonEvent: Tool_1.BeButtonEvent, ViewRect: ViewRect_1.ViewRect, Pixel: Pixel_1.Pixel, LocateResponse: ElementLocateManager_1.LocateResponse,
44
+ ColorDef: core_common_1.ColorDef,
45
+ ExtensionHost: ExtensionHost_1.ExtensionHost,
46
+ ACSDisplayOptions: AuxCoordSys_1.ACSDisplayOptions, ACSType: AuxCoordSys_1.ACSType, ActivityMessageEndReason: NotificationManager_1.ActivityMessageEndReason, BeButton: Tool_1.BeButton, BeModifierKeys: Tool_1.BeModifierKeys, ClipEventType: ClipViewTool_1.ClipEventType, ContextRotationId: AccuDraw_1.ContextRotationId, CoordinateLockOverrides: Tool_1.CoordinateLockOverrides,
47
+ CoordSource: Tool_1.CoordSource, CoordSystem: CoordSystem_1.CoordSystem, DepthPointSource: Viewport_1.DepthPointSource, EventHandled: Tool_1.EventHandled, FlashMode: FlashSettings_1.FlashMode, FrontendLoggerCategory: FrontendLoggerCategory_1.FrontendLoggerCategory, GraphicType: GraphicBuilder_1.GraphicType, HitDetailType: HitDetail_1.HitDetailType, HitGeomType: HitDetail_1.HitGeomType,
48
+ HitParentGeomType: HitDetail_1.HitParentGeomType, HitPriority: HitDetail_1.HitPriority, HitSource: HitDetail_1.HitSource, InputSource: Tool_1.InputSource, KeyinParseError: Tool_1.KeyinParseError, LocateAction: ElementLocateManager_1.LocateAction, LocateFilterStatus: ElementLocateManager_1.LocateFilterStatus, ManipulatorToolEvent: ToolAdmin_1.ManipulatorToolEvent,
49
+ MessageBoxIconType: NotificationManager_1.MessageBoxIconType, MessageBoxType: NotificationManager_1.MessageBoxType, MessageBoxValue: NotificationManager_1.MessageBoxValue, OutputMessageAlert: NotificationManager_1.OutputMessageAlert, OutputMessagePriority: NotificationManager_1.OutputMessagePriority, OutputMessageType: NotificationManager_1.OutputMessageType, ParseAndRunResult: Tool_1.ParseAndRunResult,
50
+ SelectionMethod: SelectTool_1.SelectionMethod, SelectionMode: SelectTool_1.SelectionMode, SelectionProcessing: SelectTool_1.SelectionProcessing, SelectionSetEventType: SelectionSet_1.SelectionSetEventType, SnapHeat: HitDetail_1.SnapHeat, SnapMode: HitDetail_1.SnapMode, SnapStatus: ElementLocateManager_1.SnapStatus, StandardViewId: StandardView_1.StandardViewId, StartOrResume: ToolAdmin_1.StartOrResume,
51
+ TextureTransparency: RenderTexture_1.TextureTransparency, TileBoundingBoxes: internal_1.TileBoundingBoxes, TileGraphicType: internal_1.TileGraphicType, TileLoadPriority: internal_1.TileLoadPriority, TileLoadStatus: internal_1.TileLoadStatus, TileTreeLoadStatus: internal_1.TileTreeLoadStatus, TileVisibility: internal_1.TileVisibility,
52
+ ToolAssistanceImage: ToolAssistance_1.ToolAssistanceImage, ToolAssistanceInputMethod: ToolAssistance_1.ToolAssistanceInputMethod, UniformType: ScreenSpaceEffectBuilder_1.UniformType, VaryingType: ScreenSpaceEffectBuilder_1.VaryingType, ViewStatus: ViewStatus_1.ViewStatus, ViewUndoEvent: Viewport_1.ViewUndoEvent,
53
+ },
54
+ api: new ExtensionImpl_1.ExtensionImpl(id),
55
+ };
56
+ };
57
+ globalThis[globalSymbol] = {
58
+ getExtensionApi,
59
+ };
60
+ //# sourceMappingURL=ExtensionRuntime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExtensionRuntime.js","sourceRoot":"","sources":["../../../src/extension/ExtensionRuntime.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;AAE/F,yDAAyD;AAEzD,0CAAgD;AAChD,gDAA4D;AAC5D,gDAA6C;AAC7C,kEAAuG;AACvG,oDAA6C;AAC7C,sEAAmE;AACnE,4CAAyH;AACzH,gEAAqL;AACrL,kDAAwD;AACxD,kDAAiD;AACjD,0CAAuC;AACvC,8CAA2C;AAC3C,0CAA8D;AAC9D,6DAAuD;AACvD,2CAAwC;AACxC,2DAA8D;AAC9D,iFAA8E;AAC9E,+CAA4I;AAC5I,wDAAsD;AACtD,0DAAuD;AACvD,oDAA0F;AAC1F,wCAAoM;AACpM,kDAAyE;AACzE,4DAAyG;AACzG,gDAA6C;AAE7C,oDAA8C;AAC9C,mDAAgD;AAChD,mDAAgD;AAEhD,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;AAC/D,IAAK,UAAkB,CAAC,YAAY,CAAC;IACnC,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;AAErE,MAAM,eAAe,GAAG,CAAC,EAAU,EAAE,EAAE;IACrC,OAAO;QACL,OAAO,EAAE;YACP,eAAe,EAAf,sBAAe,EAAE,aAAa,EAAb,6BAAa,EAAE,QAAQ,EAAR,mBAAQ,EAAE,IAAI,EAAJ,WAAI;YAE9C,cAAc,EAAd,+BAAc,EAAE,aAAa,EAAb,oBAAa,EAAE,QAAQ,EAAR,mBAAQ,EAAE,KAAK,EAAL,aAAK,EAAE,cAAc,EAAd,qCAAc;YAE9D,QAAQ,EAAR,sBAAQ;YAER,aAAa,EAAb,6BAAa;YAEb,iBAAiB,EAAjB,+BAAiB,EAAE,OAAO,EAAP,qBAAO,EAAE,wBAAwB,EAAxB,8CAAwB,EAAE,QAAQ,EAAR,eAAQ,EAAE,cAAc,EAAd,qBAAc,EAAE,aAAa,EAAb,4BAAa,EAAE,iBAAiB,EAAjB,4BAAiB,EAAE,uBAAuB,EAAvB,8BAAuB;YACzI,WAAW,EAAX,kBAAW,EAAE,WAAW,EAAX,yBAAW,EAAE,gBAAgB,EAAhB,2BAAgB,EAAE,YAAY,EAAZ,mBAAY,EAAE,SAAS,EAAT,yBAAS,EAAE,sBAAsB,EAAtB,+CAAsB,EAAE,WAAW,EAAX,4BAAW,EAAE,aAAa,EAAb,yBAAa,EAAE,WAAW,EAAX,uBAAW;YACpI,iBAAiB,EAAjB,6BAAiB,EAAE,WAAW,EAAX,uBAAW,EAAE,SAAS,EAAT,qBAAS,EAAE,WAAW,EAAX,kBAAW,EAAE,eAAe,EAAf,sBAAe,EAAE,YAAY,EAAZ,mCAAY,EAAE,kBAAkB,EAAlB,yCAAkB,EAAE,oBAAoB,EAApB,gCAAoB;YAC/H,kBAAkB,EAAlB,wCAAkB,EAAE,cAAc,EAAd,oCAAc,EAAE,eAAe,EAAf,qCAAe,EAAE,kBAAkB,EAAlB,wCAAkB,EAAE,qBAAqB,EAArB,2CAAqB,EAAE,iBAAiB,EAAjB,uCAAiB,EAAE,iBAAiB,EAAjB,wBAAiB;YACpI,eAAe,EAAf,4BAAe,EAAE,aAAa,EAAb,0BAAa,EAAE,mBAAmB,EAAnB,gCAAmB,EAAE,qBAAqB,EAArB,oCAAqB,EAAE,QAAQ,EAAR,oBAAQ,EAAE,QAAQ,EAAR,oBAAQ,EAAE,UAAU,EAAV,iCAAU,EAAE,cAAc,EAAd,6BAAc,EAAE,aAAa,EAAb,yBAAa;YACzI,mBAAmB,EAAnB,mCAAmB,EAAE,iBAAiB,EAAjB,4BAAiB,EAAE,eAAe,EAAf,0BAAe,EAAE,gBAAgB,EAAhB,2BAAgB,EAAE,cAAc,EAAd,yBAAc,EAAE,kBAAkB,EAAlB,6BAAkB,EAAE,cAAc,EAAd,yBAAc;YAC7H,mBAAmB,EAAnB,oCAAmB,EAAE,yBAAyB,EAAzB,0CAAyB,EAAE,WAAW,EAAX,sCAAW,EAAE,WAAW,EAAX,sCAAW,EAAE,UAAU,EAAV,uBAAU,EAAE,aAAa,EAAb,wBAAa;SACpG;QACD,GAAG,EAAE,IAAI,6BAAa,CAAC,EAAE,CAAC;KAC3B,CAAC;AACJ,CAAC,CAAC;AAED,UAAkB,CAAC,YAAY,CAAC,GAAG;IAClC,eAAe;CAChB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/* eslint-disable @typescript-eslint/naming-convention */\r\n\r\nimport { ContextRotationId } from \"../AccuDraw\";\r\nimport { ACSDisplayOptions, ACSType } from \"../AuxCoordSys\";\r\nimport { CoordSystem } from \"../CoordSystem\";\r\nimport { LocateAction, LocateFilterStatus, LocateResponse, SnapStatus } from \"../ElementLocateManager\";\r\nimport { FlashMode } from \"../FlashSettings\";\r\nimport { FrontendLoggerCategory } from \"../FrontendLoggerCategory\";\r\nimport { HitDetailType, HitGeomType, HitParentGeomType, HitPriority, HitSource, SnapHeat, SnapMode } from \"../HitDetail\";\r\nimport { ActivityMessageEndReason, MessageBoxIconType, MessageBoxType, MessageBoxValue, OutputMessageAlert, OutputMessagePriority, OutputMessageType } from \"../NotificationManager\";\r\nimport { SelectionSetEventType } from \"../SelectionSet\";\r\nimport { StandardViewId } from \"../StandardView\";\r\nimport { ViewRect } from \"../ViewRect\";\r\nimport { ViewStatus } from \"../ViewStatus\";\r\nimport { DepthPointSource, ViewUndoEvent } from \"../Viewport\";\r\nimport { GraphicType } from \"../render/GraphicBuilder\";\r\nimport { Pixel } from \"../render/Pixel\";\r\nimport { TextureTransparency } from \"../render/RenderTexture\";\r\nimport { UniformType, VaryingType } from \"../render/ScreenSpaceEffectBuilder\";\r\nimport { TileBoundingBoxes, TileGraphicType, TileLoadPriority, TileLoadStatus, TileTreeLoadStatus, TileVisibility } from \"../tile/internal\";\r\nimport { ClipEventType } from \"../tools/ClipViewTool\";\r\nimport { PrimitiveTool } from \"../tools/PrimitiveTool\";\r\nimport { SelectionMethod, SelectionMode, SelectionProcessing } from \"../tools/SelectTool\";\r\nimport { BeButton, BeButtonEvent, BeModifierKeys, CoordinateLockOverrides, CoordSource, EventHandled, InputSource, InteractiveTool, KeyinParseError, ParseAndRunResult, Tool } from \"../tools/Tool\";\r\nimport { ManipulatorToolEvent, StartOrResume } from \"../tools/ToolAdmin\";\r\nimport { ToolAssistance, ToolAssistanceImage, ToolAssistanceInputMethod } from \"../tools/ToolAssistance\";\r\nimport { ViewTool } from \"../tools/ViewTool\";\r\n\r\nimport { ColorDef } from \"@itwin/core-common\";\r\nimport { ExtensionImpl } from \"./ExtensionImpl\";\r\nimport { ExtensionHost } from \"./ExtensionHost\";\r\n\r\nconst globalSymbol = Symbol.for(\"itwin.core.frontend.globals\");\r\nif ((globalThis as any)[globalSymbol])\r\n throw new Error(\"Multiple @itwin/core-frontend imports detected!\");\r\n\r\nconst getExtensionApi = (id: string) => {\r\n return {\r\n exports: {\r\n InteractiveTool, PrimitiveTool, ViewTool, Tool,\r\n\r\n ToolAssistance, BeButtonEvent, ViewRect, Pixel, LocateResponse,\r\n\r\n ColorDef,\r\n\r\n ExtensionHost,\r\n\r\n ACSDisplayOptions, ACSType, ActivityMessageEndReason, BeButton, BeModifierKeys, ClipEventType, ContextRotationId, CoordinateLockOverrides,\r\n CoordSource, CoordSystem, DepthPointSource, EventHandled, FlashMode, FrontendLoggerCategory, GraphicType, HitDetailType, HitGeomType,\r\n HitParentGeomType, HitPriority, HitSource, InputSource, KeyinParseError, LocateAction, LocateFilterStatus, ManipulatorToolEvent,\r\n MessageBoxIconType, MessageBoxType, MessageBoxValue, OutputMessageAlert, OutputMessagePriority, OutputMessageType, ParseAndRunResult,\r\n SelectionMethod, SelectionMode, SelectionProcessing, SelectionSetEventType, SnapHeat, SnapMode, SnapStatus, StandardViewId, StartOrResume,\r\n TextureTransparency, TileBoundingBoxes, TileGraphicType, TileLoadPriority, TileLoadStatus, TileTreeLoadStatus, TileVisibility,\r\n ToolAssistanceImage, ToolAssistanceInputMethod, UniformType, VaryingType, ViewStatus, ViewUndoEvent,\r\n },\r\n api: new ExtensionImpl(id),\r\n };\r\n};\r\n\r\n(globalThis as any)[globalSymbol] = {\r\n getExtensionApi,\r\n};\r\n"]}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The Extension framework is made up of multiple pieces:
3
+ *
4
+ * - Extension Impl
5
+ * - Extension API
6
+ * - The Extension API defines all of the types and API that can be used by an Extension.
7
+ * - Extension Admin loading
8
+ * - Handles the
9
+ * - Extension Hooks
10
+ * - Defines the
11
+ */
12
+ export * from "./Extension";
13
+ export * from "./ExtensionAdmin";
14
+ export * from "./ExtensionImpl";
15
+ export * from "./ExtensionLoader";
16
+ export * from "./ExtensionHost";
17
+ import "./ExtensionRuntime";
18
+ //# sourceMappingURL=extensions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../../src/extension/extensions.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;GAUG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,OAAO,oBAAoB,CAAC"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ // Barrel file for all extension related files.
18
+ /**
19
+ * The Extension framework is made up of multiple pieces:
20
+ *
21
+ * - Extension Impl
22
+ * - Extension API
23
+ * - The Extension API defines all of the types and API that can be used by an Extension.
24
+ * - Extension Admin loading
25
+ * - Handles the
26
+ * - Extension Hooks
27
+ * - Defines the
28
+ */
29
+ __exportStar(require("./Extension"), exports);
30
+ __exportStar(require("./ExtensionAdmin"), exports);
31
+ __exportStar(require("./ExtensionImpl"), exports);
32
+ __exportStar(require("./ExtensionLoader"), exports);
33
+ __exportStar(require("./ExtensionHost"), exports);
34
+ require("./ExtensionRuntime");
35
+ //# sourceMappingURL=extensions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions.js","sourceRoot":"","sources":["../../../src/extension/extensions.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;AAE/F,+CAA+C;AAE/C;;;;;;;;;;GAUG;AAEH,8CAA4B;AAC5B,mDAAiC;AACjC,kDAAgC;AAChC,oDAAkC;AAClC,kDAAgC;AAChC,8BAA4B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n// Barrel file for all extension related files.\r\n\r\n/**\r\n * The Extension framework is made up of multiple pieces:\r\n *\r\n * - Extension Impl\r\n * - Extension API\r\n * - The Extension API defines all of the types and API that can be used by an Extension.\r\n * - Extension Admin loading\r\n * - Handles the\r\n * - Extension Hooks\r\n * - Defines the\r\n */\r\n\r\nexport * from \"./Extension\";\r\nexport * from \"./ExtensionAdmin\";\r\nexport * from \"./ExtensionImpl\";\r\nexport * from \"./ExtensionLoader\";\r\nexport * from \"./ExtensionHost\";\r\nimport \"./ExtensionRuntime\";\r\n"]}
@@ -9,6 +9,7 @@ import { AuthorizationClient, Localization, RpcInterfaceDefinition } from "@itwi
9
9
  import { WebGLRenderCompatibilityInfo } from "@itwin/webgl-compatibility";
10
10
  import { AccuDraw } from "./AccuDraw";
11
11
  import { AccuSnap } from "./AccuSnap";
12
+ import { ExtensionAdmin } from "./extension/ExtensionAdmin";
12
13
  import { ElementLocateManager } from "./ElementLocateManager";
13
14
  import { EntityState } from "./EntityState";
14
15
  import { FrontendHubAccess } from "./FrontendHubAccess";
@@ -146,6 +147,10 @@ export declare class IModelApp {
146
147
  protected constructor();
147
148
  /** Event raised just before the frontend IModelApp is to be shut down */
148
149
  static readonly onBeforeShutdown: BeEvent<() => void>;
150
+ /** Event raised after IModelApp is finished starting up.
151
+ * @internal
152
+ */
153
+ static readonly onBeforeStartup: BeEvent<() => void>;
149
154
  /** Provides authorization information for various frontend APIs */
150
155
  static authorizationClient?: AuthorizationClient;
151
156
  /** The [[ToolRegistry]] for this session. */
@@ -176,7 +181,6 @@ export declare class IModelApp {
176
181
  static get accuDraw(): AccuDraw;
177
182
  /** The [[AccuSnap]] for this session. */
178
183
  static get accuSnap(): AccuSnap;
179
- /** @internal */
180
184
  static get locateManager(): ElementLocateManager;
181
185
  /** @internal */
182
186
  static get tentativePoint(): TentativePoint;
@@ -208,6 +212,8 @@ export declare class IModelApp {
208
212
  * @internal
209
213
  */
210
214
  static readonly telemetry: TelemetryManager;
215
+ /** */
216
+ static readonly extensionAdmin: ExtensionAdmin;
211
217
  /** Map of classFullName to EntityState class */
212
218
  private static _entityClasses;
213
219
  /** Register all of the subclasses of EntityState from a module.