@rasterex/viewer 1.0.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 (156) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +279 -0
  3. package/SECURITY.md +54 -0
  4. package/dist/RasterexViewer.d.ts +70 -0
  5. package/dist/RasterexViewer.d.ts.map +1 -0
  6. package/dist/RasterexViewer.js +410 -0
  7. package/dist/RasterexViewer.js.map +1 -0
  8. package/dist/compat/matrix.d.ts +9 -0
  9. package/dist/compat/matrix.d.ts.map +1 -0
  10. package/dist/compat/matrix.js +12 -0
  11. package/dist/compat/matrix.js.map +1 -0
  12. package/dist/constants.d.ts +8 -0
  13. package/dist/constants.d.ts.map +1 -0
  14. package/dist/constants.js +8 -0
  15. package/dist/constants.js.map +1 -0
  16. package/dist/createDocumentViewer.d.ts +8 -0
  17. package/dist/createDocumentViewer.d.ts.map +1 -0
  18. package/dist/createDocumentViewer.js +16 -0
  19. package/dist/createDocumentViewer.js.map +1 -0
  20. package/dist/createViewer.d.ts +4 -0
  21. package/dist/createViewer.d.ts.map +1 -0
  22. package/dist/createViewer.js +5 -0
  23. package/dist/createViewer.js.map +1 -0
  24. package/dist/demo-presets.d.ts +45 -0
  25. package/dist/demo-presets.d.ts.map +1 -0
  26. package/dist/demo-presets.js +22 -0
  27. package/dist/demo-presets.js.map +1 -0
  28. package/dist/demoPresets.d.ts +2 -0
  29. package/dist/demoPresets.d.ts.map +1 -0
  30. package/dist/demoPresets.js +2 -0
  31. package/dist/demoPresets.js.map +1 -0
  32. package/dist/diagnostics.d.ts +76 -0
  33. package/dist/diagnostics.d.ts.map +1 -0
  34. package/dist/diagnostics.js +38 -0
  35. package/dist/diagnostics.js.map +1 -0
  36. package/dist/domains/AnnotationsApi.d.ts +139 -0
  37. package/dist/domains/AnnotationsApi.d.ts.map +1 -0
  38. package/dist/domains/AnnotationsApi.js +256 -0
  39. package/dist/domains/AnnotationsApi.js.map +1 -0
  40. package/dist/domains/BlocksApi.d.ts +151 -0
  41. package/dist/domains/BlocksApi.d.ts.map +1 -0
  42. package/dist/domains/BlocksApi.js +191 -0
  43. package/dist/domains/BlocksApi.js.map +1 -0
  44. package/dist/domains/CanvasApi.d.ts +13 -0
  45. package/dist/domains/CanvasApi.d.ts.map +1 -0
  46. package/dist/domains/CanvasApi.js +22 -0
  47. package/dist/domains/CanvasApi.js.map +1 -0
  48. package/dist/domains/CollaborationApi.d.ts +65 -0
  49. package/dist/domains/CollaborationApi.d.ts.map +1 -0
  50. package/dist/domains/CollaborationApi.js +177 -0
  51. package/dist/domains/CollaborationApi.js.map +1 -0
  52. package/dist/domains/CompareApi.d.ts +73 -0
  53. package/dist/domains/CompareApi.d.ts.map +1 -0
  54. package/dist/domains/CompareApi.js +175 -0
  55. package/dist/domains/CompareApi.js.map +1 -0
  56. package/dist/domains/DocumentsApi.d.ts +175 -0
  57. package/dist/domains/DocumentsApi.d.ts.map +1 -0
  58. package/dist/domains/DocumentsApi.js +407 -0
  59. package/dist/domains/DocumentsApi.js.map +1 -0
  60. package/dist/domains/LayersApi.d.ts +76 -0
  61. package/dist/domains/LayersApi.d.ts.map +1 -0
  62. package/dist/domains/LayersApi.js +159 -0
  63. package/dist/domains/LayersApi.js.map +1 -0
  64. package/dist/domains/MeasurementsApi.d.ts +150 -0
  65. package/dist/domains/MeasurementsApi.d.ts.map +1 -0
  66. package/dist/domains/MeasurementsApi.js +388 -0
  67. package/dist/domains/MeasurementsApi.js.map +1 -0
  68. package/dist/domains/StylesApi.d.ts +50 -0
  69. package/dist/domains/StylesApi.d.ts.map +1 -0
  70. package/dist/domains/StylesApi.js +53 -0
  71. package/dist/domains/StylesApi.js.map +1 -0
  72. package/dist/domains/ToolsApi.d.ts +251 -0
  73. package/dist/domains/ToolsApi.d.ts.map +1 -0
  74. package/dist/domains/ToolsApi.js +275 -0
  75. package/dist/domains/ToolsApi.js.map +1 -0
  76. package/dist/domains/canvasBrokerCommands.d.ts +38 -0
  77. package/dist/domains/canvasBrokerCommands.d.ts.map +1 -0
  78. package/dist/domains/canvasBrokerCommands.js +79 -0
  79. package/dist/domains/canvasBrokerCommands.js.map +1 -0
  80. package/dist/errors.d.ts +28 -0
  81. package/dist/errors.d.ts.map +1 -0
  82. package/dist/errors.js +82 -0
  83. package/dist/errors.js.map +1 -0
  84. package/dist/index.d.ts +45 -0
  85. package/dist/index.d.ts.map +1 -0
  86. package/dist/index.js +26 -0
  87. package/dist/index.js.map +1 -0
  88. package/dist/messaging/CanvasMessageBroker.d.ts +36 -0
  89. package/dist/messaging/CanvasMessageBroker.d.ts.map +1 -0
  90. package/dist/messaging/CanvasMessageBroker.js +95 -0
  91. package/dist/messaging/CanvasMessageBroker.js.map +1 -0
  92. package/dist/messaging/IframeTransport.d.ts +29 -0
  93. package/dist/messaging/IframeTransport.d.ts.map +1 -0
  94. package/dist/messaging/IframeTransport.js +74 -0
  95. package/dist/messaging/IframeTransport.js.map +1 -0
  96. package/dist/messaging/MessageClient.d.ts +32 -0
  97. package/dist/messaging/MessageClient.d.ts.map +1 -0
  98. package/dist/messaging/MessageClient.js +110 -0
  99. package/dist/messaging/MessageClient.js.map +1 -0
  100. package/dist/messaging/ViewerMessagingSession.d.ts +17 -0
  101. package/dist/messaging/ViewerMessagingSession.d.ts.map +1 -0
  102. package/dist/messaging/ViewerMessagingSession.js +17 -0
  103. package/dist/messaging/ViewerMessagingSession.js.map +1 -0
  104. package/dist/protocol/capabilities.d.ts +6 -0
  105. package/dist/protocol/capabilities.d.ts.map +1 -0
  106. package/dist/protocol/capabilities.js +5 -0
  107. package/dist/protocol/capabilities.js.map +1 -0
  108. package/dist/protocol/compatibility.d.ts +7 -0
  109. package/dist/protocol/compatibility.d.ts.map +1 -0
  110. package/dist/protocol/compatibility.js +2 -0
  111. package/dist/protocol/compatibility.js.map +1 -0
  112. package/dist/protocol/constants.d.ts +3 -0
  113. package/dist/protocol/constants.d.ts.map +1 -0
  114. package/dist/protocol/constants.js +3 -0
  115. package/dist/protocol/constants.js.map +1 -0
  116. package/dist/protocol/envelope.d.ts +27 -0
  117. package/dist/protocol/envelope.d.ts.map +1 -0
  118. package/dist/protocol/envelope.js +2 -0
  119. package/dist/protocol/envelope.js.map +1 -0
  120. package/dist/protocol/errors.d.ts +42 -0
  121. package/dist/protocol/errors.d.ts.map +1 -0
  122. package/dist/protocol/errors.js +35 -0
  123. package/dist/protocol/errors.js.map +1 -0
  124. package/dist/protocol/handshake.d.ts +13 -0
  125. package/dist/protocol/handshake.d.ts.map +1 -0
  126. package/dist/protocol/handshake.js +2 -0
  127. package/dist/protocol/handshake.js.map +1 -0
  128. package/dist/protocol/index.d.ts +10 -0
  129. package/dist/protocol/index.d.ts.map +1 -0
  130. package/dist/protocol/index.js +5 -0
  131. package/dist/protocol/index.js.map +1 -0
  132. package/dist/types.d.ts +29 -0
  133. package/dist/types.d.ts.map +1 -0
  134. package/dist/types.js +2 -0
  135. package/dist/types.js.map +1 -0
  136. package/dist/utils/DomainEventEmitter.d.ts +12 -0
  137. package/dist/utils/DomainEventEmitter.d.ts.map +1 -0
  138. package/dist/utils/DomainEventEmitter.js +34 -0
  139. package/dist/utils/DomainEventEmitter.js.map +1 -0
  140. package/dist/utils/compatibility.d.ts +15 -0
  141. package/dist/utils/compatibility.d.ts.map +1 -0
  142. package/dist/utils/compatibility.js +170 -0
  143. package/dist/utils/compatibility.js.map +1 -0
  144. package/dist/utils/createRequestId.d.ts +2 -0
  145. package/dist/utils/createRequestId.d.ts.map +1 -0
  146. package/dist/utils/createRequestId.js +6 -0
  147. package/dist/utils/createRequestId.js.map +1 -0
  148. package/dist/utils/createSdkInstanceId.d.ts +2 -0
  149. package/dist/utils/createSdkInstanceId.d.ts.map +1 -0
  150. package/dist/utils/createSdkInstanceId.js +6 -0
  151. package/dist/utils/createSdkInstanceId.js.map +1 -0
  152. package/dist/utils/deriveOrigin.d.ts +2 -0
  153. package/dist/utils/deriveOrigin.d.ts.map +1 -0
  154. package/dist/utils/deriveOrigin.js +4 -0
  155. package/dist/utils/deriveOrigin.js.map +1 -0
  156. package/package.json +46 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Aridian Technology
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,279 @@
1
+ # Rasterex Viewer SDK
2
+
3
+ Embed Rasterex Viewer in your web application with a small iframe-based SDK.
4
+
5
+ The SDK mounts the viewer, opens files, controls tools, listens for viewer events, and provides TypeScript types for the public API.
6
+
7
+ Full documentation: https://documentation.rasterex.com/
8
+
9
+ ## Install
10
+
11
+ ```sh
12
+ npm install @rasterex/viewer
13
+ ```
14
+
15
+ ## Requirements
16
+
17
+ Use the package from a bundled application such as Vite, Next.js, Angular, React, Vue, Webpack, or Rollup.
18
+
19
+ Browsers cannot resolve npm package names directly from a plain `<script type="module">` file without a bundler or import map.
20
+
21
+ The viewer container must have a real width and height before mounting.
22
+
23
+ ```html
24
+ <div id="rx-viewer" style="width: 100%; height: 640px"></div>
25
+ ```
26
+
27
+ ## No Framework
28
+
29
+ For a plain HTML page without a framework or bundler, install the package and add an import map before your module script.
30
+
31
+ ```html
32
+ <div id="rx-viewer" style="width: 100%; height: 640px"></div>
33
+
34
+ <script type="importmap">
35
+ {
36
+ "imports": {
37
+ "@rasterex/viewer": "./node_modules/@rasterex/viewer/dist/index.js",
38
+ "@rasterex/viewer/demo-presets": "./node_modules/@rasterex/viewer/dist/demo-presets.js"
39
+ }
40
+ }
41
+ </script>
42
+
43
+ <script type="module">
44
+ import { createViewer } from "@rasterex/viewer";
45
+
46
+ const viewer = createViewer({
47
+ container: "#rx-viewer"
48
+ });
49
+
50
+ await viewer.mount();
51
+ await viewer.ready();
52
+ </script>
53
+ ```
54
+
55
+ ## Quick Start
56
+
57
+ ```ts
58
+ import { createViewer } from "@rasterex/viewer";
59
+
60
+ const viewer = createViewer({
61
+ container: "#rx-viewer"
62
+ });
63
+
64
+ await viewer.mount();
65
+ await viewer.ready();
66
+ ```
67
+
68
+ By default, the SDK loads:
69
+
70
+ ```txt
71
+ https://beta.viewer.viewsoft.com
72
+ ```
73
+
74
+ `targetOrigin` is derived from the viewer URL when it is not provided.
75
+
76
+ ## Open A File URL
77
+
78
+ ```ts
79
+ await viewer.documents.open({
80
+ url: "https://pdfobject.com/pdf/sample.pdf",
81
+ displayName: "sample.pdf",
82
+ cacheId: "file_7f3a9c2_sample_pdf",
83
+ mime: "application/pdf"
84
+ });
85
+ ```
86
+
87
+ The file URL must be reachable by the viewer environment.
88
+
89
+ `displayName` should include the file extension, for example `sample.pdf`.
90
+
91
+ `cacheId` should be a stable file/content ID from your application or server, not the display file name. It lets the server reuse already processed content for the same file, which can make repeat opens faster.
92
+
93
+ ## Open A Browser File
94
+
95
+ ```ts
96
+ const input = document.querySelector<HTMLInputElement>("#file-input");
97
+ const file = input?.files?.[0];
98
+ const fileId = "file_7f3a9c2_sample_pdf";
99
+
100
+ if (file) {
101
+ await viewer.documents.openFile(file, {
102
+ cacheId: fileId
103
+ });
104
+ }
105
+ ```
106
+
107
+ ## Mount And Open In One Call
108
+
109
+ ```ts
110
+ import { createDocumentViewer } from "@rasterex/viewer";
111
+
112
+ const viewer = await createDocumentViewer({
113
+ container: "#rx-viewer",
114
+ document: {
115
+ url: "https://pdfobject.com/pdf/sample.pdf",
116
+ displayName: "sample.pdf"
117
+ }
118
+ });
119
+ ```
120
+
121
+ ## Custom Viewer URL
122
+
123
+ Use `viewerUrl` for your hosted or on-premises viewer.
124
+
125
+ ```ts
126
+ import { createViewer } from "@rasterex/viewer";
127
+
128
+ const viewer = createViewer({
129
+ container: "#rx-viewer",
130
+ viewerUrl: "https://viewer.example.com",
131
+ targetOrigin: "https://viewer.example.com"
132
+ });
133
+
134
+ await viewer.mount();
135
+ await viewer.ready();
136
+ ```
137
+
138
+ If `targetOrigin` is omitted, the SDK uses `new URL(viewerUrl).origin`.
139
+
140
+ ## Tools
141
+
142
+ ```ts
143
+ await viewer.tools.set({
144
+ group: "measurement",
145
+ action: "MEASURE_LENGTH",
146
+ enabled: true
147
+ });
148
+
149
+ viewer.tools.clear();
150
+ ```
151
+
152
+ ## Annotation Events
153
+
154
+ ```ts
155
+ const unsubscribe = viewer.annotations.on("created", (event) => {
156
+ console.log(event.guid, event.data);
157
+ });
158
+
159
+ unsubscribe();
160
+ ```
161
+
162
+ ## Options
163
+
164
+ ```ts
165
+ interface RasterexViewerOptions {
166
+ container: HTMLElement | string;
167
+ viewerUrl?: string;
168
+ targetOrigin?: string;
169
+ connectTimeoutMs?: number;
170
+ readyTimeoutMs?: number;
171
+ commandTimeoutMs?: number;
172
+ debug?: boolean;
173
+ iframeTitle?: string;
174
+ iframeClassName?: string;
175
+ iframeAttributes?: Record<string, string>;
176
+ }
177
+ ```
178
+
179
+ | Option | Description |
180
+ | --- | --- |
181
+ | `container` | DOM element or selector where the iframe is mounted. |
182
+ | `viewerUrl` | Viewer URL to load. Defaults to `https://beta.viewer.viewsoft.com`. |
183
+ | `targetOrigin` | Trusted origin for viewer messages. Defaults to the origin of `viewerUrl`. |
184
+ | `connectTimeoutMs` | Timeout for iframe loading. |
185
+ | `readyTimeoutMs` | Timeout while waiting for viewer readiness. |
186
+ | `commandTimeoutMs` | Timeout for commands that wait for a viewer response. |
187
+ | `debug` | Writes SDK diagnostics to `console.debug`. |
188
+ | `iframeTitle` | Accessible iframe title. |
189
+ | `iframeClassName` | CSS class applied to the iframe. |
190
+ | `iframeAttributes` | Extra iframe attributes, for example `{ allow: "fullscreen" }`. |
191
+
192
+ ## Presets
193
+
194
+ Presets are optional and are exported from a separate entrypoint.
195
+
196
+ ```ts
197
+ import { createViewer } from "@rasterex/viewer";
198
+ import { sandboxCanvas, takeoffDemo } from "@rasterex/viewer/demo-presets";
199
+
200
+ const viewer = createViewer({
201
+ container: "#rx-viewer",
202
+ viewerUrl: sandboxCanvas.viewerUrl,
203
+ targetOrigin: sandboxCanvas.targetOrigin
204
+ });
205
+ ```
206
+
207
+ Takeoff is not loaded by default. Use `takeoffDemo` only when your app explicitly chooses that preset.
208
+
209
+ ## TypeScript
210
+
211
+ Types are included.
212
+
213
+ ```ts
214
+ import type {
215
+ DocumentOpenOptions,
216
+ RasterexViewerOptions,
217
+ ToolAction,
218
+ ToolGroup
219
+ } from "@rasterex/viewer";
220
+ ```
221
+
222
+ TypeScript will report invalid option names, unsupported tool actions, and wrong payload shapes at compile time.
223
+
224
+ ## Common APIs
225
+
226
+ ```ts
227
+ await viewer.documents.open({ url: "/files/sample.pdf", displayName: "sample.pdf" });
228
+ await viewer.tools.set({ group: "measurement", action: "MEASURE_LENGTH", enabled: true });
229
+ viewer.tools.clear();
230
+ viewer.annotations.select({ guid: "annotation-guid" });
231
+ const snapshot = await viewer.layers.getLayers();
232
+ const firstLayer = snapshot.layers[0];
233
+ if (firstLayer?.index !== undefined) {
234
+ await viewer.layers.setLayerVisibility({ index: firstLayer.index, visible: false });
235
+ }
236
+ const blocks = await viewer.blocks.getBlocks();
237
+ const firstBlock = blocks.blocks[0];
238
+ if (firstBlock?.index !== undefined) {
239
+ await viewer.blocks.getBlockDetails({ index: firstBlock.index });
240
+ viewer.blocks.setBlockVisibility({ index: firstBlock.index, visible: false });
241
+ }
242
+ viewer.compare.compare({ backgroundUrl: "old.pdf", overlayUrl: "new.pdf" });
243
+ viewer.styles.setGlobalAppearance({ strokeColor: "#164863" });
244
+ viewer.diagnostics.on("transport.error", (event) => console.error(event.error));
245
+ ```
246
+
247
+ ## Cleanup
248
+
249
+ Destroy the viewer when the page, route, or component no longer needs it.
250
+
251
+ ```ts
252
+ viewer.destroy();
253
+ ```
254
+
255
+ ## License
256
+
257
+ This npm SDK is licensed under the MIT License.
258
+
259
+ The SDK embeds Rasterex Canvas/viewer deployments through an iframe. The Rasterex Canvas application, hosted services, server components, viewer assets, and customer deployments are not licensed by this SDK package and remain subject to their own licenses and agreements.
260
+
261
+ ## Supply Chain Security
262
+
263
+ The SDK is designed to stay lightweight and air-gap friendly:
264
+
265
+ - No runtime npm dependencies.
266
+ - No install-time scripts.
267
+ - No telemetry.
268
+ - No CDN dependency.
269
+ - No bundled Rasterex Canvas Angular application.
270
+
271
+ Before publishing, maintainers should verify the package with:
272
+
273
+ ```sh
274
+ npm audit --omit=dev
275
+ npm audit
276
+ npm pack --dry-run
277
+ ```
278
+
279
+ See `SECURITY.md` for the vulnerability reporting policy and package security scope.
package/SECURITY.md ADDED
@@ -0,0 +1,54 @@
1
+ # Security Policy
2
+
3
+ ## Supported Package
4
+
5
+ Security reports for this repository should focus on the npm SDK package.
6
+
7
+ In scope:
8
+
9
+ - The published SDK package contents.
10
+ - SDK iframe creation, origin validation, and `postMessage` handling.
11
+ - SDK command validation and public API behavior.
12
+ - Package metadata, dependency declarations, and release artifacts.
13
+ - Build and publish configuration used to release the SDK.
14
+
15
+ Out of scope for this SDK package:
16
+
17
+ - Rasterex Canvas application source code.
18
+ - Hosted Rasterex viewer services.
19
+ - Server components, storage, processing backends, and customer deployments.
20
+ - Viewer assets or deployment configuration not shipped in this npm package.
21
+
22
+ ## Reporting A Vulnerability
23
+
24
+ Report suspected vulnerabilities privately to the package maintainers.
25
+
26
+ Include:
27
+
28
+ - Affected package name and version.
29
+ - Reproduction steps or proof of concept.
30
+ - Expected and actual behavior.
31
+ - Browser, framework, and Canvas deployment details when relevant.
32
+
33
+ Do not open a public issue for an unpatched vulnerability.
34
+
35
+ ## Supply Chain Posture
36
+
37
+ The SDK is intended to stay lightweight and air-gap friendly:
38
+
39
+ - No runtime npm dependencies.
40
+ - No install-time scripts.
41
+ - No telemetry.
42
+ - No CDN dependency.
43
+ - No bundled Rasterex Canvas Angular application.
44
+ - Production applications should pass an explicit `viewerUrl` for their hosted or on-premises Canvas deployment.
45
+
46
+ Before publishing, maintainers should run:
47
+
48
+ ```sh
49
+ npm audit --omit=dev
50
+ npm audit
51
+ npm pack --dry-run
52
+ ```
53
+
54
+ Publishing should use npm provenance when the package is released from a supported CI environment.
@@ -0,0 +1,70 @@
1
+ import { Diagnostics } from "./diagnostics.js";
2
+ import { CanvasApi } from "./domains/CanvasApi.js";
3
+ import { DocumentsApi } from "./domains/DocumentsApi.js";
4
+ import { AnnotationsApi } from "./domains/AnnotationsApi.js";
5
+ import { ToolsApi } from "./domains/ToolsApi.js";
6
+ import { MeasurementsApi } from "./domains/MeasurementsApi.js";
7
+ import { CompareApi } from "./domains/CompareApi.js";
8
+ import { CollaborationApi } from "./domains/CollaborationApi.js";
9
+ import { StylesApi } from "./domains/StylesApi.js";
10
+ import { LayersApi } from "./domains/LayersApi.js";
11
+ import { BlocksApi } from "./domains/BlocksApi.js";
12
+ import type { RasterexViewerInfo, RasterexViewerOptions } from "./types.js";
13
+ export declare class RasterexViewer {
14
+ private readonly container;
15
+ private readonly viewerUrl;
16
+ private readonly targetOrigin;
17
+ private readonly iframeTitle;
18
+ private readonly iframeClassName?;
19
+ private readonly iframeAttributes?;
20
+ private readonly connectTimeoutMs;
21
+ private readonly readyTimeoutMs;
22
+ private readonly commandTimeoutMs;
23
+ private readonly sdkInstanceId;
24
+ readonly diagnostics: Diagnostics;
25
+ readonly canvas: CanvasApi;
26
+ readonly documents: DocumentsApi;
27
+ readonly annotations: AnnotationsApi;
28
+ readonly tools: ToolsApi;
29
+ readonly measurements: MeasurementsApi;
30
+ readonly compare: CompareApi;
31
+ readonly collaboration: CollaborationApi;
32
+ readonly styles: StylesApi;
33
+ readonly layers: LayersApi;
34
+ readonly blocks: BlocksApi;
35
+ private state;
36
+ private iframe;
37
+ private mountPromise;
38
+ private readyPromise;
39
+ private readyCleanup;
40
+ private readyReject;
41
+ private messagingSession;
42
+ private canvasSessionId;
43
+ private canvasVersion;
44
+ private buildDate;
45
+ private capabilities;
46
+ private minimumSdkVersion;
47
+ private compatibility;
48
+ constructor(options: RasterexViewerOptions);
49
+ mount(): Promise<void>;
50
+ ready(): Promise<void>;
51
+ destroy(): void;
52
+ getIframe(): HTMLIFrameElement | null;
53
+ isMounted(): boolean;
54
+ getInfo(): RasterexViewerInfo;
55
+ private isViewerReadyMessage;
56
+ private createIframe;
57
+ private startMessaging;
58
+ private completeCanvasBrokerReady;
59
+ private completeProtocolReady;
60
+ private emitMountStarted;
61
+ private emitMountResolved;
62
+ private emitMountFailed;
63
+ private emitMountSlow;
64
+ private emitHandshakeSlow;
65
+ private emitCompatibilityWarning;
66
+ private emitHandshakeComplete;
67
+ private getCanvasBroker;
68
+ private resolveContainer;
69
+ }
70
+ //# sourceMappingURL=RasterexViewer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RasterexViewer.d.ts","sourceRoot":"","sources":["../src/RasterexViewer.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAS/C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,6B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