@paged-media/introspect-wasm 0.33.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.
package/package.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "@paged-media/introspect-wasm",
3
+ "version": "0.33.0",
4
+ "type": "module",
5
+ "main": "paged_introspect_wasm.js",
6
+ "types": "paged_introspect_wasm.d.ts",
7
+ "files": [
8
+ "paged_introspect_wasm.js",
9
+ "paged_introspect_wasm_bg.wasm",
10
+ "paged_introspect_wasm.d.ts"
11
+ ],
12
+ "license": "MPL-2.0 OR LicenseRef-PMEL"
13
+ }
@@ -0,0 +1,407 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * B-04 — creation spec for a page-item group. Members are NodeIds
5
+ * of LEAF page items (flat groups in v1; nesting is a follow-up);
6
+ * the apply layer resolves them to `FrameRef`s, orders them by
7
+ * current document order, and performs the `frames_in_order`
8
+ * surgery so z-order is provably unchanged. `self_id` follows the
9
+ * page-item `u<hex>` convention (minted when absent; echoed
10
+ * resolved in the applied op so the wire reports `createdId`).
11
+ */
12
+ export interface GroupSpec {
13
+ selfId?: string | null;
14
+ members: NodeId[];
15
+ }
16
+
17
+ /**
18
+ * Description of a node about to be inserted. Carries the minimal
19
+ * Stage-1 supported field set plus `item_transform` — `RemoveNode` →
20
+ * undo → re-insertion round-trips these reliably. (Without the
21
+ * transform, undoing a deleteFrame snapped the frame back to the page
22
+ * origin — the editor-suite AC-E2E-PROVE-3 finding.) Remaining
23
+ * non-essential fields (drop_shadow, opacity, effects, …) still
24
+ * default on re-insertion; that residue of the Stage 1 limitation
25
+ * tightens in later stages.
26
+ */
27
+ export type NodeSpec = { kind: "textFrame"; self_id: string; bounds: [number, number, number, number]; fill_color?: string | null; stroke_color?: string | null; stroke_weight?: number | null; item_transform?: [number, number, number, number, number, number] | null } | { kind: "rectangle"; self_id: string; bounds: [number, number, number, number]; fill_color?: string | null; stroke_color?: string | null; stroke_weight?: number | null; item_transform?: [number, number, number, number, number, number] | null } | { kind: "oval"; self_id: string; bounds: [number, number, number, number]; fill_color?: string | null; stroke_color?: string | null; stroke_weight?: number | null; item_transform?: [number, number, number, number, number, number] | null } | { kind: "graphicLine"; self_id: string; bounds: [number, number, number, number]; anchors?: PathAnchorSpec[]; subpath_starts?: number[]; subpath_open?: boolean[]; stroke_color?: string | null; stroke_weight?: number | null; item_transform?: [number, number, number, number, number, number] | null } | { kind: "polygon"; self_id: string; bounds: [number, number, number, number]; anchors?: PathAnchorSpec[]; subpath_starts?: number[]; subpath_open?: boolean[]; fill_color?: string | null; stroke_color?: string | null; stroke_weight?: number | null; item_transform?: [number, number, number, number, number, number] | null } | { kind: "cloneTranslate"; self_id: string; source: NodeId; dx: number; dy: number; destination_spread_id?: string | null };
28
+
29
+ /**
30
+ * Editor-ops — wire mirror of `paged_parse::GradientFeatherParams`.
31
+ * Whole-struct authoring (kind + axis + stop LIST change together;
32
+ * `Value` has no generic list form, so the drop-shadow per-field
33
+ * shape doesn\'t fit). The renderer already draws this effect; only
34
+ * authoring was missing. `stop_color` round-trips faithfully but the
35
+ * rasterizer currently consumes `alpha_pct` only.
36
+ */
37
+ export interface GradientFeatherSpec {
38
+ /**
39
+ * `\"Linear\"` or `\"Radial\"`.
40
+ */
41
+ gradientType?: string | null;
42
+ startPoint?: [number, number] | null;
43
+ endPoint?: [number, number] | null;
44
+ angleDeg?: number | null;
45
+ stops?: GradientFeatherStopSpec[];
46
+ }
47
+
48
+ /**
49
+ * Editor-ops — wire mirror of `paged_parse::GradientFeatherStop`
50
+ * (the AST type predates `PartialEq`/`Tsify`; the mirror keeps the
51
+ * op wire-shaped, the `PathAnchorSpec` precedent).
52
+ */
53
+ export interface GradientFeatherStopSpec {
54
+ stopColor?: string | null;
55
+ locationPct: number;
56
+ alphaPct: number;
57
+ midpointPct?: number;
58
+ }
59
+
60
+ /**
61
+ * Hint to downstream caches about what the apply touched. Lists
62
+ * instead of a single enum so a Batch aggregates by union without
63
+ * losing per-node detail. Consumers (renderer, glyph cache, layout
64
+ * cache) decide which lists to honour. Stays advisory — nothing in
65
+ * `paged-mutate` invalidates anything itself.
66
+ */
67
+ export interface InvalidationHint {
68
+ frameGeometry: NodeId[];
69
+ frameStyle: NodeId[];
70
+ textReflow: NodeId[];
71
+ /**
72
+ * Set when the tree shape changed (any Insert/Remove/Move).
73
+ */
74
+ structural: boolean;
75
+ }
76
+
77
+ /**
78
+ * One stop of a gradient on the wire. Mirrors `GradientStopRef`.
79
+ */
80
+ export interface GradientStopSpec {
81
+ /**
82
+ * `Color/<id>` reference for this stop.
83
+ */
84
+ stopColor: string;
85
+ /**
86
+ * 0..=100 position along the ramp.
87
+ */
88
+ locationPct: number;
89
+ /**
90
+ * 0..=100 midpoint to the next stop; `None` ⇒ linear (50).
91
+ */
92
+ midpointPct?: number | null;
93
+ }
94
+
95
+ /**
96
+ * Phase H — address of one Bezier handle inside a `Polygon`\'s
97
+ * `PathPointArray`. `index` is the flat anchor index across all
98
+ * subpaths (compound polygons concatenate subpaths into one
99
+ * `anchors` Vec; `subpath_starts` marks each contour\'s first
100
+ * index).
101
+ */
102
+ export interface PathPointAddress {
103
+ index: number;
104
+ role: PathPointRole;
105
+ }
106
+
107
+ /**
108
+ * Phase H — which corner of a `PathAnchor` the path-point edit
109
+ * targets: the anchor itself or one of its two Bezier handles.
110
+ */
111
+ export type PathPointRole = "anchor" | "left" | "right";
112
+
113
+ /**
114
+ * Result of a successful `apply`. Holds the original op, the
115
+ * pre-computed inverse op (ready to push onto an undo stack), and
116
+ * the invalidation hint.
117
+ */
118
+ export interface AppliedOperation {
119
+ op: Operation;
120
+ inverse: Operation;
121
+ invalidation: InvalidationHint;
122
+ }
123
+
124
+ /**
125
+ * SDK Phase 5 (v1 sweep) — wire enum for Pathfinder ops. Mirrors
126
+ * `pathfinder::PathfinderKind` (the internal enum used by the
127
+ * flo_curves layer) — kept separate so the apply layer doesn\'t
128
+ * leak `flo_curves` types onto the wire.
129
+ */
130
+ export type PathfinderKind = "union" | "intersect" | "subtract" | "exclude";
131
+
132
+ /**
133
+ * Stable identifier for a scene-graph node. The string payload is the
134
+ * IDML `Self` attribute (e.g. `\"TextFrame/u14\"`) — stable for the
135
+ * lifetime of the document. Operations reference nodes by ID, never
136
+ * by path or index, so an Op generated on one client applies
137
+ * meaningfully on another even after the tree has shuffled.
138
+ *
139
+ * Variants today cover the page-item kinds the inspector mutates plus
140
+ * the structural containers an `InsertNode`/`MoveNode` Op can target
141
+ * as a parent.
142
+ */
143
+ export type NodeId = { kind: "TextFrame"; id: string } | { kind: "Rectangle"; id: string } | { kind: "Oval"; id: string } | { kind: "Polygon"; id: string } | { kind: "GraphicLine"; id: string } | { kind: "Group"; id: string } | { kind: "Spread"; id: string } | { kind: "Page"; id: string } | { kind: "Layer"; id: string } | { kind: "StoryRange"; id: { story_id: string; start: number; end: number } } | { kind: "Table"; id: { story_id: string; table_id: string } } | { kind: "TableCell"; id: { story_id: string; table_id: string; row: number; col: number } };
144
+
145
+ /**
146
+ * Stable page identity, independent of position in the page vector.
147
+ *
148
+ * Derived from the IDML `<Page Self=\"...\">` attribute where present;
149
+ * synthesised as `\"page-<spread_idx>-<local_idx>\"` when missing
150
+ * (older / synthetic fixtures without `Self`). The canvas keys
151
+ * display-list caches and LOD tiles by `PageId`, so the value must
152
+ * stay stable across re-layouts — only document-structural edits
153
+ * (insert/delete page) should ever change the set of `PageId`s.
154
+ */
155
+ export type PageId = string;
156
+
157
+ /**
158
+ * The canonical mutation primitive. A closed set, extended only with
159
+ * deliberation. Collection mutations (swatches, styles) operate on the
160
+ * document\'s `BTreeMap` palettes/stylesheets rather than the scene
161
+ * tree, so they\'re top-level variants rather than `InsertNode`.
162
+ */
163
+ export type Operation = { kind: "SetProperty"; node: NodeId; path: PropertyPath; value: Value } | { kind: "InsertNode"; parent: NodeId; position: number; node: NodeSpec; z_slot?: number | null } | { kind: "RemoveNode"; node: NodeId } | { kind: "MoveNode"; node: NodeId; new_parent: NodeId; position: number } | { kind: "Batch"; ops: Operation[] } | { kind: "InsertPage"; after_page_id?: string | null; master_id?: string | null; spread_self_id?: string | null; page_self_id?: string | null; restore_spread_json?: string | null } | { kind: "RemovePage"; page_id: string } | { kind: "MoveLayer"; layer_id: string; new_index: number } | { kind: "InsertLayer"; position: number; name: string; self_id?: string | null } | { kind: "RemoveLayer"; layer_id: string } | { kind: "CreateSwatch"; spec: SwatchSpec } | { kind: "EditSwatch"; swatch_id: string; spec: SwatchSpec } | { kind: "DeleteSwatch"; swatch_id: string } | { kind: "CreateParagraphStyle"; self_id?: string | null; name?: string | null; based_on?: string | null; restore_json?: string | null } | { kind: "RenameParagraphStyle"; style_id: string; name: string } | { kind: "DeleteParagraphStyle"; style_id: string } | { kind: "CreateCharacterStyle"; self_id?: string | null; name?: string | null; based_on?: string | null; restore_json?: string | null } | { kind: "RenameCharacterStyle"; style_id: string; name: string } | { kind: "DeleteCharacterStyle"; style_id: string } | { kind: "CreateObjectStyle"; self_id?: string | null; name?: string | null; based_on?: string | null; restore_json?: string | null } | { kind: "RenameObjectStyle"; style_id: string; name: string } | { kind: "DeleteObjectStyle"; style_id: string } | { kind: "CreateCellStyle"; self_id?: string | null; name?: string | null; based_on?: string | null; restore_json?: string | null } | { kind: "RenameCellStyle"; style_id: string; name: string } | { kind: "DeleteCellStyle"; style_id: string } | { kind: "CreateTableStyle"; self_id?: string | null; name?: string | null; based_on?: string | null; restore_json?: string | null } | { kind: "RenameTableStyle"; style_id: string; name: string } | { kind: "DeleteTableStyle"; style_id: string } | { kind: "CreateGroup"; spec: GroupSpec } | { kind: "DissolveGroup"; group_id: string; restore_slots?: number[] | null } | { kind: "CreateGradient"; spec: GradientSpec } | { kind: "EditGradient"; gradient_id: string; spec: GradientSpec } | { kind: "DeleteGradient"; gradient_id: string } | { kind: "CreateColorGroup"; spec: ColorGroupSpec } | { kind: "EditColorGroup"; group_id: string; spec: ColorGroupSpec } | { kind: "DeleteColorGroup"; group_id: string } | { kind: "SetStyleProperty"; collection: StyleCollection; style_id: string; path: PropertyPath; value: Value } | { kind: "PathfinderBoolean"; kept: NodeId; others: NodeId[]; opKind: PathfinderKind } | { kind: "LinkFrames"; from: string; to: string } | { kind: "UnlinkFrames"; frame: string; prev_next?: string | null } | { kind: "ApplyStyle"; story_id: string; start: number; end: number; style: string; scope: StyleScope } | { kind: "InsertField"; story_id: string; offset: number; field: FieldKind } | { kind: "DeleteField"; story_id: string; offset: number; field: FieldKind } | { kind: "InsertGuide"; spread_id: string; orientation: GuideOrientationSpec; position: number; page_index?: number; guide_id?: string | null } | { kind: "MoveGuide"; guide_id: string; position: number } | { kind: "DeleteGuide"; guide_id: string } | { kind: "SetConditionVisible"; condition: string; visible: boolean } | { kind: "ActivateConditionSet"; set: string } | { kind: "RestoreConditionVisibility"; states: [string, boolean][] } | { kind: "ApplyMasterToPage"; page: string; master?: string | null } | { kind: "DuplicatePage"; page: string; clone_spread_json?: string | null } | { kind: "InsertSection"; at_page: string; prefix?: string | null; numbering_style?: string | null; start_at?: number | null; self_id?: string | null } | { kind: "EditSection"; section_id: string; prefix?: string | null | null; numbering_style?: string | null; start_at?: number | null | null } | { kind: "DeleteSection"; section_id: string } | { kind: "SetRowHeight"; story_id: string; table_id: string; row: number; height?: number | null } | { kind: "SetColumnWidth"; story_id: string; table_id: string; col: number; width?: number | null } | { kind: "InsertTableRow"; story_id: string; table_id: string; at: number; restore?: TableLineRestoreJson | null } | { kind: "DeleteTableRow"; story_id: string; table_id: string; at: number } | { kind: "InsertTableColumn"; story_id: string; table_id: string; at: number; restore?: TableLineRestoreJson | null } | { kind: "DeleteTableColumn"; story_id: string; table_id: string; at: number };
164
+
165
+ /**
166
+ * Track J — wire-shape mirror of `paged_parse::PathAnchor`. The
167
+ * parse-side type doesn\'t carry `Deserialize`/`PartialEq`/`Tsify`,
168
+ * and the mutate API needs all three so this Op crosses the wasm
169
+ * boundary. The field shapes match exactly: `anchor` is the
170
+ * on-curve point, `left` / `right` are the incoming / outgoing
171
+ * Bezier handles, all in the page item\'s inner coordinate system.
172
+ */
173
+ export interface PathAnchorSpec {
174
+ anchor: [number, number];
175
+ left: [number, number];
176
+ right: [number, number];
177
+ }
178
+
179
+ /**
180
+ * Typed payload for a `SetProperty` Op. Each variant carries a value
181
+ * of a specific kind; the apply layer\'s `TypeMismatch` error fires if
182
+ * the variant doesn\'t match what the path expects.
183
+ */
184
+ export type Value = { type: "bounds"; value: [number, number, number, number] } | { type: "colorRef"; value: string | null } | { type: "length"; value: number | null } | { type: "transform"; value: [number, number, number, number, number, number] | null } | { type: "pathPoint"; value: { address: PathPointAddress; position: [number, number] } } | { type: "pathPointInsert"; value: { index: number; anchor: PathAnchorSpec; prevSubpathStarts?: number[] | null } } | { type: "pathPointRemove"; value: { index: number; prevSubpathStarts?: number[] | null } } | { type: "pathPointCurveType"; value: { index: number; smooth: boolean; prev?: PathAnchorSpec | null } } | { type: "pluginMetadata"; value: { key: string; value: string | null; prev?: string | null | null } } | { type: "bool"; value: boolean } | { type: "text"; value: string } | { type: "framePath"; value: { anchors: PathAnchorSpec[]; subpathStarts: number[] } } | { type: "pathOpenAt"; value: { index: number; prevAnchors?: PathAnchorSpec[] | null; prevSubpathStarts?: number[] | null; prevSubpathOpen?: boolean[] | null } } | { type: "outlineStroke"; value: { width: number; cap: string; join: string; miterLimit: number; prevAnchors?: PathAnchorSpec[] | null; prevSubpathStarts?: number[] | null; prevSubpathOpen?: boolean[] | null } } | { type: "offsetPath"; value: { delta: number; join: string; miterLimit: number; prevAnchors?: PathAnchorSpec[] | null; prevSubpathStarts?: number[] | null; prevSubpathOpen?: boolean[] | null } } | { type: "simplifyPath"; value: { tolerance: number; prevAnchors?: PathAnchorSpec[] | null; prevSubpathStarts?: number[] | null; prevSubpathOpen?: boolean[] | null } } | { type: "gradientFeather"; value: GradientFeatherSpec | null } | { type: "paragraphRule"; value: ParagraphRuleSpec | null } | { type: "tabStops"; value: TabStopSpec[] };
185
+
186
+ /**
187
+ * Typed property path for `SetProperty` Ops. A closed enum (rather
188
+ * than free-form `Vec<String>`) preserves Rust\'s exhaustiveness
189
+ * guarantee inside `apply`/`invert`, and the `serde` rename lets the
190
+ * wire format read like the dotted path the briefing illustrates
191
+ * (`\"fill.color\"`) — so JS callers don\'t need to learn the Rust
192
+ * enum shape.
193
+ */
194
+ export type PropertyPath = "frameBounds" | "frameFillColor" | "frameStrokeColor" | "frameStrokeWeight" | "frameOpacity" | "frameTransform" | "imageContentTransform" | "framePathPoint" | "pathPointInsert" | "pathPointRemove" | "pathPointCurveType" | "layerVisible" | "layerLocked" | "layerPrintable" | "layerName" | "characterFontSize" | "characterLeading" | "characterTracking" | "characterFillColor" | "paragraphSpaceBefore" | "paragraphSpaceAfter" | "paragraphFirstLineIndent" | "appliedParagraphStyle" | "appliedCharacterStyle" | "appliedObjectStyle" | "appliedCellStyle" | "appliedTableStyle" | "framePath" | "frameNonprinting" | "frameFillTint" | "frameGradientFillAngle" | "frameGradientFillLength" | "frameGradientStrokeAngle" | "frameGradientStrokeLength" | "pathOpenAt" | "outlineStroke" | "offsetPath" | "simplifyPath" | "frameGradientFeather" | "pageBounds" | "frameDropShadowMode" | "frameDropShadowXOffset" | "frameDropShadowYOffset" | "frameDropShadowSize" | "frameDropShadowOpacity" | "frameDropShadowColor" | "frameDropShadow" | "frameFittingCrops" | "frameFittingType" | "frameTextWrapMode" | "frameTextWrapOffsets" | "paragraphJustification" | "frameStrokeEndCap" | "frameInsetSpacing" | "appliedConditions" | "characterFontFamily" | "characterFontStyle" | "characterKerningMethod" | "characterCase" | "characterPosition" | "characterLanguage" | "characterBaselineShift" | "characterHorizontalScale" | "characterVerticalScale" | "characterSkew" | "characterUnderline" | "characterStrikethru" | "characterLigatures" | "characterOtfFeatures" | "paragraphLeftIndent" | "paragraphRightIndent" | "paragraphDropCapCharacters" | "paragraphDropCapLines" | "paragraphHyphenation" | "paragraphKeepLinesTogether" | "paragraphKeepWithNext" | "paragraphRuleAbove" | "paragraphRuleBelow" | "paragraphTabStops" | "paragraphListType" | "paragraphBulletCharacter" | "paragraphNumberingFormat" | "textFrameColumnCount" | "textFrameColumnGutter" | "textFrameColumnBalance" | "textFrameVerticalJustification" | "textFrameAutoSizing" | "textFrameFirstBaseline" | "textWrapInvert" | "frameFittingReferencePoint" | "frameAutoFit" | "frameStrokeType" | "frameStrokeJoin" | "frameStrokeMiterLimit" | "frameStrokeAlignment" | "frameStrokeGapColor" | "frameStrokeGapTint" | "frameCornerOptionTopLeft" | "frameCornerOptionTopRight" | "frameCornerOptionBottomLeft" | "frameCornerOptionBottomRight" | "frameCornerRadiusTopLeft" | "frameCornerRadiusTopRight" | "frameCornerRadiusBottomLeft" | "frameCornerRadiusBottomRight" | "frameRotationAngle" | "frameScaleX" | "frameScaleY" | "frameFlipH" | "frameFlipV" | "frameOverprintFill" | "frameOverprintStroke" | "frameInnerShadowEnabled" | "frameInnerShadowBlendMode" | "frameInnerShadowColor" | "frameInnerShadowOpacity" | "frameInnerShadowAngle" | "frameInnerShadowDistance" | "frameInnerShadowSize" | "frameInnerShadowChoke" | "frameInnerShadowNoise" | "frameOuterGlowEnabled" | "frameOuterGlowBlendMode" | "frameOuterGlowColor" | "frameOuterGlowOpacity" | "frameOuterGlowSpread" | "frameOuterGlowSize" | "frameOuterGlowNoise" | "frameInnerGlowEnabled" | "frameInnerGlowBlendMode" | "frameInnerGlowColor" | "frameInnerGlowOpacity" | "frameInnerGlowChoke" | "frameInnerGlowSize" | "frameInnerGlowSource" | "frameInnerGlowNoise" | "frameBevelEnabled" | "frameBevelStyle" | "frameBevelTechnique" | "frameBevelDepth" | "frameBevelDirection" | "frameBevelSize" | "frameBevelSoften" | "frameBevelAngle" | "frameBevelAltitude" | "frameBevelHighlightColor" | "frameBevelShadowColor" | "frameBevelHighlightOpacity" | "frameBevelShadowOpacity" | "frameSatinEnabled" | "frameSatinBlendMode" | "frameSatinColor" | "frameSatinOpacity" | "frameSatinAngle" | "frameSatinDistance" | "frameSatinSize" | "frameSatinInvert" | "frameFeatherEnabled" | "frameFeatherWidth" | "frameFeatherCornerType" | "frameFeatherNoise" | "frameFeatherChoke" | "frameDirectionalFeatherEnabled" | "frameDirectionalFeatherLeftWidth" | "frameDirectionalFeatherRightWidth" | "frameDirectionalFeatherTopWidth" | "frameDirectionalFeatherBottomWidth" | "frameDirectionalFeatherAngle" | "frameDirectionalFeatherNoise" | "frameDirectionalFeatherChoke" | "frameBlendMode" | "nextTextFrame" | "previousTextFrame" | "cellFillColor" | "cellFillTint" | "cellInsetTop" | "cellInsetLeft" | "cellInsetBottom" | "cellInsetRight" | "cellVerticalJustification" | "tableRowCount" | "tableColumnCount" | "pluginMetadata";
195
+
196
+ /**
197
+ * W0.2 — wire mirror of `paged_parse::TabStop`. The `ParagraphTabStops`
198
+ * path replaces the paragraph\'s whole `<TabList>` in one op; `Value`
199
+ * has no per-element list-edit form, so the UI sends the full new
200
+ * stop list (the gradient-feather stop-list precedent).
201
+ */
202
+ export interface TabStopSpec {
203
+ position: number;
204
+ alignment?: string | null;
205
+ alignmentCharacter?: string | null;
206
+ leader?: string | null;
207
+ }
208
+
209
+ /**
210
+ * W0.2 — wire mirror of `paged_parse::styles::ParagraphRule` (the
211
+ * AST type predates `Tsify`; the mirror keeps the op wire-shaped,
212
+ * the `GradientFeatherSpec` precedent). Carries every field the
213
+ * parser models so the whole-struct `ParagraphRuleAbove` /
214
+ * `ParagraphRuleBelow` paths round-trip a paragraph\'s rule verbatim.
215
+ */
216
+ export interface ParagraphRuleSpec {
217
+ on?: boolean | null;
218
+ color?: string | null;
219
+ tint?: number | null;
220
+ weight?: number | null;
221
+ offset?: number | null;
222
+ leftIndent?: number | null;
223
+ rightIndent?: number | null;
224
+ width?: string | null;
225
+ }
226
+
227
+ /**
228
+ * W0.5 — character- vs paragraph-level style application for
229
+ * [`Operation::ApplyStyle`].
230
+ */
231
+ export type StyleScope = "paragraph" | "character";
232
+
233
+ /**
234
+ * W0.5 — the kind of field marker inserted by
235
+ * [`Operation::InsertField`]. Extensible; v1 implements `PageNumber`
236
+ * (the IDML auto current-page-number marker, U+E018).
237
+ */
238
+ export type FieldKind = "pageNumber" | "nextPageNumber";
239
+
240
+ /**
241
+ * W0.5 — wire mirror of `paged_parse::GuideOrientation`
242
+ * (which is `Deserialize` but lives in the parse crate; kept here so
243
+ * the operation wire type doesn\'t depend on the parser\'s
244
+ * serialization shape).
245
+ */
246
+ export type GuideOrientationSpec = "vertical" | "horizontal";
247
+
248
+ /**
249
+ * Which style collection a `SetStyleProperty` targets.
250
+ */
251
+ export type StyleCollection = "paragraph" | "character" | "object" | "cell" | "table";
252
+
253
+ /**
254
+ * Wire description of a colour group, mirroring `ColorGroupEntry`.
255
+ */
256
+ export interface ColorGroupSpec {
257
+ selfId?: string | null;
258
+ name?: string | null;
259
+ /**
260
+ * `Color/<id>` (or `Swatch/<id>`) member refs, in order.
261
+ */
262
+ members?: string[];
263
+ }
264
+
265
+ /**
266
+ * Wire description of a gradient swatch, mirroring `GradientEntry`.
267
+ */
268
+ export interface GradientSpec {
269
+ selfId?: string | null;
270
+ name?: string | null;
271
+ /**
272
+ * `Type`: `\"Linear\"` | `\"Radial\"`.
273
+ */
274
+ kind: string;
275
+ stops: GradientStopSpec[];
276
+ }
277
+
278
+ /**
279
+ * Wire-format description of a colour swatch (`<Color>`), mirroring
280
+ * the editable fields of `paged_parse::ColorEntry` with primitive,
281
+ * `Deserialize`-able types (the AST `ColorEntry` is `Serialize`-only).
282
+ * Carried by the swatch-collection mutations so create / edit /
283
+ * delete-undo are lossless. `space` / `model` / `alternate_space` are
284
+ * the IDML attribute strings (`ColorSpace::as_attr` etc.).
285
+ */
286
+ export interface SwatchSpec {
287
+ /**
288
+ * IDML `Self` id. `None` on create ⇒ the apply layer assigns a
289
+ * deterministic non-colliding `Color/u<n>`.
290
+ */
291
+ selfId?: string | null;
292
+ name?: string | null;
293
+ /**
294
+ * `Space` attribute: `\"CMYK\"` | `\"RGB\"` | `\"LAB\"` | `\"Gray\"`.
295
+ */
296
+ space: string;
297
+ /**
298
+ * Channel values in `space` (4 for CMYK, 3 for RGB/Lab, 1 for Gray).
299
+ */
300
+ value: number[];
301
+ /**
302
+ * `Model`: `\"Process\"` (default) | `\"Spot\"`.
303
+ */
304
+ model?: string | null;
305
+ alternateSpace?: string | null;
306
+ alternateValue?: number[];
307
+ tint?: number | null;
308
+ alpha?: number | null;
309
+ }
310
+
311
+
312
+ export class Inspector {
313
+ free(): void;
314
+ [Symbol.dispose](): void;
315
+ /**
316
+ * Apply an Operation. `op_json` is the wire form of
317
+ * `paged_mutate::Operation`. Returns the wire form of
318
+ * `AppliedOperation` on success.
319
+ */
320
+ apply(op_json: string): string;
321
+ /**
322
+ * Open an IDML by bytes.
323
+ */
324
+ constructor(idml: Uint8Array);
325
+ /**
326
+ * Return property descriptors for a node. `node_json` matches
327
+ * `NodeIdJson` (e.g. `{"kind":"TextFrame","id":"TextFrame/u1"}`).
328
+ */
329
+ properties(node_json: string): string;
330
+ /**
331
+ * Redo the most recently undone op. Symmetric to `undo`.
332
+ */
333
+ redo(): string;
334
+ /**
335
+ * Render a page as PNG bytes. Requires the `render` feature.
336
+ */
337
+ renderPage(page_index: number, dpi: number): Uint8Array;
338
+ /**
339
+ * Return the inspector tree as a JSON string.
340
+ */
341
+ tree(): string;
342
+ /**
343
+ * Undo the most recent op. Returns the resulting
344
+ * `AppliedOperation` (whose `op` is the inverse that just
345
+ * ran) as JSON, or the literal `"null"` when the undo stack
346
+ * is empty.
347
+ */
348
+ undo(): string;
349
+ }
350
+
351
+ export function on_start(): void;
352
+
353
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
354
+
355
+ export interface InitOutput {
356
+ readonly memory: WebAssembly.Memory;
357
+ readonly __wbg_inspector_free: (a: number, b: number) => void;
358
+ readonly inspector_apply: (a: number, b: number, c: number) => [number, number, number, number];
359
+ readonly inspector_new: (a: number, b: number) => [number, number, number];
360
+ readonly inspector_properties: (a: number, b: number, c: number) => [number, number, number, number];
361
+ readonly inspector_redo: (a: number) => [number, number, number, number];
362
+ readonly inspector_renderPage: (a: number, b: number, c: number) => [number, number, number, number];
363
+ readonly inspector_tree: (a: number) => [number, number, number, number];
364
+ readonly inspector_undo: (a: number) => [number, number, number, number];
365
+ readonly on_start: () => void;
366
+ readonly qcms_enable_iccv4: () => void;
367
+ readonly qcms_profile_precache_output_transform: (a: number) => void;
368
+ readonly qcms_transform_data_bgra_out_lut: (a: number, b: number, c: number, d: number) => void;
369
+ readonly qcms_transform_data_bgra_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
370
+ readonly qcms_transform_data_rgb_out_lut: (a: number, b: number, c: number, d: number) => void;
371
+ readonly qcms_transform_data_rgb_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
372
+ readonly qcms_transform_data_rgba_out_lut: (a: number, b: number, c: number, d: number) => void;
373
+ readonly qcms_transform_data_rgba_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
374
+ readonly qcms_transform_release: (a: number) => void;
375
+ readonly qcms_profile_is_bogus: (a: number) => number;
376
+ readonly qcms_white_point_sRGB: (a: number) => void;
377
+ readonly lut_inverse_interp16: (a: number, b: number, c: number) => number;
378
+ readonly lut_interp_linear16: (a: number, b: number, c: number) => number;
379
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
380
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
381
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
382
+ readonly __wbindgen_externrefs: WebAssembly.Table;
383
+ readonly __externref_table_dealloc: (a: number) => void;
384
+ readonly __wbindgen_start: () => void;
385
+ }
386
+
387
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
388
+
389
+ /**
390
+ * Instantiates the given `module`, which can either be bytes or
391
+ * a precompiled `WebAssembly.Module`.
392
+ *
393
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
394
+ *
395
+ * @returns {InitOutput}
396
+ */
397
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
398
+
399
+ /**
400
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
401
+ * for everything else, calls `WebAssembly.instantiate` directly.
402
+ *
403
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
404
+ *
405
+ * @returns {Promise<InitOutput>}
406
+ */
407
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
@@ -0,0 +1,428 @@
1
+ /* @ts-self-types="./paged_introspect_wasm.d.ts" */
2
+
3
+ export class Inspector {
4
+ __destroy_into_raw() {
5
+ const ptr = this.__wbg_ptr;
6
+ this.__wbg_ptr = 0;
7
+ InspectorFinalization.unregister(this);
8
+ return ptr;
9
+ }
10
+ free() {
11
+ const ptr = this.__destroy_into_raw();
12
+ wasm.__wbg_inspector_free(ptr, 0);
13
+ }
14
+ /**
15
+ * Apply an Operation. `op_json` is the wire form of
16
+ * `paged_mutate::Operation`. Returns the wire form of
17
+ * `AppliedOperation` on success.
18
+ * @param {string} op_json
19
+ * @returns {string}
20
+ */
21
+ apply(op_json) {
22
+ let deferred3_0;
23
+ let deferred3_1;
24
+ try {
25
+ const ptr0 = passStringToWasm0(op_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
26
+ const len0 = WASM_VECTOR_LEN;
27
+ const ret = wasm.inspector_apply(this.__wbg_ptr, ptr0, len0);
28
+ var ptr2 = ret[0];
29
+ var len2 = ret[1];
30
+ if (ret[3]) {
31
+ ptr2 = 0; len2 = 0;
32
+ throw takeFromExternrefTable0(ret[2]);
33
+ }
34
+ deferred3_0 = ptr2;
35
+ deferred3_1 = len2;
36
+ return getStringFromWasm0(ptr2, len2);
37
+ } finally {
38
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
39
+ }
40
+ }
41
+ /**
42
+ * Open an IDML by bytes.
43
+ * @param {Uint8Array} idml
44
+ */
45
+ constructor(idml) {
46
+ const ptr0 = passArray8ToWasm0(idml, wasm.__wbindgen_malloc);
47
+ const len0 = WASM_VECTOR_LEN;
48
+ const ret = wasm.inspector_new(ptr0, len0);
49
+ if (ret[2]) {
50
+ throw takeFromExternrefTable0(ret[1]);
51
+ }
52
+ this.__wbg_ptr = ret[0];
53
+ InspectorFinalization.register(this, this.__wbg_ptr, this);
54
+ return this;
55
+ }
56
+ /**
57
+ * Return property descriptors for a node. `node_json` matches
58
+ * `NodeIdJson` (e.g. `{"kind":"TextFrame","id":"TextFrame/u1"}`).
59
+ * @param {string} node_json
60
+ * @returns {string}
61
+ */
62
+ properties(node_json) {
63
+ let deferred3_0;
64
+ let deferred3_1;
65
+ try {
66
+ const ptr0 = passStringToWasm0(node_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
67
+ const len0 = WASM_VECTOR_LEN;
68
+ const ret = wasm.inspector_properties(this.__wbg_ptr, ptr0, len0);
69
+ var ptr2 = ret[0];
70
+ var len2 = ret[1];
71
+ if (ret[3]) {
72
+ ptr2 = 0; len2 = 0;
73
+ throw takeFromExternrefTable0(ret[2]);
74
+ }
75
+ deferred3_0 = ptr2;
76
+ deferred3_1 = len2;
77
+ return getStringFromWasm0(ptr2, len2);
78
+ } finally {
79
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
80
+ }
81
+ }
82
+ /**
83
+ * Redo the most recently undone op. Symmetric to `undo`.
84
+ * @returns {string}
85
+ */
86
+ redo() {
87
+ let deferred2_0;
88
+ let deferred2_1;
89
+ try {
90
+ const ret = wasm.inspector_redo(this.__wbg_ptr);
91
+ var ptr1 = ret[0];
92
+ var len1 = ret[1];
93
+ if (ret[3]) {
94
+ ptr1 = 0; len1 = 0;
95
+ throw takeFromExternrefTable0(ret[2]);
96
+ }
97
+ deferred2_0 = ptr1;
98
+ deferred2_1 = len1;
99
+ return getStringFromWasm0(ptr1, len1);
100
+ } finally {
101
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
102
+ }
103
+ }
104
+ /**
105
+ * Render a page as PNG bytes. Requires the `render` feature.
106
+ * @param {number} page_index
107
+ * @param {number} dpi
108
+ * @returns {Uint8Array}
109
+ */
110
+ renderPage(page_index, dpi) {
111
+ const ret = wasm.inspector_renderPage(this.__wbg_ptr, page_index, dpi);
112
+ if (ret[3]) {
113
+ throw takeFromExternrefTable0(ret[2]);
114
+ }
115
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
116
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
117
+ return v1;
118
+ }
119
+ /**
120
+ * Return the inspector tree as a JSON string.
121
+ * @returns {string}
122
+ */
123
+ tree() {
124
+ let deferred2_0;
125
+ let deferred2_1;
126
+ try {
127
+ const ret = wasm.inspector_tree(this.__wbg_ptr);
128
+ var ptr1 = ret[0];
129
+ var len1 = ret[1];
130
+ if (ret[3]) {
131
+ ptr1 = 0; len1 = 0;
132
+ throw takeFromExternrefTable0(ret[2]);
133
+ }
134
+ deferred2_0 = ptr1;
135
+ deferred2_1 = len1;
136
+ return getStringFromWasm0(ptr1, len1);
137
+ } finally {
138
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
139
+ }
140
+ }
141
+ /**
142
+ * Undo the most recent op. Returns the resulting
143
+ * `AppliedOperation` (whose `op` is the inverse that just
144
+ * ran) as JSON, or the literal `"null"` when the undo stack
145
+ * is empty.
146
+ * @returns {string}
147
+ */
148
+ undo() {
149
+ let deferred2_0;
150
+ let deferred2_1;
151
+ try {
152
+ const ret = wasm.inspector_undo(this.__wbg_ptr);
153
+ var ptr1 = ret[0];
154
+ var len1 = ret[1];
155
+ if (ret[3]) {
156
+ ptr1 = 0; len1 = 0;
157
+ throw takeFromExternrefTable0(ret[2]);
158
+ }
159
+ deferred2_0 = ptr1;
160
+ deferred2_1 = len1;
161
+ return getStringFromWasm0(ptr1, len1);
162
+ } finally {
163
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
164
+ }
165
+ }
166
+ }
167
+ if (Symbol.dispose) Inspector.prototype[Symbol.dispose] = Inspector.prototype.free;
168
+
169
+ export function on_start() {
170
+ wasm.on_start();
171
+ }
172
+ function __wbg_get_imports() {
173
+ const import0 = {
174
+ __proto__: null,
175
+ __wbg_Error_ef53bc310eb298a0: function(arg0, arg1) {
176
+ const ret = Error(getStringFromWasm0(arg0, arg1));
177
+ return ret;
178
+ },
179
+ __wbg___wbindgen_throw_1506f2235d1bdba0: function(arg0, arg1) {
180
+ throw new Error(getStringFromWasm0(arg0, arg1));
181
+ },
182
+ __wbg_error_a6fa202b58aa1cd3: function(arg0, arg1) {
183
+ let deferred0_0;
184
+ let deferred0_1;
185
+ try {
186
+ deferred0_0 = arg0;
187
+ deferred0_1 = arg1;
188
+ console.error(getStringFromWasm0(arg0, arg1));
189
+ } finally {
190
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
191
+ }
192
+ },
193
+ __wbg_log_cf2e968649f3384e: function(arg0) {
194
+ console.log(arg0);
195
+ },
196
+ __wbg_new_227d7c05414eb861: function() {
197
+ const ret = new Error();
198
+ return ret;
199
+ },
200
+ __wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
201
+ const ret = arg1.stack;
202
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
203
+ const len1 = WASM_VECTOR_LEN;
204
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
205
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
206
+ },
207
+ __wbindgen_cast_0000000000000001: function(arg0, arg1) {
208
+ // Cast intrinsic for `Ref(String) -> Externref`.
209
+ const ret = getStringFromWasm0(arg0, arg1);
210
+ return ret;
211
+ },
212
+ __wbindgen_init_externref_table: function() {
213
+ const table = wasm.__wbindgen_externrefs;
214
+ const offset = table.grow(4);
215
+ table.set(0, undefined);
216
+ table.set(offset + 0, undefined);
217
+ table.set(offset + 1, null);
218
+ table.set(offset + 2, true);
219
+ table.set(offset + 3, false);
220
+ },
221
+ };
222
+ return {
223
+ __proto__: null,
224
+ "./paged_introspect_wasm_bg.js": import0,
225
+ };
226
+ }
227
+
228
+ const InspectorFinalization = (typeof FinalizationRegistry === 'undefined')
229
+ ? { register: () => {}, unregister: () => {} }
230
+ : new FinalizationRegistry(ptr => wasm.__wbg_inspector_free(ptr, 1));
231
+
232
+ function getArrayU8FromWasm0(ptr, len) {
233
+ ptr = ptr >>> 0;
234
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
235
+ }
236
+
237
+ let cachedDataViewMemory0 = null;
238
+ function getDataViewMemory0() {
239
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
240
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
241
+ }
242
+ return cachedDataViewMemory0;
243
+ }
244
+
245
+ function getStringFromWasm0(ptr, len) {
246
+ return decodeText(ptr >>> 0, len);
247
+ }
248
+
249
+ let cachedUint8ArrayMemory0 = null;
250
+ function getUint8ArrayMemory0() {
251
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
252
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
253
+ }
254
+ return cachedUint8ArrayMemory0;
255
+ }
256
+
257
+ function passArray8ToWasm0(arg, malloc) {
258
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
259
+ getUint8ArrayMemory0().set(arg, ptr / 1);
260
+ WASM_VECTOR_LEN = arg.length;
261
+ return ptr;
262
+ }
263
+
264
+ function passStringToWasm0(arg, malloc, realloc) {
265
+ if (realloc === undefined) {
266
+ const buf = cachedTextEncoder.encode(arg);
267
+ const ptr = malloc(buf.length, 1) >>> 0;
268
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
269
+ WASM_VECTOR_LEN = buf.length;
270
+ return ptr;
271
+ }
272
+
273
+ let len = arg.length;
274
+ let ptr = malloc(len, 1) >>> 0;
275
+
276
+ const mem = getUint8ArrayMemory0();
277
+
278
+ let offset = 0;
279
+
280
+ for (; offset < len; offset++) {
281
+ const code = arg.charCodeAt(offset);
282
+ if (code > 0x7F) break;
283
+ mem[ptr + offset] = code;
284
+ }
285
+ if (offset !== len) {
286
+ if (offset !== 0) {
287
+ arg = arg.slice(offset);
288
+ }
289
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
290
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
291
+ const ret = cachedTextEncoder.encodeInto(arg, view);
292
+
293
+ offset += ret.written;
294
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
295
+ }
296
+
297
+ WASM_VECTOR_LEN = offset;
298
+ return ptr;
299
+ }
300
+
301
+ function takeFromExternrefTable0(idx) {
302
+ const value = wasm.__wbindgen_externrefs.get(idx);
303
+ wasm.__externref_table_dealloc(idx);
304
+ return value;
305
+ }
306
+
307
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
308
+ cachedTextDecoder.decode();
309
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
310
+ let numBytesDecoded = 0;
311
+ function decodeText(ptr, len) {
312
+ numBytesDecoded += len;
313
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
314
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
315
+ cachedTextDecoder.decode();
316
+ numBytesDecoded = len;
317
+ }
318
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
319
+ }
320
+
321
+ const cachedTextEncoder = new TextEncoder();
322
+
323
+ if (!('encodeInto' in cachedTextEncoder)) {
324
+ cachedTextEncoder.encodeInto = function (arg, view) {
325
+ const buf = cachedTextEncoder.encode(arg);
326
+ view.set(buf);
327
+ return {
328
+ read: arg.length,
329
+ written: buf.length
330
+ };
331
+ };
332
+ }
333
+
334
+ let WASM_VECTOR_LEN = 0;
335
+
336
+ let wasmModule, wasmInstance, wasm;
337
+ function __wbg_finalize_init(instance, module) {
338
+ wasmInstance = instance;
339
+ wasm = instance.exports;
340
+ wasmModule = module;
341
+ cachedDataViewMemory0 = null;
342
+ cachedUint8ArrayMemory0 = null;
343
+ wasm.__wbindgen_start();
344
+ return wasm;
345
+ }
346
+
347
+ async function __wbg_load(module, imports) {
348
+ if (typeof Response === 'function' && module instanceof Response) {
349
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
350
+ try {
351
+ return await WebAssembly.instantiateStreaming(module, imports);
352
+ } catch (e) {
353
+ const validResponse = module.ok && expectedResponseType(module.type);
354
+
355
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
356
+ console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
357
+
358
+ } else { throw e; }
359
+ }
360
+ }
361
+
362
+ const bytes = await module.arrayBuffer();
363
+ return await WebAssembly.instantiate(bytes, imports);
364
+ } else {
365
+ const instance = await WebAssembly.instantiate(module, imports);
366
+
367
+ if (instance instanceof WebAssembly.Instance) {
368
+ return { instance, module };
369
+ } else {
370
+ return instance;
371
+ }
372
+ }
373
+
374
+ function expectedResponseType(type) {
375
+ switch (type) {
376
+ case 'basic': case 'cors': case 'default': return true;
377
+ }
378
+ return false;
379
+ }
380
+ }
381
+
382
+ function initSync(module) {
383
+ if (wasm !== undefined) return wasm;
384
+
385
+
386
+ if (module !== undefined) {
387
+ if (Object.getPrototypeOf(module) === Object.prototype) {
388
+ ({module} = module)
389
+ } else {
390
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
391
+ }
392
+ }
393
+
394
+ const imports = __wbg_get_imports();
395
+ if (!(module instanceof WebAssembly.Module)) {
396
+ module = new WebAssembly.Module(module);
397
+ }
398
+ const instance = new WebAssembly.Instance(module, imports);
399
+ return __wbg_finalize_init(instance, module);
400
+ }
401
+
402
+ async function __wbg_init(module_or_path) {
403
+ if (wasm !== undefined) return wasm;
404
+
405
+
406
+ if (module_or_path !== undefined) {
407
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
408
+ ({module_or_path} = module_or_path)
409
+ } else {
410
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
411
+ }
412
+ }
413
+
414
+ if (module_or_path === undefined) {
415
+ module_or_path = new URL('paged_introspect_wasm_bg.wasm', import.meta.url);
416
+ }
417
+ const imports = __wbg_get_imports();
418
+
419
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
420
+ module_or_path = fetch(module_or_path);
421
+ }
422
+
423
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
424
+
425
+ return __wbg_finalize_init(instance, module);
426
+ }
427
+
428
+ export { initSync, __wbg_init as default };
Binary file