@betteroffice/pptx 0.2.0 → 0.5.1
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/README.md +112 -263
- package/dist/chunk-2CPM3HRW.js +1 -0
- package/dist/chunk-3TTZUGDD.js +1 -0
- package/dist/chunk-B6OFSXHM.js +1 -0
- package/dist/chunk-DDNX2Z7E.js +1 -0
- package/dist/chunk-JZOLK2OC.js +1 -0
- package/dist/chunk-NWXUJY6L.js +3 -0
- package/dist/chunk-O2XFH626.js +1 -0
- package/dist/chunk-YMIVEAXD.js +0 -0
- package/dist/collaboration.d.ts +11 -0
- package/dist/collaboration.js +1 -0
- package/dist/editorSession-Cl_EWgAi.d.ts +1751 -0
- package/dist/generated/pptx_wasm_bg.wasm +0 -0
- package/dist/index.d.ts +9 -1552
- package/dist/index.js +1 -1
- package/dist/main-C6-cc0fR.d.ts +146 -0
- package/dist/pptxSessionWorker.d.ts +2 -0
- package/dist/pptxSessionWorker.mjs +9 -0
- package/dist/presence-C1o8TDwu.d.ts +95 -0
- package/dist/types-ui_ARP0o.d.ts +93 -0
- package/dist/worker.d.ts +621 -0
- package/dist/worker.js +1 -0
- package/package.json +17 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,681 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
color?: string;
|
|
6
|
-
fontFamily?: string;
|
|
7
|
-
underline?: string;
|
|
8
|
-
spacingPt?: number;
|
|
9
|
-
baselinePct?: number;
|
|
10
|
-
}
|
|
11
|
-
type TextStylePatch = TextStyle;
|
|
12
|
-
interface TextStyleSnapshot {
|
|
13
|
-
bold: boolean | null;
|
|
14
|
-
italic: boolean | null;
|
|
15
|
-
fontSizePt: number | null;
|
|
16
|
-
color: string | null;
|
|
17
|
-
fontFamily: string | null;
|
|
18
|
-
underline: string | null;
|
|
19
|
-
spacingPt?: number | null;
|
|
20
|
-
baselinePct?: number | null;
|
|
21
|
-
/** `a:rPr@cap`: how the run is cased when drawn, never in the stored text. */
|
|
22
|
-
caps?: 'none' | 'small' | 'all' | null;
|
|
23
|
-
}
|
|
24
|
-
interface TextRunSnapshot {
|
|
25
|
-
text: string;
|
|
26
|
-
style: TextStyleSnapshot;
|
|
27
|
-
}
|
|
28
|
-
/** OOXML `a:pPr@algn` token. */
|
|
29
|
-
type ParagraphAlignment = 'l' | 'ctr' | 'r' | 'just';
|
|
30
|
-
interface ParagraphSnapshot {
|
|
31
|
-
id: string;
|
|
32
|
-
alignment: string | null;
|
|
33
|
-
level: number;
|
|
34
|
-
bulletJson: string | null;
|
|
35
|
-
runs: TextRunSnapshot[];
|
|
36
|
-
}
|
|
37
|
-
interface StorySnapshot {
|
|
38
|
-
id: string;
|
|
39
|
-
length: number;
|
|
40
|
-
paragraphs: ParagraphSnapshot[];
|
|
41
|
-
}
|
|
42
|
-
interface PptxTextSearchOptions {
|
|
43
|
-
/** Defaults to false. */
|
|
44
|
-
caseSensitive?: boolean;
|
|
45
|
-
/** Maximum matches; unlimited by default. */
|
|
46
|
-
limit?: number;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* A caret position in a story that later edits, undo, redo and remote updates
|
|
50
|
-
* move along with the text. Plain data; `position` is opaque.
|
|
51
|
-
*/
|
|
52
|
-
interface PptxCaretAnchor {
|
|
53
|
-
storyId: string;
|
|
54
|
-
position: string;
|
|
55
|
-
}
|
|
56
|
-
/** Zero-based slide index; story-local UTF-16 offsets. */
|
|
57
|
-
interface PptxTextMatch {
|
|
58
|
-
slideIndex: number;
|
|
59
|
-
slideId: string;
|
|
60
|
-
shapeId: string;
|
|
61
|
-
storyId: string;
|
|
62
|
-
start: number;
|
|
63
|
-
end: number;
|
|
64
|
-
text: string;
|
|
65
|
-
}
|
|
66
|
-
type ShapeKind = 'shape' | 'picture' | 'graphicFrame' | 'group';
|
|
67
|
-
interface ColorValue {
|
|
68
|
-
rgb?: string;
|
|
69
|
-
themeColor?: string;
|
|
70
|
-
themeTint?: string;
|
|
71
|
-
themeShade?: string;
|
|
72
|
-
auto?: boolean;
|
|
73
|
-
luminanceModulation?: number;
|
|
74
|
-
luminanceOffset?: number;
|
|
75
|
-
saturationModulation?: number;
|
|
76
|
-
alpha?: number;
|
|
77
|
-
}
|
|
78
|
-
interface ShapeGradient {
|
|
79
|
-
type: string;
|
|
80
|
-
angle?: number;
|
|
81
|
-
stops: Array<{
|
|
82
|
-
position: number;
|
|
83
|
-
color: ColorValue;
|
|
84
|
-
}>;
|
|
85
|
-
}
|
|
86
|
-
/** An authored fill as the deck stores it. */
|
|
87
|
-
interface ShapeFill {
|
|
88
|
-
type: string;
|
|
89
|
-
color?: ColorValue;
|
|
90
|
-
gradient?: ShapeGradient;
|
|
91
|
-
}
|
|
92
|
-
interface ShapeLineEnd {
|
|
93
|
-
type: string;
|
|
94
|
-
width: string | null;
|
|
95
|
-
length: string | null;
|
|
96
|
-
}
|
|
97
|
-
/** An authored outline as the deck stores it; `width` is EMU. */
|
|
98
|
-
interface ShapeOutline {
|
|
99
|
-
width?: number;
|
|
100
|
-
color?: ColorValue;
|
|
101
|
-
gradient?: ShapeGradient;
|
|
102
|
-
style?: string;
|
|
103
|
-
cap?: string;
|
|
104
|
-
join?: string;
|
|
105
|
-
headEnd?: ShapeLineEnd;
|
|
106
|
-
tailEnd?: ShapeLineEnd;
|
|
107
|
-
}
|
|
108
|
-
type BlipEffect = {
|
|
109
|
-
type: 'biLevel';
|
|
110
|
-
threshold: number;
|
|
111
|
-
} | {
|
|
112
|
-
type: 'grayscale';
|
|
113
|
-
} | {
|
|
114
|
-
type: 'luminance';
|
|
115
|
-
brightness: number;
|
|
116
|
-
contrast: number;
|
|
117
|
-
} | {
|
|
118
|
-
type: 'duotone';
|
|
119
|
-
shadow: ColorValue | null;
|
|
120
|
-
highlight: ColorValue | null;
|
|
121
|
-
} | {
|
|
122
|
-
type: 'colorChange';
|
|
123
|
-
from: ColorValue | null;
|
|
124
|
-
to: ColorValue | null;
|
|
125
|
-
useAlpha?: boolean;
|
|
126
|
-
};
|
|
127
|
-
interface ShapeSnapshot {
|
|
128
|
-
id: string;
|
|
129
|
-
sourceId: number;
|
|
130
|
-
kind: ShapeKind;
|
|
131
|
-
name: string;
|
|
132
|
-
x: number;
|
|
133
|
-
y: number;
|
|
134
|
-
width: number;
|
|
135
|
-
height: number;
|
|
136
|
-
rotationDeg: number;
|
|
137
|
-
flipH: boolean;
|
|
138
|
-
flipV: boolean;
|
|
139
|
-
/** The geometry the shape draws at, present only while it has none of its own. */
|
|
140
|
-
inherited?: InheritedGeometry | null;
|
|
141
|
-
/** Hides this shape and its descendants; omitted when false. */
|
|
142
|
-
hidden?: boolean;
|
|
143
|
-
geometry: string;
|
|
144
|
-
adjustValues: Record<string, number>;
|
|
145
|
-
placeholder: unknown | null;
|
|
146
|
-
fill: ShapeFill | null;
|
|
147
|
-
resolvedFillColor: string | null;
|
|
148
|
-
outline: ShapeOutline | null;
|
|
149
|
-
resolvedOutlineColor: string | null;
|
|
150
|
-
mediaPartPath: string | null;
|
|
151
|
-
/** Image data added to this session, retained across saves. */
|
|
152
|
-
pendingMedia?: {
|
|
153
|
-
contentType: string;
|
|
154
|
-
base64: string;
|
|
155
|
-
} | null;
|
|
156
|
-
blipEffects?: BlipEffect[];
|
|
157
|
-
graphic: unknown | null;
|
|
158
|
-
textStories: StorySnapshot[];
|
|
159
|
-
children: ShapeSnapshot[];
|
|
160
|
-
}
|
|
161
|
-
/** The transform a placeholder takes from its layout or master. */
|
|
162
|
-
interface InheritedGeometry {
|
|
163
|
-
x: number;
|
|
164
|
-
y: number;
|
|
165
|
-
width: number;
|
|
166
|
-
height: number;
|
|
167
|
-
rotationDeg: number;
|
|
168
|
-
flipH: boolean;
|
|
169
|
-
flipV: boolean;
|
|
170
|
-
}
|
|
171
|
-
interface SlideSnapshot {
|
|
172
|
-
id: string;
|
|
173
|
-
sourcePartPath: string | null;
|
|
174
|
-
layoutPartPath: string | null;
|
|
175
|
-
name: string | null;
|
|
176
|
-
/** Speaker notes as plain text; absent when the slide has none. */
|
|
177
|
-
notes?: string;
|
|
178
|
-
shapes: ShapeSnapshot[];
|
|
179
|
-
}
|
|
180
|
-
interface DeckSnapshot {
|
|
181
|
-
widthEmu: number;
|
|
182
|
-
heightEmu: number;
|
|
183
|
-
slides: SlideSnapshot[];
|
|
184
|
-
commentFlavor?: CommentFlavor;
|
|
185
|
-
comments?: CommentSnapshot[];
|
|
186
|
-
}
|
|
187
|
-
/** Legacy comments or modern threads. */
|
|
188
|
-
type CommentFlavor = 'legacy' | 'modern';
|
|
189
|
-
interface CommentSnapshot {
|
|
190
|
-
id: string;
|
|
191
|
-
slideId: string;
|
|
192
|
-
author: string;
|
|
193
|
-
initials: string;
|
|
194
|
-
text: string;
|
|
195
|
-
created: string | null;
|
|
196
|
-
xEmu: number;
|
|
197
|
-
yEmu: number;
|
|
198
|
-
/** Set on a reply; names the thread root. Modern decks only. */
|
|
199
|
-
parentId: string | null;
|
|
200
|
-
resolved: boolean;
|
|
201
|
-
}
|
|
202
|
-
interface CommentReceipt {
|
|
203
|
-
commentId: string;
|
|
204
|
-
slideId: string;
|
|
205
|
-
parentId: string | null;
|
|
206
|
-
resolved: boolean;
|
|
207
|
-
}
|
|
208
|
-
interface SlideReceipt {
|
|
209
|
-
slideId: string;
|
|
210
|
-
fromIndex: number | null;
|
|
211
|
-
toIndex: number | null;
|
|
212
|
-
}
|
|
213
|
-
interface ShapeReceipt {
|
|
214
|
-
slideId: string;
|
|
215
|
-
shapeId: string;
|
|
216
|
-
index: number;
|
|
217
|
-
}
|
|
218
|
-
interface ShapeZOrderReceipt {
|
|
219
|
-
slideId: string;
|
|
220
|
-
shapeId: string;
|
|
221
|
-
fromIndex: number;
|
|
222
|
-
toIndex: number;
|
|
223
|
-
}
|
|
224
|
-
interface ShapeRect {
|
|
225
|
-
x: number;
|
|
226
|
-
y: number;
|
|
227
|
-
width: number;
|
|
228
|
-
height: number;
|
|
229
|
-
}
|
|
230
|
-
interface TransformReceipt {
|
|
231
|
-
slideId: string;
|
|
232
|
-
shapeId: string;
|
|
233
|
-
before: ShapeRect;
|
|
234
|
-
after: ShapeRect;
|
|
235
|
-
}
|
|
236
|
-
interface TextReceipt {
|
|
237
|
-
storyId: string;
|
|
238
|
-
start: number;
|
|
239
|
-
end: number;
|
|
240
|
-
text: string;
|
|
241
|
-
}
|
|
242
|
-
interface ShapeDraft {
|
|
243
|
-
name: string;
|
|
244
|
-
rect: ShapeRect;
|
|
245
|
-
text: string;
|
|
246
|
-
style: TextStyle;
|
|
247
|
-
}
|
|
248
|
-
interface PresetShapeDraft {
|
|
249
|
-
name: string;
|
|
250
|
-
geometry: string;
|
|
251
|
-
rect: ShapeRect;
|
|
252
|
-
fill?: string | null;
|
|
253
|
-
}
|
|
254
|
-
interface PictureDraft {
|
|
255
|
-
name: string;
|
|
256
|
-
rect: ShapeRect;
|
|
257
|
-
/** The image's MIME type, e.g. `image/png`. */
|
|
258
|
-
contentType: string;
|
|
259
|
-
/** The image bytes, base64-encoded. */
|
|
260
|
-
mediaBase64: string;
|
|
261
|
-
}
|
|
262
|
-
interface ShapeStroke {
|
|
263
|
-
color?: string;
|
|
264
|
-
widthPt?: number;
|
|
265
|
-
}
|
|
266
|
-
interface ShapeFillReceipt {
|
|
267
|
-
slideId: string;
|
|
268
|
-
shapeId: string;
|
|
269
|
-
before: string | null;
|
|
270
|
-
after: string | null;
|
|
271
|
-
}
|
|
272
|
-
interface ShapeStrokeReceipt {
|
|
273
|
-
slideId: string;
|
|
274
|
-
shapeId: string;
|
|
275
|
-
before: ShapeStroke | null;
|
|
276
|
-
after: ShapeStroke | null;
|
|
277
|
-
}
|
|
278
|
-
interface ShapeAdjustReceipt {
|
|
279
|
-
slideId: string;
|
|
280
|
-
shapeId: string;
|
|
281
|
-
before: Record<string, number>;
|
|
282
|
-
after: Record<string, number>;
|
|
283
|
-
}
|
|
284
|
-
interface HistoryResult {
|
|
285
|
-
applied: boolean;
|
|
286
|
-
snapshot: DeckSnapshot;
|
|
287
|
-
}
|
|
288
|
-
/** Renderer stage latencies of one profiled slide layout, in ms. */
|
|
289
|
-
interface LayoutProfile {
|
|
290
|
-
scopeMs: number;
|
|
291
|
-
layoutMs: number;
|
|
292
|
-
serializeMs: number;
|
|
293
|
-
}
|
|
294
|
-
interface ProfiledLayout {
|
|
295
|
-
layout: SlideDisplayList;
|
|
296
|
-
profile: LayoutProfile;
|
|
297
|
-
}
|
|
298
|
-
/** Boundary stage latencies of one profiled edit, in ms. */
|
|
299
|
-
interface EditProfile {
|
|
300
|
-
parseMs: number;
|
|
301
|
-
applyMs: number;
|
|
302
|
-
serializeMs: number;
|
|
303
|
-
}
|
|
304
|
-
interface HistoryProfile {
|
|
305
|
-
undoMs: number;
|
|
306
|
-
snapshotMs: number;
|
|
307
|
-
serializeMs: number;
|
|
308
|
-
}
|
|
309
|
-
interface Profiled<T, P = EditProfile> {
|
|
310
|
-
receipt: T;
|
|
311
|
-
profile: P;
|
|
312
|
-
}
|
|
313
|
-
interface PptxFontFace {
|
|
314
|
-
family: string;
|
|
315
|
-
bold?: boolean;
|
|
316
|
-
italic?: boolean;
|
|
317
|
-
bytes: Uint8Array;
|
|
318
|
-
}
|
|
319
|
-
type GeometryPathCommand = {
|
|
320
|
-
type: 'move';
|
|
321
|
-
x: number;
|
|
322
|
-
y: number;
|
|
323
|
-
} | {
|
|
324
|
-
type: 'line';
|
|
325
|
-
x: number;
|
|
326
|
-
y: number;
|
|
327
|
-
} | {
|
|
328
|
-
type: 'quad';
|
|
329
|
-
cpx: number;
|
|
330
|
-
cpy: number;
|
|
331
|
-
x: number;
|
|
332
|
-
y: number;
|
|
333
|
-
} | {
|
|
334
|
-
type: 'cubic';
|
|
335
|
-
cp1x: number;
|
|
336
|
-
cp1y: number;
|
|
337
|
-
cp2x: number;
|
|
338
|
-
cp2y: number;
|
|
339
|
-
x: number;
|
|
340
|
-
y: number;
|
|
341
|
-
} | {
|
|
342
|
-
type: 'close';
|
|
343
|
-
};
|
|
344
|
-
type Paint = {
|
|
345
|
-
kind: 'solid';
|
|
346
|
-
color: string;
|
|
347
|
-
} | {
|
|
348
|
-
kind: 'gradient';
|
|
349
|
-
gradientType: 'linear' | 'radial' | 'rectangular' | 'path';
|
|
350
|
-
angleDeg?: number;
|
|
351
|
-
stops: Array<{
|
|
352
|
-
position: number;
|
|
353
|
-
color: string;
|
|
354
|
-
}>;
|
|
355
|
-
};
|
|
356
|
-
interface StrokeEnd {
|
|
357
|
-
kind: string;
|
|
358
|
-
width: number;
|
|
359
|
-
length: number;
|
|
360
|
-
}
|
|
361
|
-
interface Stroke {
|
|
362
|
-
/** Solid colour or first gradient stop. */
|
|
363
|
-
color: string;
|
|
364
|
-
width: number;
|
|
365
|
-
dashed?: boolean;
|
|
366
|
-
paint?: Paint;
|
|
367
|
-
join?: 'round' | 'bevel' | 'miter';
|
|
368
|
-
headEnd?: StrokeEnd;
|
|
369
|
-
tailEnd?: StrokeEnd;
|
|
370
|
-
}
|
|
371
|
-
/** An `a:outerShdw`: a blurred copy of the shape's own path, offset and tinted. */
|
|
372
|
-
interface Shadow {
|
|
373
|
-
paths?: Array<{
|
|
374
|
-
path: GeometryPathCommand[];
|
|
375
|
-
fill: boolean;
|
|
376
|
-
stroke?: Stroke;
|
|
377
|
-
}>;
|
|
378
|
-
color: string;
|
|
379
|
-
blur?: number;
|
|
380
|
-
dx?: number;
|
|
381
|
-
dy?: number;
|
|
382
|
-
scaleX?: number;
|
|
383
|
-
scaleY?: number;
|
|
384
|
-
}
|
|
385
|
-
interface PrimitiveTransform {
|
|
386
|
-
rotationDeg?: number;
|
|
387
|
-
flipH?: boolean;
|
|
388
|
-
flipV?: boolean;
|
|
389
|
-
}
|
|
390
|
-
interface PrimitiveBase {
|
|
391
|
-
objectId: number;
|
|
392
|
-
shapeId?: string;
|
|
393
|
-
x: number;
|
|
394
|
-
y: number;
|
|
395
|
-
w: number;
|
|
396
|
-
h: number;
|
|
397
|
-
transform?: PrimitiveTransform;
|
|
398
|
-
}
|
|
399
|
-
interface ShapePrimitive extends PrimitiveBase {
|
|
400
|
-
kind: 'shape';
|
|
401
|
-
name: string;
|
|
402
|
-
geometry: string;
|
|
403
|
-
path: GeometryPathCommand[];
|
|
404
|
-
/** A rectangle substitutes for the authored outline or clip. */
|
|
405
|
-
geometryFallback?: boolean;
|
|
406
|
-
clip?: GeometryPathCommand[];
|
|
407
|
-
evenOdd?: boolean;
|
|
408
|
-
adjustValues?: Record<string, number>;
|
|
409
|
-
fill?: Paint;
|
|
410
|
-
stroke?: Stroke;
|
|
411
|
-
shadow?: Shadow;
|
|
412
|
-
}
|
|
413
|
-
/** An `a:blip` colour transform, colours already resolved to `#rrggbbaa`. */
|
|
414
|
-
type ImageEffect = {
|
|
415
|
-
kind: 'biLevel';
|
|
416
|
-
threshold: number;
|
|
417
|
-
} | {
|
|
418
|
-
kind: 'grayscale';
|
|
419
|
-
} | {
|
|
420
|
-
kind: 'alpha';
|
|
421
|
-
amount: number;
|
|
422
|
-
} | {
|
|
423
|
-
kind: 'luminance';
|
|
424
|
-
brightness: number;
|
|
425
|
-
contrast: number;
|
|
426
|
-
} | {
|
|
427
|
-
kind: 'duotone';
|
|
428
|
-
shadow: string;
|
|
429
|
-
highlight: string;
|
|
430
|
-
} | {
|
|
431
|
-
kind: 'colorChange';
|
|
432
|
-
from: string;
|
|
433
|
-
to: string;
|
|
434
|
-
useAlpha?: boolean;
|
|
435
|
-
};
|
|
436
|
-
interface ImageCrop {
|
|
437
|
-
left?: number;
|
|
438
|
-
top?: number;
|
|
439
|
-
right?: number;
|
|
440
|
-
bottom?: number;
|
|
441
|
-
}
|
|
442
|
-
interface ImagePrimitive extends PrimitiveBase {
|
|
443
|
-
kind: 'image';
|
|
444
|
-
name: string;
|
|
445
|
-
assetId?: string;
|
|
446
|
-
/** Applied to the bitmap in order before it is drawn. */
|
|
447
|
-
effects?: ImageEffect[];
|
|
448
|
-
/** Fraction of the source discarded per edge, from `a:srcRect`. */
|
|
449
|
-
crop?: ImageCrop;
|
|
450
|
-
/** `a:tile`: repeat the picture at its own size, scaled by these fractions. */
|
|
451
|
-
tile?: {
|
|
452
|
-
scaleX: number;
|
|
453
|
-
scaleY: number;
|
|
454
|
-
};
|
|
455
|
-
/** Outline the picture is masked to, when its `spPr` gives it one. */
|
|
456
|
-
path?: GeometryPathCommand[];
|
|
457
|
-
/** A rectangle substitutes for the authored mask. */
|
|
458
|
-
geometryFallback?: boolean;
|
|
459
|
-
stroke?: Stroke;
|
|
460
|
-
shadow?: Shadow;
|
|
461
|
-
}
|
|
462
|
-
interface CaretStop {
|
|
463
|
-
position: number;
|
|
464
|
-
x: number;
|
|
465
|
-
}
|
|
466
|
-
interface PositionedGlyph {
|
|
467
|
-
glyphId: number;
|
|
468
|
-
cluster: number;
|
|
469
|
-
x: number;
|
|
470
|
-
advance: number;
|
|
471
|
-
xOffset: number;
|
|
472
|
-
yOffset: number;
|
|
473
|
-
}
|
|
474
|
-
interface PositionedTextRun {
|
|
475
|
-
text: string;
|
|
476
|
-
start: number;
|
|
477
|
-
end: number;
|
|
478
|
-
x: number;
|
|
479
|
-
width: number;
|
|
480
|
-
fontId: number;
|
|
481
|
-
fontFamily: string;
|
|
482
|
-
fontSizePx: number;
|
|
483
|
-
bold: boolean;
|
|
484
|
-
italic: boolean;
|
|
485
|
-
underline: boolean;
|
|
486
|
-
color: string;
|
|
487
|
-
letterSpacingPx?: number;
|
|
488
|
-
baselineOffsetPx?: number;
|
|
489
|
-
glyphs: PositionedGlyph[];
|
|
490
|
-
}
|
|
491
|
-
interface PositionedTextLine {
|
|
492
|
-
x: number;
|
|
493
|
-
y: number;
|
|
494
|
-
width: number;
|
|
495
|
-
height: number;
|
|
496
|
-
baseline: number;
|
|
497
|
-
start: number;
|
|
498
|
-
end: number;
|
|
499
|
-
runs: PositionedTextRun[];
|
|
500
|
-
caretStops: CaretStop[];
|
|
501
|
-
}
|
|
502
|
-
interface TextBoxPrimitive extends PrimitiveBase {
|
|
503
|
-
kind: 'textBox';
|
|
504
|
-
storyId?: string;
|
|
505
|
-
anchor: 'top' | 'center' | 'bottom';
|
|
506
|
-
paragraphs: Array<{
|
|
507
|
-
align?: 'left' | 'center' | 'right' | 'justify';
|
|
508
|
-
level: number;
|
|
509
|
-
runs: Array<{
|
|
510
|
-
text: string;
|
|
511
|
-
fontFamily: string;
|
|
512
|
-
fontSizePt: number;
|
|
513
|
-
bold?: boolean;
|
|
514
|
-
italic?: boolean;
|
|
515
|
-
underline?: boolean;
|
|
516
|
-
color: string;
|
|
517
|
-
}>;
|
|
518
|
-
}>;
|
|
519
|
-
lines: PositionedTextLine[];
|
|
520
|
-
overflow?: boolean;
|
|
521
|
-
/** `a:rPr/a:effectLst`: the shadow the box's glyphs are drawn with. */
|
|
522
|
-
textShadow?: Shadow;
|
|
523
|
-
}
|
|
524
|
-
interface PlaceholderPrimitive extends PrimitiveBase {
|
|
525
|
-
kind: 'placeholder';
|
|
526
|
-
name: string;
|
|
527
|
-
label?: string;
|
|
528
|
-
}
|
|
529
|
-
/** A plotted chart. Its parts paint clipped to the chart rectangle, and
|
|
530
|
-
* `label` is the screen-reader summary of the whole chart. */
|
|
531
|
-
interface ChartPrimitive extends PrimitiveBase {
|
|
532
|
-
kind: 'chart';
|
|
533
|
-
name: string;
|
|
534
|
-
label: string;
|
|
535
|
-
primitives: SlidePrimitive[];
|
|
536
|
-
}
|
|
537
|
-
/** A laid-out table. Its cells paint clipped to the table rectangle, and
|
|
538
|
-
* `label` is the screen-reader summary of the whole table. */
|
|
539
|
-
interface TablePrimitive extends PrimitiveBase {
|
|
540
|
-
kind: 'table';
|
|
541
|
-
name: string;
|
|
542
|
-
label: string;
|
|
543
|
-
primitives: SlidePrimitive[];
|
|
544
|
-
}
|
|
545
|
-
type SlidePrimitive = ShapePrimitive | ImagePrimitive | TextBoxPrimitive | PlaceholderPrimitive | ChartPrimitive | TablePrimitive;
|
|
546
|
-
interface SlideDisplayList {
|
|
547
|
-
contractVersion: number;
|
|
548
|
-
width: number;
|
|
549
|
-
height: number;
|
|
550
|
-
background?: Paint;
|
|
551
|
-
primitives: SlidePrimitive[];
|
|
552
|
-
}
|
|
553
|
-
type HitTestResult = {
|
|
554
|
-
kind: 'shape';
|
|
555
|
-
shapeId: string;
|
|
556
|
-
} | {
|
|
557
|
-
kind: 'text';
|
|
558
|
-
shapeId: string;
|
|
559
|
-
storyId: string;
|
|
560
|
-
position: number;
|
|
561
|
-
};
|
|
562
|
-
interface UpdateEvent {
|
|
563
|
-
origin: 'local' | 'remote';
|
|
564
|
-
update: Uint8Array;
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
type ProposalEdit = {
|
|
568
|
-
type: 'replaceText';
|
|
569
|
-
storyId: string;
|
|
570
|
-
start: number;
|
|
571
|
-
end: number;
|
|
572
|
-
text: string;
|
|
573
|
-
style?: Partial<TextStyleSnapshot> | null;
|
|
574
|
-
} | {
|
|
575
|
-
type: 'formatText';
|
|
576
|
-
storyId: string;
|
|
577
|
-
start: number;
|
|
578
|
-
end: number;
|
|
579
|
-
patch: Partial<TextStyleSnapshot>;
|
|
580
|
-
} | {
|
|
581
|
-
type: 'setParagraphAlignment';
|
|
582
|
-
storyId: string;
|
|
583
|
-
start: number;
|
|
584
|
-
end: number;
|
|
585
|
-
alignment: ParagraphAlignment | 'justLow' | 'dist' | 'thaiDist' | null;
|
|
586
|
-
} | {
|
|
587
|
-
type: 'setShapeRect';
|
|
588
|
-
slideId: string;
|
|
589
|
-
shapeId: string;
|
|
590
|
-
rect: ShapeRect;
|
|
591
|
-
} | {
|
|
592
|
-
type: 'setShapeFill';
|
|
593
|
-
slideId: string;
|
|
594
|
-
shapeId: string;
|
|
595
|
-
color: string | null;
|
|
596
|
-
} | {
|
|
597
|
-
type: 'setShapeStroke';
|
|
598
|
-
slideId: string;
|
|
599
|
-
shapeId: string;
|
|
600
|
-
stroke: {
|
|
601
|
-
[K in keyof ShapeStroke]: ShapeStroke[K] | null;
|
|
602
|
-
};
|
|
603
|
-
} | {
|
|
604
|
-
type: 'setShapeAdjust';
|
|
605
|
-
slideId: string;
|
|
606
|
-
shapeId: string;
|
|
607
|
-
adjustments: Record<string, number>;
|
|
608
|
-
} | {
|
|
609
|
-
type: 'setSlideNotes';
|
|
610
|
-
slideId: string;
|
|
611
|
-
text: string;
|
|
612
|
-
};
|
|
613
|
-
interface ProposalChange {
|
|
614
|
-
slideId: string;
|
|
615
|
-
shapeId: string | null;
|
|
616
|
-
before: ShapeSnapshot | null;
|
|
617
|
-
after: ShapeSnapshot | null;
|
|
618
|
-
oldText: string;
|
|
619
|
-
newText: string;
|
|
620
|
-
}
|
|
621
|
-
interface Proposal {
|
|
622
|
-
id: string;
|
|
623
|
-
agentId: string;
|
|
624
|
-
note: string | null;
|
|
625
|
-
edits: ProposalEdit[];
|
|
626
|
-
changes: ProposalChange[];
|
|
627
|
-
staleTargets: string[];
|
|
628
|
-
}
|
|
629
|
-
interface ProposalPreview {
|
|
630
|
-
proposal: Proposal;
|
|
631
|
-
snapshot: DeckSnapshot;
|
|
632
|
-
}
|
|
633
|
-
interface ProposalTextChange {
|
|
634
|
-
storyId: string;
|
|
635
|
-
start: number;
|
|
636
|
-
end: number;
|
|
637
|
-
kind: 'insertion' | 'deletion';
|
|
638
|
-
}
|
|
639
|
-
interface ProposalDiffSlide extends ProposalPreview {
|
|
640
|
-
frame: SlideDisplayList;
|
|
641
|
-
textChanges: ProposalTextChange[];
|
|
642
|
-
}
|
|
643
|
-
interface ProposalAcceptance {
|
|
644
|
-
proposalId: string;
|
|
645
|
-
applied: boolean;
|
|
646
|
-
snapshot: DeckSnapshot;
|
|
647
|
-
}
|
|
648
|
-
declare class StaleProposalError extends Error {
|
|
649
|
-
readonly targets: string[];
|
|
650
|
-
constructor(targets: string[]);
|
|
651
|
-
}
|
|
1
|
+
import { C as CanvasImageResolver, S as SlideDisplayList } from './editorSession-Cl_EWgAi.js';
|
|
2
|
+
export { B as BlipEffect, a as CaretStop, b as ColorTransform, c as ColorValue, d as CommentFlavor, e as CommentReceipt, f as CommentSnapshot, D as DeckSnapshot, E as EditProfile, g as EditSuccess, h as ExportCompletion, i as ExportDiagnostic, j as ExportSeverity, G as GeometryPathCommand, H as HistoryProfile, k as HistoryResult, l as HitTestResult, I as ImageCrop, m as ImageEffect, n as ImagePrimitive, o as InheritedGeometry, p as InspectPresentationOptions, L as LayoutProfile, M as MarkdownAnchor, O as OpenPresentationOptions, q as OperationFailure, r as OperationRefusal, P as Paint, s as PaintSlideOptions, t as ParagraphAlignment, u as ParagraphSnapshot, v as PictureDraft, w as PlaceholderPrimitive, x as PositionedGlyph, y as PositionedTextLine, z as PositionedTextRun, A as PptxAnchor, F as PptxAnchorScope, J as PptxCaretAnchor, K as PptxEditFailure, N as PptxEditFailureCode, Q as PptxEditHistory, R as PptxEditPreview, T as PptxEditReceipt, U as PptxEditRefusal, V as PptxEditRequest, W as PptxEditResult, X as PptxEditSource, Y as PptxEditStep, Z as PptxEditTarget, _ as PptxExportComment, $ as PptxExportDiagnostic, a0 as PptxExportDiagnosticCode, a1 as PptxExportError, a2 as PptxExportFailure, a3 as PptxExportFailureCode, a4 as PptxExportList, a5 as PptxExportMark, a6 as PptxExportNotes, a7 as PptxExportObject, a8 as PptxExportObjectKind, a9 as PptxExportOptions, aa as PptxExportParagraph, ab as PptxExportRefusal, ac as PptxExportResult, ad as PptxExportRun, ae as PptxExportShape, af as PptxExportShapeKind, ag as PptxExportSlide, ah as PptxExportStory, ai as PptxExportTable, aj as PptxExportTableCell, ak as PptxFindMatch, al as PptxFindRequest, am as PptxFindResult, an as PptxFindScope, ao as PptxFontFace, ap as PptxMarkdownContent, aq as PptxMarkdownOptions, ar as PptxParagraphText, as as PptxPeerNotReadyError, at as PptxReadRequest, au as PptxReadResult, av as PptxShapeTarget, aw as PptxSlideTarget, ax as PptxSourceProvenance, ay as PptxStoryTarget, az as PptxStoryText, aA as PptxStructuredContent, aB as PptxTextField, aC as PptxTextGuard, aD as PptxTextMatch, aE as PptxTextRange, aF as PptxTextSearchOptions, aG as PptxTextSpan, aH as PptxTextTarget, aI as PptxValidationResult, aJ as PptxWorkerEditorDisposedError, aK as PresentationHandle, aL as PresetShapeDraft, aM as PrimitiveTransform, aN as Profiled, aO as ProfiledLayout, aP as Proposal, aQ as ProposalAcceptance, aR as ProposalChange, aS as ProposalDiffSlide, aT as ProposalEdit, aU as ProposalPreview, aV as ProposalTextChange, aW as ShapeAdjustReceipt, aX as ShapeDraft, aY as ShapeFill, aZ as ShapeFillReceipt, a_ as ShapeGradient, a$ as ShapeKind, b0 as ShapeLineEnd, b1 as ShapeOutline, b2 as ShapePrimitive, b3 as ShapeReceipt, b4 as ShapeRect, b5 as ShapeSnapshot, b6 as ShapeStroke, b7 as ShapeStrokeReceipt, b8 as ShapeZOrderReceipt, b9 as SlideCanvasLike, ba as SlideLayoutSnapshot, bb as SlidePrimitive, bc as SlideReceipt, bd as SlideSnapshot, be as StaleProposalError, bf as StorySnapshot, bg as Stroke, bh as StrokeEnd, bi as TableReceipt, bj as TextBoxPrimitive, bk as TextParagraphDraft, bl as TextReceipt, bm as TextRunSnapshot, bn as TextStyle, bo as TextStylePatch, bp as TextStyleSnapshot, bq as TransformReceipt, br as UndoCaptureMode, bs as UpdateEvent, bt as ValidationSuccess, bu as WasmInitInput, bv as createPptxWorkerEditorSession, bw as exportPptxMarkdown, bx as exportPptxStructured, by as initWasm, bz as inspectPresentation, bA as isProposalsAvailable, bB as isWasmAvailable, bC as openPresentation, bD as openPresentationSession, bE as paintSlide, bF as renderPptxMarkdown, bG as sizeCanvasForSlide, bH as wasmVersion } from './editorSession-Cl_EWgAi.js';
|
|
3
|
+
export { C as CollaborationProvider, P as PRESENCE_LABEL_DURATION_MS, p as presenceColorForClientId } from './presence-C1o8TDwu.js';
|
|
4
|
+
export { A as AsyncCollaborationReplica, b as CollaborationError, c as CollaborationErrorCode, d as CollaborationErrorListener, e as CollaborationProviderOptions, C as CollaborationReplica, f as CollaborationStatus, g as CollaborationStatusChange, h as CollaborationStatusListener, i as CollaborationTransport, j as CollaborationTransportEvent, k as CollaborationUpdateOrigin, l as CollaborationUser, m as PptxPresence, P as PptxPresenceCursor, n as PptxPresenceListener, a as PptxPresencePeer, o as PptxPresenceState, p as PptxPresenceUser } from './types-ui_ARP0o.js';
|
|
652
5
|
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
resolveImage?: CanvasImageResolver;
|
|
656
|
-
maxShadowPixels?: number;
|
|
657
|
-
textChanges?: readonly ProposalTextChange[];
|
|
658
|
-
}
|
|
659
|
-
interface SlideCanvasLike {
|
|
660
|
-
width: number;
|
|
661
|
-
height: number;
|
|
662
|
-
style: {
|
|
663
|
-
width: string;
|
|
664
|
-
height: string;
|
|
665
|
-
};
|
|
6
|
+
interface PresentationImageDecodeOptions {
|
|
7
|
+
maxDimension?: number;
|
|
666
8
|
}
|
|
667
|
-
declare function
|
|
668
|
-
declare function paintSlide(ctx: CanvasRenderingContext2D, list: SlideDisplayList, dpr?: number, scale?: number, options?: PaintSlideOptions): Promise<void>;
|
|
9
|
+
declare function needsElementDecode(blob: Blob): boolean;
|
|
669
10
|
|
|
670
|
-
/** Convert presentation image formats that browsers cannot decode. */
|
|
671
11
|
declare function presentationImageBlob(bytes: Uint8Array): Blob;
|
|
672
|
-
|
|
673
|
-
declare function needsElementDecode(blob: Blob): boolean;
|
|
674
|
-
/**
|
|
675
|
-
* Decode presentation media for the canvas backend, rejecting with
|
|
676
|
-
* `errorMessage` when the browser will not decode it.
|
|
677
|
-
*/
|
|
678
|
-
declare function decodePresentationImage(bytes: Uint8Array, errorMessage: string): Promise<CanvasImageSource>;
|
|
12
|
+
declare function decodePresentationImage(bytes: Uint8Array, errorMessage: string, options?: PresentationImageDecodeOptions): Promise<CanvasImageSource>;
|
|
679
13
|
|
|
680
14
|
interface SlideToPngOptions {
|
|
681
15
|
/** Output scale, e.g. 2 for hidpi. */
|
|
@@ -689,881 +23,4 @@ interface SlideToPngOptions {
|
|
|
689
23
|
*/
|
|
690
24
|
declare function slideToPng(list: SlideDisplayList, options?: SlideToPngOptions): Promise<Blob>;
|
|
691
25
|
|
|
692
|
-
type
|
|
693
|
-
interface CollaborationReplica {
|
|
694
|
-
readonly clientId: number;
|
|
695
|
-
encodeStateVector(): Uint8Array;
|
|
696
|
-
encodeStateAsUpdate(remoteStateVector?: Uint8Array): Uint8Array;
|
|
697
|
-
applyUpdate(update: Uint8Array): unknown;
|
|
698
|
-
onUpdate(listener: (update: Uint8Array, origin: CollaborationUpdateOrigin) => void): () => void;
|
|
699
|
-
}
|
|
700
|
-
type CollaborationTransportEvent = {
|
|
701
|
-
type: 'open';
|
|
702
|
-
} | {
|
|
703
|
-
type: 'message';
|
|
704
|
-
data: Uint8Array;
|
|
705
|
-
} | {
|
|
706
|
-
type: 'close';
|
|
707
|
-
reason?: string;
|
|
708
|
-
} | {
|
|
709
|
-
type: 'error';
|
|
710
|
-
error: unknown;
|
|
711
|
-
} | {
|
|
712
|
-
type: 'drain';
|
|
713
|
-
};
|
|
714
|
-
interface CollaborationTransport {
|
|
715
|
-
/** Starts one connection attempt; transports may also reopen while still subscribed. */
|
|
716
|
-
connect(): void | Promise<void>;
|
|
717
|
-
disconnect(): void | Promise<void>;
|
|
718
|
-
/** Returns true only when the owned frame was accepted; false requires a later drain event. */
|
|
719
|
-
send(data: Uint8Array): boolean;
|
|
720
|
-
onEvent(listener: (event: CollaborationTransportEvent) => void): () => void;
|
|
721
|
-
}
|
|
722
|
-
type CollaborationStatus = 'disconnected' | 'connecting' | 'connected' | 'destroyed';
|
|
723
|
-
interface CollaborationStatusChange {
|
|
724
|
-
status: CollaborationStatus;
|
|
725
|
-
synced: boolean;
|
|
726
|
-
}
|
|
727
|
-
type CollaborationErrorCode = 'backpressure' | 'protocol' | 'replica' | 'transport';
|
|
728
|
-
declare class CollaborationError extends Error {
|
|
729
|
-
readonly code: CollaborationErrorCode;
|
|
730
|
-
readonly cause: unknown;
|
|
731
|
-
constructor(code: CollaborationErrorCode, message: string, cause?: unknown);
|
|
732
|
-
}
|
|
733
|
-
interface CollaborationProviderOptions {
|
|
734
|
-
maxFrameBytes?: number;
|
|
735
|
-
maxMessagesPerFrame?: number;
|
|
736
|
-
maxPendingBytes?: number;
|
|
737
|
-
user?: CollaborationUser;
|
|
738
|
-
}
|
|
739
|
-
type CollaborationStatusListener = (change: CollaborationStatusChange) => void;
|
|
740
|
-
type CollaborationErrorListener = (error: CollaborationError) => void;
|
|
741
|
-
interface CollaborationUser {
|
|
742
|
-
name: string;
|
|
743
|
-
color?: string;
|
|
744
|
-
}
|
|
745
|
-
interface PptxPresenceUser {
|
|
746
|
-
name: string;
|
|
747
|
-
color: string;
|
|
748
|
-
}
|
|
749
|
-
interface PptxPresenceCursor {
|
|
750
|
-
slideId: string;
|
|
751
|
-
shapeId?: string;
|
|
752
|
-
}
|
|
753
|
-
interface PptxPresenceState {
|
|
754
|
-
clientId: number;
|
|
755
|
-
clock: number;
|
|
756
|
-
user: PptxPresenceUser;
|
|
757
|
-
cursor: PptxPresenceCursor | null;
|
|
758
|
-
}
|
|
759
|
-
interface PptxPresencePeer {
|
|
760
|
-
state: PptxPresenceState;
|
|
761
|
-
lastSeen: number;
|
|
762
|
-
cursorMovedAt: number;
|
|
763
|
-
}
|
|
764
|
-
type PptxPresenceListener = (peers: readonly PptxPresencePeer[]) => void;
|
|
765
|
-
interface PptxPresence {
|
|
766
|
-
readonly peers: readonly PptxPresencePeer[];
|
|
767
|
-
setCursor(cursor: PptxPresenceCursor | null): void;
|
|
768
|
-
onPresence(listener: PptxPresenceListener): () => void;
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
declare class CollaborationProvider {
|
|
772
|
-
private readonly replica;
|
|
773
|
-
private readonly transport;
|
|
774
|
-
private readonly maxFrameBytes;
|
|
775
|
-
private readonly maxMessagesPerFrame;
|
|
776
|
-
private readonly maxPendingBytes;
|
|
777
|
-
private readonly localClientId;
|
|
778
|
-
private readonly localUser;
|
|
779
|
-
private readonly remotePresence;
|
|
780
|
-
private readonly statusListeners;
|
|
781
|
-
private readonly errorListeners;
|
|
782
|
-
private readonly presenceListeners;
|
|
783
|
-
private readonly pendingFrames;
|
|
784
|
-
private unsubscribeReplica;
|
|
785
|
-
private unsubscribeTransport;
|
|
786
|
-
private hasTransportSubscription;
|
|
787
|
-
private connectionStatus;
|
|
788
|
-
private isSynced;
|
|
789
|
-
private wantsConnection;
|
|
790
|
-
private isOpen;
|
|
791
|
-
private isDestroyed;
|
|
792
|
-
private epoch;
|
|
793
|
-
private connectAttempt;
|
|
794
|
-
private nextListenerId;
|
|
795
|
-
private queuedBytes;
|
|
796
|
-
private isFlushing;
|
|
797
|
-
private localClock;
|
|
798
|
-
private reportedClockExhaustion;
|
|
799
|
-
private localCursor;
|
|
800
|
-
private lastAwarenessSentAt;
|
|
801
|
-
private cursorTimer;
|
|
802
|
-
private heartbeatTimer;
|
|
803
|
-
private expiryTimer;
|
|
804
|
-
constructor(replica: CollaborationReplica, transport: CollaborationTransport, options?: CollaborationProviderOptions);
|
|
805
|
-
get status(): CollaborationStatus;
|
|
806
|
-
get synced(): boolean;
|
|
807
|
-
get pendingBytes(): number;
|
|
808
|
-
get peers(): readonly PptxPresencePeer[];
|
|
809
|
-
setCursor(cursor: PptxPresenceCursor | null): void;
|
|
810
|
-
connect(): void;
|
|
811
|
-
disconnect(): void;
|
|
812
|
-
destroy(): void;
|
|
813
|
-
onStatus(listener: CollaborationStatusListener): () => void;
|
|
814
|
-
onError(listener: CollaborationErrorListener): () => void;
|
|
815
|
-
onPresence(listener: PptxPresenceListener): () => void;
|
|
816
|
-
private isCurrent;
|
|
817
|
-
private failConnection;
|
|
818
|
-
private takeTransportSubscription;
|
|
819
|
-
private cleanupTransport;
|
|
820
|
-
private handleTransportEvent;
|
|
821
|
-
private handleOpen;
|
|
822
|
-
private handleMessage;
|
|
823
|
-
private respondToSyncStep1;
|
|
824
|
-
private applyRemoteUpdate;
|
|
825
|
-
private forwardLocalUpdate;
|
|
826
|
-
private scheduleCursorBroadcast;
|
|
827
|
-
private broadcastLocalPresence;
|
|
828
|
-
private sendLeaveFrameBestEffort;
|
|
829
|
-
private startPresenceTimers;
|
|
830
|
-
private stopPresenceTimers;
|
|
831
|
-
private schedulePresenceExpiry;
|
|
832
|
-
private clearRemotePresence;
|
|
833
|
-
private emitPresence;
|
|
834
|
-
private sendFrame;
|
|
835
|
-
private queueFrame;
|
|
836
|
-
private flushPending;
|
|
837
|
-
private clearPending;
|
|
838
|
-
private setStatus;
|
|
839
|
-
private report;
|
|
840
|
-
}
|
|
841
|
-
|
|
842
|
-
declare const PRESENCE_LABEL_DURATION_MS = 3000;
|
|
843
|
-
declare function presenceColorForClientId(clientId: number): string;
|
|
844
|
-
|
|
845
|
-
type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
846
|
-
|
|
847
|
-
/**
|
|
848
|
-
* Result envelopes shared by the formats' host edit APIs. Targets, steps, receipts and failure
|
|
849
|
-
* codes stay format-owned; these shapes only fix how every format reports success and refusal.
|
|
850
|
-
*/
|
|
851
|
-
/** Why a host operation was refused, as data. The document is unchanged. */
|
|
852
|
-
interface OperationFailure<Code extends string, Target> {
|
|
853
|
-
code: Code;
|
|
854
|
-
/** The request step that failed, when one did. */
|
|
855
|
-
stepIndex?: number;
|
|
856
|
-
/** The earlier step an `overlapping-steps` failure conflicts with. */
|
|
857
|
-
conflictingStepIndex?: number;
|
|
858
|
-
/** The failing step's target as requested or resolved. */
|
|
859
|
-
target?: Target;
|
|
860
|
-
message: string;
|
|
861
|
-
}
|
|
862
|
-
/** A policy refusal carrying the version the document is still at. */
|
|
863
|
-
interface OperationRefusal<Failure> {
|
|
864
|
-
ok: false;
|
|
865
|
-
version: string;
|
|
866
|
-
failure: Failure;
|
|
867
|
-
}
|
|
868
|
-
/**
|
|
869
|
-
* An accepted edit request. `applied` is false when every step was a no-op; the version then
|
|
870
|
-
* stays `baseVersion` and no history or change notification was produced.
|
|
871
|
-
*/
|
|
872
|
-
interface EditSuccess<Receipt> {
|
|
873
|
-
ok: true;
|
|
874
|
-
baseVersion: string;
|
|
875
|
-
version: string;
|
|
876
|
-
applied: boolean;
|
|
877
|
-
/** One receipt per request step, in request order. */
|
|
878
|
-
receipts: Receipt[];
|
|
879
|
-
}
|
|
880
|
-
/** A validated edit request. Validation reserves nothing and cannot be committed later. */
|
|
881
|
-
interface ValidationSuccess<Preview> {
|
|
882
|
-
ok: true;
|
|
883
|
-
baseVersion: string;
|
|
884
|
-
wouldApply: boolean;
|
|
885
|
-
previews: Preview[];
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
/**
|
|
889
|
-
* Versioned reads and version-checked edit batches over one presentation session. Every shape
|
|
890
|
-
* here is plain JSON so it can cross a worker boundary unchanged; the semantics live in Rust.
|
|
891
|
-
*
|
|
892
|
-
* Text offsets are half-open, story-local UTF-16 positions. A story reads as its paragraphs'
|
|
893
|
-
* text joined by `\n` with no trailing separator; soft line breaks read as `\n` too, and
|
|
894
|
-
* `PptxParagraphText` tells them apart. Slide, shape, story and paragraph ids anchor targets
|
|
895
|
-
* within one session; they are not promised to survive save and reopen.
|
|
896
|
-
*/
|
|
897
|
-
|
|
898
|
-
/** Provenance only: it selects neither permissions nor history. */
|
|
899
|
-
type PptxEditSource = 'host' | 'agent';
|
|
900
|
-
/** `separate`: exactly one undo step. `none`: outside undo history, keeping existing entries. */
|
|
901
|
-
type PptxEditHistory = 'separate' | 'none';
|
|
902
|
-
interface PptxSlideTarget {
|
|
903
|
-
slideId: string;
|
|
904
|
-
}
|
|
905
|
-
/** A shape addressed through the slide that owns it. */
|
|
906
|
-
interface PptxShapeTarget extends PptxSlideTarget {
|
|
907
|
-
shapeId: string;
|
|
908
|
-
}
|
|
909
|
-
/**
|
|
910
|
-
* A text story addressed through its slide and owning shape. Targets reject unknown fields, so
|
|
911
|
-
* copy the ids off a read record rather than passing the record itself.
|
|
912
|
-
*/
|
|
913
|
-
interface PptxStoryTarget extends PptxShapeTarget {
|
|
914
|
-
storyId: string;
|
|
915
|
-
}
|
|
916
|
-
interface PptxTextRange extends PptxStoryTarget {
|
|
917
|
-
start: number;
|
|
918
|
-
end: number;
|
|
919
|
-
}
|
|
920
|
-
/** An explicit range, or the one exact, case-sensitive, paragraph-local match of `text`. */
|
|
921
|
-
type PptxTextTarget = ({
|
|
922
|
-
kind: 'range';
|
|
923
|
-
} & PptxTextRange) | {
|
|
924
|
-
kind: 'search';
|
|
925
|
-
within: PptxStoryTarget;
|
|
926
|
-
text: string;
|
|
927
|
-
};
|
|
928
|
-
/** Refuses the step unless its target currently reads exactly `text`. */
|
|
929
|
-
interface PptxTextGuard {
|
|
930
|
-
text: string;
|
|
931
|
-
}
|
|
932
|
-
/**
|
|
933
|
-
* One batch step. Insertion, replacement and deletion stay inside one paragraph; formatting and
|
|
934
|
-
* alignment may span paragraphs of one story. Geometry, fill and outline steps address shapes at
|
|
935
|
-
* the top of a slide, and fill and outline only preset shapes.
|
|
936
|
-
*/
|
|
937
|
-
type PptxEditStep = {
|
|
938
|
-
op: 'insertText';
|
|
939
|
-
target: PptxTextTarget;
|
|
940
|
-
at: 'start' | 'end';
|
|
941
|
-
text: string;
|
|
942
|
-
expect?: PptxTextGuard;
|
|
943
|
-
} | {
|
|
944
|
-
op: 'replaceText';
|
|
945
|
-
target: PptxTextTarget;
|
|
946
|
-
text: string;
|
|
947
|
-
expect?: PptxTextGuard;
|
|
948
|
-
} | {
|
|
949
|
-
op: 'deleteText';
|
|
950
|
-
target: PptxTextTarget;
|
|
951
|
-
expect?: PptxTextGuard;
|
|
952
|
-
} | {
|
|
953
|
-
op: 'formatText';
|
|
954
|
-
target: PptxTextTarget;
|
|
955
|
-
patch: TextStylePatch;
|
|
956
|
-
expect?: PptxTextGuard;
|
|
957
|
-
} | {
|
|
958
|
-
op: 'setParagraphAlignment';
|
|
959
|
-
target: PptxTextTarget;
|
|
960
|
-
/** `null` restores the inherited alignment. */
|
|
961
|
-
alignment: ParagraphAlignment | null;
|
|
962
|
-
expect?: PptxTextGuard;
|
|
963
|
-
} | {
|
|
964
|
-
op: 'setSlideNotes';
|
|
965
|
-
target: PptxSlideTarget;
|
|
966
|
-
text: string;
|
|
967
|
-
expect?: PptxTextGuard;
|
|
968
|
-
} | {
|
|
969
|
-
op: 'setShapeRect';
|
|
970
|
-
target: PptxShapeTarget;
|
|
971
|
-
rect: ShapeRect;
|
|
972
|
-
expect?: {
|
|
973
|
-
rect: ShapeRect;
|
|
974
|
-
};
|
|
975
|
-
} | {
|
|
976
|
-
op: 'setShapeFill';
|
|
977
|
-
target: PptxShapeTarget;
|
|
978
|
-
/** A `#RRGGBB` solid fill; `null` removes the fill. */
|
|
979
|
-
color: string | null;
|
|
980
|
-
/** The authored fill, as `snapshot()` reports it. */
|
|
981
|
-
expect?: {
|
|
982
|
-
fill: ShapeFill | null;
|
|
983
|
-
};
|
|
984
|
-
} | {
|
|
985
|
-
op: 'setShapeStroke';
|
|
986
|
-
target: PptxShapeTarget;
|
|
987
|
-
stroke: ShapeStroke;
|
|
988
|
-
/** The authored outline, as `snapshot()` reports it. */
|
|
989
|
-
expect?: {
|
|
990
|
-
outline: ShapeOutline | null;
|
|
991
|
-
};
|
|
992
|
-
};
|
|
993
|
-
interface PptxEditRequest {
|
|
994
|
-
/** The version the targets were read at; a changed deck refuses with `stale-version`. */
|
|
995
|
-
expectVersion: string;
|
|
996
|
-
/** Defaults to `host`. */
|
|
997
|
-
source?: PptxEditSource;
|
|
998
|
-
/** Defaults to `separate`. */
|
|
999
|
-
history?: PptxEditHistory;
|
|
1000
|
-
steps: readonly PptxEditStep[];
|
|
1001
|
-
}
|
|
1002
|
-
/** `read-only` comes only from an editor host that does not accept edits, never from a session. */
|
|
1003
|
-
type PptxEditFailureCode = 'stale-version' | 'missing-target' | 'ambiguous-target' | 'content-mismatch' | 'overlapping-steps' | 'unsupported' | 'invalid-step' | 'limit-exceeded' | 'read-only';
|
|
1004
|
-
type PptxEditTarget = PptxTextTarget | ({
|
|
1005
|
-
kind: 'story';
|
|
1006
|
-
} & PptxStoryTarget) | ({
|
|
1007
|
-
kind: 'shape';
|
|
1008
|
-
} & PptxShapeTarget) | ({
|
|
1009
|
-
kind: 'slide';
|
|
1010
|
-
} & PptxSlideTarget);
|
|
1011
|
-
type PptxEditFailure = OperationFailure<PptxEditFailureCode, PptxEditTarget>;
|
|
1012
|
-
type PptxEditRefusal = OperationRefusal<PptxEditFailure>;
|
|
1013
|
-
/** What one step did. Text targets describe the final state; a deletion reports its collapsed boundary. */
|
|
1014
|
-
interface PptxEditReceipt {
|
|
1015
|
-
stepIndex: number;
|
|
1016
|
-
changed: boolean;
|
|
1017
|
-
target: PptxEditTarget;
|
|
1018
|
-
}
|
|
1019
|
-
/** What one step would do at its resolved pre-batch target; it cannot be committed later. */
|
|
1020
|
-
interface PptxEditPreview {
|
|
1021
|
-
stepIndex: number;
|
|
1022
|
-
target: PptxEditTarget;
|
|
1023
|
-
wouldChange: boolean;
|
|
1024
|
-
}
|
|
1025
|
-
type PptxEditResult = (EditSuccess<PptxEditReceipt> & {
|
|
1026
|
-
source: PptxEditSource;
|
|
1027
|
-
changedSlides: string[];
|
|
1028
|
-
changedStories: string[];
|
|
1029
|
-
}) | PptxEditRefusal;
|
|
1030
|
-
type PptxValidationResult = ValidationSuccess<PptxEditPreview> | PptxEditRefusal;
|
|
1031
|
-
interface PptxReadRequest {
|
|
1032
|
-
/** Restricts the read to these slides, returned in deck order; every slide when omitted. */
|
|
1033
|
-
slideIds?: readonly string[];
|
|
1034
|
-
}
|
|
1035
|
-
/** The story offsets of a field result, such as a slide number. */
|
|
1036
|
-
interface PptxTextField {
|
|
1037
|
-
start: number;
|
|
1038
|
-
end: number;
|
|
1039
|
-
fieldType?: string;
|
|
1040
|
-
}
|
|
1041
|
-
interface PptxParagraphText {
|
|
1042
|
-
paragraphId: string;
|
|
1043
|
-
/** Story offsets of the paragraph's text; a following separator sits at `end`. */
|
|
1044
|
-
start: number;
|
|
1045
|
-
end: number;
|
|
1046
|
-
/** Story offsets of soft line breaks, which read as `\n` inside the paragraph. */
|
|
1047
|
-
lineBreaks: number[];
|
|
1048
|
-
/** Field results that text steps leave whole. */
|
|
1049
|
-
fields: PptxTextField[];
|
|
1050
|
-
/**
|
|
1051
|
-
* False when saving could not keep a field once the paragraph changes: the field is empty or
|
|
1052
|
-
* left the paragraph's unchanged leading or trailing text. Steps changing it refuse.
|
|
1053
|
-
*/
|
|
1054
|
-
editable: boolean;
|
|
1055
|
-
}
|
|
1056
|
-
interface PptxStoryText extends PptxStoryTarget {
|
|
1057
|
-
/** Paragraph texts joined by `\n`. */
|
|
1058
|
-
text: string;
|
|
1059
|
-
paragraphs: PptxParagraphText[];
|
|
1060
|
-
}
|
|
1061
|
-
type PptxReadResult = {
|
|
1062
|
-
ok: true;
|
|
1063
|
-
version: string;
|
|
1064
|
-
slides: SlideSnapshot[];
|
|
1065
|
-
stories: PptxStoryText[];
|
|
1066
|
-
} | PptxEditRefusal;
|
|
1067
|
-
/** A slide, one shape and its descendants, or one story; `storyId` needs `shapeId`. */
|
|
1068
|
-
interface PptxFindScope {
|
|
1069
|
-
slideId: string;
|
|
1070
|
-
shapeId?: string;
|
|
1071
|
-
storyId?: string;
|
|
1072
|
-
}
|
|
1073
|
-
interface PptxFindRequest {
|
|
1074
|
-
text: string;
|
|
1075
|
-
/** The whole deck when omitted. */
|
|
1076
|
-
within?: PptxFindScope;
|
|
1077
|
-
/** Defaults to 100; at most 10,000. */
|
|
1078
|
-
limit?: number;
|
|
1079
|
-
}
|
|
1080
|
-
/** One search hit; `range` is reusable as a `{ kind: 'range' }` target. */
|
|
1081
|
-
interface PptxFindMatch {
|
|
1082
|
-
text: string;
|
|
1083
|
-
range: PptxTextRange;
|
|
1084
|
-
}
|
|
1085
|
-
type PptxFindResult = {
|
|
1086
|
-
ok: true;
|
|
1087
|
-
version: string;
|
|
1088
|
-
matches: PptxFindMatch[];
|
|
1089
|
-
truncated: boolean;
|
|
1090
|
-
} | PptxEditRefusal;
|
|
1091
|
-
|
|
1092
|
-
/**
|
|
1093
|
-
* Shapes shared by the formats' read-only structured exports. Content trees, anchors, story or
|
|
1094
|
-
* sheet selectors, diagnostic codes and limits stay format-owned; these only fix how every format
|
|
1095
|
-
* reports diagnostics, truncation and Markdown markers.
|
|
1096
|
-
*/
|
|
1097
|
-
type ExportSeverity = 'info' | 'warning' | 'error';
|
|
1098
|
-
/** Something an export omitted or could not represent, anchored where it applies. */
|
|
1099
|
-
interface ExportDiagnostic<Code extends string, Anchor> {
|
|
1100
|
-
code: Code;
|
|
1101
|
-
severity: ExportSeverity;
|
|
1102
|
-
anchor: Anchor | null;
|
|
1103
|
-
message: string;
|
|
1104
|
-
}
|
|
1105
|
-
/** Whether an export stopped at its limits before the end of the content. */
|
|
1106
|
-
interface ExportCompletion {
|
|
1107
|
-
truncated: boolean;
|
|
1108
|
-
}
|
|
1109
|
-
/** A Markdown marker comment and the anchor of the content it precedes. */
|
|
1110
|
-
interface MarkdownAnchor<Anchor> {
|
|
1111
|
-
marker: string;
|
|
1112
|
-
anchor: Anchor;
|
|
1113
|
-
}
|
|
1114
|
-
|
|
1115
|
-
/**
|
|
1116
|
-
* Read-only structured export of PPTX content: slides in deck order, each with its shape tree,
|
|
1117
|
-
* text stories, tables and placeholders for content the export cannot represent, every record
|
|
1118
|
-
* with the location it was read from, and diagnostics for everything omitted. Plain JSON,
|
|
1119
|
-
* produced by one Rust walker for sessions and bytes.
|
|
1120
|
-
*
|
|
1121
|
-
* Reading order is the current shape tree, depth first: slides in deck order, shapes in tree
|
|
1122
|
-
* order, a group's descendants at the group's position, table cells row by row. It is the
|
|
1123
|
-
* authored order, not a reading order inferred from geometry.
|
|
1124
|
-
*
|
|
1125
|
-
* `range` anchors are batch text targets in the story offsets of `readContent()`, so a session
|
|
1126
|
-
* export's `range` anchor can be a step's `target` at the version it was read at; `notes` and
|
|
1127
|
-
* `comment` anchors index the plain text they carry; `sourcePart` anchors address retained source
|
|
1128
|
-
* XML by element-child ordinals. Session anchors belong to the version they were read at; ids are
|
|
1129
|
-
* deterministic export-tree paths.
|
|
1130
|
-
*/
|
|
1131
|
-
|
|
1132
|
-
/** `session` anchors resolve against the returned version; `snapshot` ones against the content. */
|
|
1133
|
-
type PptxAnchorScope = 'session' | 'snapshot';
|
|
1134
|
-
/** A half-open range of UTF-16 offsets. */
|
|
1135
|
-
interface PptxTextSpan {
|
|
1136
|
-
start: number;
|
|
1137
|
-
end: number;
|
|
1138
|
-
}
|
|
1139
|
-
type PptxAnchor = {
|
|
1140
|
-
kind: 'slide';
|
|
1141
|
-
slideId: string;
|
|
1142
|
-
} | {
|
|
1143
|
-
kind: 'shape';
|
|
1144
|
-
slideId: string;
|
|
1145
|
-
shapeId: string;
|
|
1146
|
-
} | Extract<PptxTextTarget, {
|
|
1147
|
-
kind: 'range';
|
|
1148
|
-
}> | {
|
|
1149
|
-
kind: 'notes';
|
|
1150
|
-
slideId: string;
|
|
1151
|
-
range: PptxTextSpan;
|
|
1152
|
-
} | {
|
|
1153
|
-
kind: 'comment';
|
|
1154
|
-
slideId: string;
|
|
1155
|
-
commentId: string;
|
|
1156
|
-
range: PptxTextSpan;
|
|
1157
|
-
} | {
|
|
1158
|
-
kind: 'sourcePart';
|
|
1159
|
-
part: string;
|
|
1160
|
-
partSha256: string;
|
|
1161
|
-
path: number[];
|
|
1162
|
-
};
|
|
1163
|
-
/**
|
|
1164
|
-
* The retained source XML a record was seeded from: `sldId` is the owning slide's `p:sldId/@id`,
|
|
1165
|
-
* `sourceId` a shape's `cNvPr/@id`.
|
|
1166
|
-
*/
|
|
1167
|
-
interface PptxSourceProvenance {
|
|
1168
|
-
part: string;
|
|
1169
|
-
partSha256: string;
|
|
1170
|
-
path: number[];
|
|
1171
|
-
sldId: number | null;
|
|
1172
|
-
sourceId: number | null;
|
|
1173
|
-
}
|
|
1174
|
-
interface PptxStructuredContent extends ExportCompletion {
|
|
1175
|
-
schemaVersion: 1;
|
|
1176
|
-
anchorScope: PptxAnchorScope;
|
|
1177
|
-
readingOrder: 'shapeTree';
|
|
1178
|
-
included: {
|
|
1179
|
-
hiddenSlides: boolean;
|
|
1180
|
-
hiddenShapes: boolean;
|
|
1181
|
-
notes: boolean;
|
|
1182
|
-
comments: boolean;
|
|
1183
|
-
formatting: boolean;
|
|
1184
|
-
};
|
|
1185
|
-
slides: PptxExportSlide[];
|
|
1186
|
-
diagnostics: PptxExportDiagnostic[];
|
|
1187
|
-
}
|
|
1188
|
-
interface PptxExportSlide {
|
|
1189
|
-
id: string;
|
|
1190
|
-
/** Zero-based position in the current deck, hidden slides counted. */
|
|
1191
|
-
index: number;
|
|
1192
|
-
anchor: PptxAnchor;
|
|
1193
|
-
name: string | null;
|
|
1194
|
-
/**
|
|
1195
|
-
* `null` when the deck does not record it: such slides are exported with a
|
|
1196
|
-
* `visibility-unknown` diagnostic.
|
|
1197
|
-
*/
|
|
1198
|
-
hidden: boolean | null;
|
|
1199
|
-
provenance: PptxSourceProvenance | null;
|
|
1200
|
-
shapes: PptxExportShape[];
|
|
1201
|
-
notes: PptxExportNotes | null;
|
|
1202
|
-
comments: PptxExportComment[];
|
|
1203
|
-
}
|
|
1204
|
-
/** `unknown` is a shape-tree element only the source holds, anchored by its source location. */
|
|
1205
|
-
type PptxExportShapeKind = 'shape' | 'picture' | 'graphicFrame' | 'group' | 'unknown';
|
|
1206
|
-
interface PptxExportShape {
|
|
1207
|
-
id: string;
|
|
1208
|
-
anchor: PptxAnchor;
|
|
1209
|
-
kind: PptxExportShapeKind;
|
|
1210
|
-
name: string;
|
|
1211
|
-
/** Alternative-text title and description. */
|
|
1212
|
-
title: string | null;
|
|
1213
|
-
description: string | null;
|
|
1214
|
-
/** Hidden itself or through a hidden group. */
|
|
1215
|
-
hidden: boolean;
|
|
1216
|
-
placeholder: {
|
|
1217
|
-
type: string | null;
|
|
1218
|
-
index: number | null;
|
|
1219
|
-
} | null;
|
|
1220
|
-
provenance: PptxSourceProvenance | null;
|
|
1221
|
-
stories: PptxExportStory[];
|
|
1222
|
-
table: PptxExportTable | null;
|
|
1223
|
-
object: PptxExportObject | null;
|
|
1224
|
-
children: PptxExportShape[];
|
|
1225
|
-
}
|
|
1226
|
-
interface PptxExportStory {
|
|
1227
|
-
id: string;
|
|
1228
|
-
/** Spans the whole story. */
|
|
1229
|
-
anchor: PptxAnchor;
|
|
1230
|
-
paragraphs: PptxExportParagraph[];
|
|
1231
|
-
}
|
|
1232
|
-
interface PptxExportParagraph {
|
|
1233
|
-
id: string;
|
|
1234
|
-
anchor: PptxAnchor;
|
|
1235
|
-
paragraphId: string;
|
|
1236
|
-
level: number;
|
|
1237
|
-
/** The authored alignment, else the inherited one. */
|
|
1238
|
-
alignment: string | null;
|
|
1239
|
-
/** The paragraph's own bullet, as the session stores it. */
|
|
1240
|
-
bulletJson: string | null;
|
|
1241
|
-
/** The marker after inheritance and numbering; `null` for a paragraph that is no list item. */
|
|
1242
|
-
list: PptxExportList | null;
|
|
1243
|
-
runs: PptxExportRun[];
|
|
1244
|
-
}
|
|
1245
|
-
/**
|
|
1246
|
-
* `character` is the authored `a:buChar` and `font` its typeface, a symbol font when the character
|
|
1247
|
-
* names a glyph slot. `marker` is the formatted number, `null` for a scheme that cannot be
|
|
1248
|
-
* formatted.
|
|
1249
|
-
*/
|
|
1250
|
-
type PptxExportList = {
|
|
1251
|
-
kind: 'bullet';
|
|
1252
|
-
character: string;
|
|
1253
|
-
font: string | null;
|
|
1254
|
-
} | {
|
|
1255
|
-
kind: 'number';
|
|
1256
|
-
scheme: string;
|
|
1257
|
-
startAt: number;
|
|
1258
|
-
value: number;
|
|
1259
|
-
marker: string | null;
|
|
1260
|
-
};
|
|
1261
|
-
type PptxExportMark = {
|
|
1262
|
-
kind: 'bold' | 'italic' | 'superscript' | 'subscript' | 'smallCaps' | 'allCaps';
|
|
1263
|
-
} | {
|
|
1264
|
-
kind: 'underline';
|
|
1265
|
-
style: string;
|
|
1266
|
-
};
|
|
1267
|
-
/** Line breaks are one `\n` unit, fields cover their cached result; unsupported runs are zero-width. */
|
|
1268
|
-
type PptxExportRun = {
|
|
1269
|
-
anchor: PptxAnchor;
|
|
1270
|
-
/** `null` when the export excludes formatting. */
|
|
1271
|
-
marks: PptxExportMark[] | null;
|
|
1272
|
-
/** A click hyperlink: an external URL, or the part an internal link jumps to. */
|
|
1273
|
-
link: {
|
|
1274
|
-
href: string;
|
|
1275
|
-
external: boolean;
|
|
1276
|
-
} | null;
|
|
1277
|
-
} & ({
|
|
1278
|
-
kind: 'text';
|
|
1279
|
-
text: string;
|
|
1280
|
-
} | {
|
|
1281
|
-
kind: 'lineBreak';
|
|
1282
|
-
}
|
|
1283
|
-
/** A field's cached result; fields are never evaluated. */
|
|
1284
|
-
| {
|
|
1285
|
-
kind: 'field';
|
|
1286
|
-
fieldType: string | null;
|
|
1287
|
-
text: string;
|
|
1288
|
-
} | {
|
|
1289
|
-
kind: 'unsupported';
|
|
1290
|
-
element: string;
|
|
1291
|
-
});
|
|
1292
|
-
/**
|
|
1293
|
-
* A table on its grid. Every source cell appears once; `merged` marks a continuation covered by
|
|
1294
|
-
* the cell at `mergeOrigin`, whose content PowerPoint does not show.
|
|
1295
|
-
*/
|
|
1296
|
-
interface PptxExportTable {
|
|
1297
|
-
columns: number;
|
|
1298
|
-
rows: Array<{
|
|
1299
|
-
cells: PptxExportTableCell[];
|
|
1300
|
-
}>;
|
|
1301
|
-
}
|
|
1302
|
-
interface PptxExportTableCell {
|
|
1303
|
-
id: string;
|
|
1304
|
-
anchor: PptxAnchor;
|
|
1305
|
-
row: number;
|
|
1306
|
-
column: number;
|
|
1307
|
-
gridSpan: number;
|
|
1308
|
-
rowSpan: number;
|
|
1309
|
-
merged: boolean;
|
|
1310
|
-
mergeOrigin: {
|
|
1311
|
-
row: number;
|
|
1312
|
-
column: number;
|
|
1313
|
-
} | null;
|
|
1314
|
-
story: PptxExportStory | null;
|
|
1315
|
-
}
|
|
1316
|
-
type PptxExportObjectKind = 'picture' | 'video' | 'audio' | 'chart' | 'smartArt' | 'embeddedObject' | 'unknown';
|
|
1317
|
-
/** A placeholder for content the export does not represent; its data is never included. */
|
|
1318
|
-
interface PptxExportObject {
|
|
1319
|
-
id: string;
|
|
1320
|
-
kind: PptxExportObjectKind;
|
|
1321
|
-
/** The source element's qualified name, such as `p:graphicFrame`. */
|
|
1322
|
-
element: string;
|
|
1323
|
-
uri: string | null;
|
|
1324
|
-
relationshipIds: string[];
|
|
1325
|
-
/** The package parts the object references. */
|
|
1326
|
-
parts: string[];
|
|
1327
|
-
/** Targets of its external relationships, such as a linked video. */
|
|
1328
|
-
externalTargets: string[];
|
|
1329
|
-
}
|
|
1330
|
-
/** A slide's speaker notes, as plain text. */
|
|
1331
|
-
interface PptxExportNotes {
|
|
1332
|
-
id: string;
|
|
1333
|
-
anchor: PptxAnchor;
|
|
1334
|
-
text: string;
|
|
1335
|
-
provenance: PptxSourceProvenance | null;
|
|
1336
|
-
}
|
|
1337
|
-
interface PptxExportComment {
|
|
1338
|
-
id: string;
|
|
1339
|
-
anchor: PptxAnchor;
|
|
1340
|
-
commentId: string;
|
|
1341
|
-
author: string | null;
|
|
1342
|
-
date: string | null;
|
|
1343
|
-
parentId: string | null;
|
|
1344
|
-
resolved: boolean;
|
|
1345
|
-
text: string;
|
|
1346
|
-
}
|
|
1347
|
-
type PptxExportDiagnosticCode = 'unsupported-content' | 'image-data-omitted' | 'unsupported-numbering' | 'field-cached-result' | 'provenance-unavailable' | 'visibility-unknown' | 'hidden-content-excluded' | 'stories-omitted' | 'formatting-omitted' | 'inherited-content-omitted' | 'notes-structure-omitted' | 'merge-continuation-content-omitted' | 'truncated' | 'markdown-lossy';
|
|
1348
|
-
type PptxExportDiagnostic = ExportDiagnostic<PptxExportDiagnosticCode, PptxAnchor>;
|
|
1349
|
-
/**
|
|
1350
|
-
* What to export. Hidden slides and shapes, notes and comments are excluded unless requested, and
|
|
1351
|
-
* formatting is included unless turned off. `maxBlocks` defaults to 10,000 (at most 1,000,000;
|
|
1352
|
-
* every slide, shape, paragraph, notes story and comment counts) and `maxBytes` to 8,388,608
|
|
1353
|
-
* (1,024 to 67,108,864, measured on the compact JSON).
|
|
1354
|
-
*/
|
|
1355
|
-
interface PptxExportOptions {
|
|
1356
|
-
includeHiddenSlides?: boolean;
|
|
1357
|
-
includeHiddenShapes?: boolean;
|
|
1358
|
-
includeNotes?: boolean;
|
|
1359
|
-
includeComments?: boolean;
|
|
1360
|
-
includeFormatting?: boolean;
|
|
1361
|
-
maxBlocks?: number;
|
|
1362
|
-
maxBytes?: number;
|
|
1363
|
-
}
|
|
1364
|
-
/** `maxBytes` bounds the Markdown text; the default and range are the export's. */
|
|
1365
|
-
interface PptxMarkdownOptions {
|
|
1366
|
-
maxBytes?: number;
|
|
1367
|
-
}
|
|
1368
|
-
/**
|
|
1369
|
-
* Markdown rendered from structured content. Each `<!-- pptx-export:N -->` marker precedes the
|
|
1370
|
-
* record `anchors` maps it to. Markdown keeps no slide layout, geometry or typography.
|
|
1371
|
-
*/
|
|
1372
|
-
interface PptxMarkdownContent extends ExportCompletion {
|
|
1373
|
-
markdown: string;
|
|
1374
|
-
anchors: MarkdownAnchor<PptxAnchor>[];
|
|
1375
|
-
diagnostics: PptxExportDiagnostic[];
|
|
1376
|
-
}
|
|
1377
|
-
/**
|
|
1378
|
-
* Options out of range or above a hard maximum, or structured content handed to the renderer that
|
|
1379
|
-
* contradicts itself. Unsupported deck content is diagnosed, never refused.
|
|
1380
|
-
*/
|
|
1381
|
-
type PptxExportFailureCode = 'invalid-options' | 'limit-exceeded' | 'invalid-content';
|
|
1382
|
-
/** Why an export was refused; `target` is the anchor the refusal concerns, if any. */
|
|
1383
|
-
interface PptxExportFailure {
|
|
1384
|
-
code: PptxExportFailureCode;
|
|
1385
|
-
target: PptxAnchor | null;
|
|
1386
|
-
message: string;
|
|
1387
|
-
}
|
|
1388
|
-
type PptxExportRefusal = OperationRefusal<PptxExportFailure>;
|
|
1389
|
-
/** A session export: the content with the version it was read at, or a refusal. */
|
|
1390
|
-
type PptxExportResult<T> = {
|
|
1391
|
-
ok: true;
|
|
1392
|
-
version: string;
|
|
1393
|
-
content: T;
|
|
1394
|
-
} | PptxExportRefusal;
|
|
1395
|
-
/** A headless export or rendering the engine refused as data. */
|
|
1396
|
-
declare class PptxExportError extends Error {
|
|
1397
|
-
readonly failure: PptxExportFailure;
|
|
1398
|
-
constructor(failure: PptxExportFailure);
|
|
1399
|
-
}
|
|
1400
|
-
|
|
1401
|
-
type WasmInitInput = InitInput | Promise<InitInput>;
|
|
1402
|
-
interface OpenPresentationOptions {
|
|
1403
|
-
clientId?: number;
|
|
1404
|
-
fonts?: ReadonlyArray<PptxFontFace>;
|
|
1405
|
-
/** Faces drawn only for characters the run's own face has no glyph for, e.g. a script's Noto face. */
|
|
1406
|
-
fallbackFonts?: ReadonlyArray<PptxFontFace>;
|
|
1407
|
-
/**
|
|
1408
|
-
* Opens from a collaboration update instead of parsing the file bytes.
|
|
1409
|
-
* When the bytes are the file the update was seeded from, the session
|
|
1410
|
-
* keeps them and `save()` works; any other bytes open without a source
|
|
1411
|
-
* and `save()` throws.
|
|
1412
|
-
*/
|
|
1413
|
-
initialUpdate?: Uint8Array;
|
|
1414
|
-
}
|
|
1415
|
-
type UndoCaptureMode = 'auto' | 'manual';
|
|
1416
|
-
interface PresentationHandle extends CollaborationReplica {
|
|
1417
|
-
isProposalsAvailable(): boolean;
|
|
1418
|
-
propose(agentId: string, note: string | null, edits: readonly ProposalEdit[]): Proposal;
|
|
1419
|
-
listProposals(): Proposal[];
|
|
1420
|
-
previewProposal(id: string): ProposalPreview;
|
|
1421
|
-
layoutProposalSlide(id: string, slideIndex: number): SlideDisplayList;
|
|
1422
|
-
layoutProposalDiffSlide(id: string, slideIndex: number): ProposalDiffSlide;
|
|
1423
|
-
acceptProposal(id: string, options?: {
|
|
1424
|
-
force?: boolean;
|
|
1425
|
-
}): ProposalAcceptance;
|
|
1426
|
-
rejectProposal(id: string): boolean;
|
|
1427
|
-
readonly clientId: number;
|
|
1428
|
-
snapshot(): DeckSnapshot;
|
|
1429
|
-
story(storyId: string): StorySnapshot;
|
|
1430
|
-
/** Anchors the UTF-16 caret `index` of a story so later edits move it along. */
|
|
1431
|
-
anchorCaret(storyId: string, index: number): PptxCaretAnchor;
|
|
1432
|
-
/** The anchor's current offset, or `null` once its story is gone. */
|
|
1433
|
-
resolveCaretAnchor(anchor: PptxCaretAnchor): number | null;
|
|
1434
|
-
/**
|
|
1435
|
-
* The session-scoped version token. It changes with every committed change, local or remote,
|
|
1436
|
-
* undo and redo included; compare tokens only within this session.
|
|
1437
|
-
*/
|
|
1438
|
-
version(): string;
|
|
1439
|
-
/** Slides and their stories' text, with the version they were read at. */
|
|
1440
|
-
readContent(request?: PptxReadRequest): PptxReadResult;
|
|
1441
|
-
/** Exact, case-sensitive, paragraph-local search; overlapping matches count separately. */
|
|
1442
|
-
findText(request: PptxFindRequest): PptxFindResult;
|
|
1443
|
-
/**
|
|
1444
|
-
* Structured slide content with the version it was read at, read from committed state: pending
|
|
1445
|
-
* editor input is not flushed and nothing changes. Option refusals are returned; malformed
|
|
1446
|
-
* options throw.
|
|
1447
|
-
*/
|
|
1448
|
-
exportStructured(options?: PptxExportOptions): PptxExportResult<PptxStructuredContent>;
|
|
1449
|
-
/** `exportStructured` rendered as Markdown from the same read. */
|
|
1450
|
-
exportMarkdown(options?: PptxExportOptions): PptxExportResult<PptxMarkdownContent>;
|
|
1451
|
-
/** Runs every check of `applyEdits`, staging included, without changing anything. */
|
|
1452
|
-
validateEdits(request: PptxEditRequest): PptxValidationResult;
|
|
1453
|
-
/**
|
|
1454
|
-
* Applies every step or none against `expectVersion`, as one transaction, one update and, for
|
|
1455
|
-
* `history: 'separate'`, one undo step. Policy failures are returned; malformed requests throw.
|
|
1456
|
-
*/
|
|
1457
|
-
applyEdits(request: PptxEditRequest): PptxEditResult;
|
|
1458
|
-
/** Literal search in slide order. */
|
|
1459
|
-
searchText(query: string, options?: PptxTextSearchOptions): PptxTextMatch[];
|
|
1460
|
-
registerFont(face: PptxFontFace): number;
|
|
1461
|
-
/** Registers a face drawn only where a run's own face has no glyph. */
|
|
1462
|
-
registerFallbackFont(face: PptxFontFace): number;
|
|
1463
|
-
layoutSlide(slideIndex: number): SlideDisplayList;
|
|
1464
|
-
/** `layoutSlide` with scope, layout and serialize time measured inside the renderer. */
|
|
1465
|
-
layoutSlideProfiled(slideIndex: number): ProfiledLayout;
|
|
1466
|
-
hitTest(x: number, y: number): HitTestResult | null;
|
|
1467
|
-
mediaBytes(partPath: string): Uint8Array;
|
|
1468
|
-
/** serialize the presentation back to .pptx bytes, edits included. */
|
|
1469
|
-
save(): Uint8Array;
|
|
1470
|
-
insertText(storyId: string, index: number, text: string, style?: TextStyle): TextReceipt;
|
|
1471
|
-
/** `insertText` with the boundary's stage timings attached. */
|
|
1472
|
-
insertTextProfiled(storyId: string, index: number, text: string, style?: TextStyle): Profiled<TextReceipt>;
|
|
1473
|
-
deleteText(storyId: string, start: number, end: number): TextReceipt;
|
|
1474
|
-
deleteTextProfiled(storyId: string, start: number, end: number): Profiled<TextReceipt>;
|
|
1475
|
-
formatText(storyId: string, start: number, end: number, patch: TextStylePatch): TextReceipt;
|
|
1476
|
-
insertParagraphBreak(storyId: string, index: number): TextReceipt;
|
|
1477
|
-
/** Sets the alignment of every paragraph the range touches; `null` restores
|
|
1478
|
-
* the inherited value. */
|
|
1479
|
-
setParagraphAlignment(storyId: string, start: number, end: number, alignment: ParagraphAlignment | null): TextReceipt;
|
|
1480
|
-
insertSlide(index: number, layoutPartPath?: string): SlideReceipt;
|
|
1481
|
-
insertSlideProfiled(index: number, layoutPartPath?: string): Profiled<SlideReceipt>;
|
|
1482
|
-
deleteSlide(slideId: string): SlideReceipt;
|
|
1483
|
-
moveSlide(slideId: string, toIndex: number): SlideReceipt;
|
|
1484
|
-
/** Sets a slide's speaker notes; empty text clears them. */
|
|
1485
|
-
setSlideNotes(slideId: string, text: string): void;
|
|
1486
|
-
addTextBox(slideId: string, draft: ShapeDraft): ShapeReceipt;
|
|
1487
|
-
addTextBoxProfiled(slideId: string, draft: ShapeDraft): Profiled<ShapeReceipt>;
|
|
1488
|
-
addShape(slideId: string, draft: PresetShapeDraft): ShapeReceipt;
|
|
1489
|
-
addPicture(slideId: string, draft: PictureDraft): ShapeReceipt;
|
|
1490
|
-
setShapeFill(slideId: string, shapeId: string, color: string | null): ShapeFillReceipt;
|
|
1491
|
-
setShapeStroke(slideId: string, shapeId: string, stroke: ShapeStroke): ShapeStrokeReceipt;
|
|
1492
|
-
setShapeAdjust(slideId: string, shapeId: string, adjustments: Record<string, number>): ShapeAdjustReceipt;
|
|
1493
|
-
removeShape(slideId: string, shapeId: string): ShapeReceipt;
|
|
1494
|
-
/** Moves a shape to the top of its slide's paint order (drawn last). */
|
|
1495
|
-
bringShapeToFront(slideId: string, shapeId: string): ShapeZOrderReceipt;
|
|
1496
|
-
/** Moves a shape to the bottom of its slide's paint order (drawn first). */
|
|
1497
|
-
sendShapeToBack(slideId: string, shapeId: string): ShapeZOrderReceipt;
|
|
1498
|
-
/** Swaps a shape one step later in its slide's paint order. */
|
|
1499
|
-
bringShapeForward(slideId: string, shapeId: string): ShapeZOrderReceipt;
|
|
1500
|
-
/** Swaps a shape one step earlier in its slide's paint order. */
|
|
1501
|
-
sendShapeBackward(slideId: string, shapeId: string): ShapeZOrderReceipt;
|
|
1502
|
-
/** Adds a slide comment; coordinates are EMU. */
|
|
1503
|
-
addComment(slideId: string, comment: {
|
|
1504
|
-
author: string;
|
|
1505
|
-
initials?: string;
|
|
1506
|
-
text: string;
|
|
1507
|
-
created: string;
|
|
1508
|
-
xEmu?: number;
|
|
1509
|
-
yEmu?: number;
|
|
1510
|
-
}): CommentReceipt;
|
|
1511
|
-
/** Modern decks only; legacy `p:cm` has no reply list. */
|
|
1512
|
-
replyToComment(commentId: string, reply: {
|
|
1513
|
-
author: string;
|
|
1514
|
-
initials?: string;
|
|
1515
|
-
text: string;
|
|
1516
|
-
created: string;
|
|
1517
|
-
}): CommentReceipt;
|
|
1518
|
-
/** Resolves or reopens a modern comment. */
|
|
1519
|
-
setCommentStatus(commentId: string, resolved: boolean): CommentReceipt;
|
|
1520
|
-
/** Moves a root comment on its slide; coordinates are safe integer EMU. */
|
|
1521
|
-
setCommentPosition(commentId: string, position: {
|
|
1522
|
-
xEmu: number;
|
|
1523
|
-
yEmu: number;
|
|
1524
|
-
}): CommentReceipt;
|
|
1525
|
-
removeComment(commentId: string): CommentReceipt;
|
|
1526
|
-
/** Only legal while the deck has no comments. */
|
|
1527
|
-
setCommentFlavor(flavor: CommentFlavor): CommentFlavor;
|
|
1528
|
-
comments(): CommentSnapshot[];
|
|
1529
|
-
moveShape(slideId: string, shapeId: string, x: number, y: number): TransformReceipt;
|
|
1530
|
-
moveShapeProfiled(slideId: string, shapeId: string, x: number, y: number): Profiled<TransformReceipt>;
|
|
1531
|
-
resizeShape(slideId: string, shapeId: string, width: number, height: number): TransformReceipt;
|
|
1532
|
-
setShapeRect(slideId: string, shapeId: string, rect: ShapeRect): TransformReceipt;
|
|
1533
|
-
canUndo(): boolean;
|
|
1534
|
-
canRedo(): boolean;
|
|
1535
|
-
undoCaptureMode(): UndoCaptureMode;
|
|
1536
|
-
setUndoCaptureMode(mode: UndoCaptureMode): void;
|
|
1537
|
-
addUndoBoundary(): void;
|
|
1538
|
-
undo(): HistoryResult;
|
|
1539
|
-
/** `undo` with undo, snapshot and serialize time measured at the boundary. */
|
|
1540
|
-
undoProfiled(): Profiled<HistoryResult, HistoryProfile>;
|
|
1541
|
-
redo(): HistoryResult;
|
|
1542
|
-
encodeStateVector(): Uint8Array;
|
|
1543
|
-
encodeStateAsUpdate(remoteStateVector?: Uint8Array): Uint8Array;
|
|
1544
|
-
encodeDiff(remoteStateVector: Uint8Array): Uint8Array;
|
|
1545
|
-
applyUpdate(update: Uint8Array): DeckSnapshot;
|
|
1546
|
-
onUpdate(listener: (update: Uint8Array, origin: CollaborationUpdateOrigin) => void): () => void;
|
|
1547
|
-
dispose(): void;
|
|
1548
|
-
}
|
|
1549
|
-
declare function isProposalsAvailable(): boolean;
|
|
1550
|
-
declare function initWasm(input?: WasmInitInput): Promise<void>;
|
|
1551
|
-
declare function isWasmAvailable(): boolean;
|
|
1552
|
-
declare function wasmVersion(): string;
|
|
1553
|
-
declare function inspectPresentation(bytes: Uint8Array): unknown;
|
|
1554
|
-
/**
|
|
1555
|
-
* Exports PPTX bytes as structured content whose anchors address the returned snapshot. No
|
|
1556
|
-
* session, DOM or font is involved. Throws `PptxExportError` for refused options and an `Error`
|
|
1557
|
-
* for bytes that are not a readable PPTX.
|
|
1558
|
-
*/
|
|
1559
|
-
declare function exportPptxStructured(bytes: Uint8Array, options?: PptxExportOptions): Promise<PptxStructuredContent>;
|
|
1560
|
-
/** `exportPptxStructured` rendered as Markdown with anchor markers. */
|
|
1561
|
-
declare function exportPptxMarkdown(bytes: Uint8Array, options?: PptxExportOptions): Promise<PptxMarkdownContent>;
|
|
1562
|
-
/**
|
|
1563
|
-
* Renders structured content (schema version 1) as Markdown. Content the renderer cannot trust
|
|
1564
|
-
* refuses with `invalid-content`.
|
|
1565
|
-
*/
|
|
1566
|
-
declare function renderPptxMarkdown(content: PptxStructuredContent, options?: PptxMarkdownOptions): Promise<PptxMarkdownContent>;
|
|
1567
|
-
declare function openPresentation(bytes: Uint8Array, options?: OpenPresentationOptions): PresentationHandle;
|
|
1568
|
-
|
|
1569
|
-
export { type BlipEffect, type CanvasImageResolver, type CaretStop, CollaborationError, type CollaborationErrorCode, type CollaborationErrorListener, CollaborationProvider, type CollaborationProviderOptions, type CollaborationReplica, type CollaborationStatus, type CollaborationStatusChange, type CollaborationStatusListener, type CollaborationTransport, type CollaborationTransportEvent, type CollaborationUpdateOrigin, type CollaborationUser, type ColorValue, type CommentFlavor, type CommentReceipt, type CommentSnapshot, type DeckSnapshot, type EditProfile, type EditSuccess, type ExportCompletion, type ExportDiagnostic, type ExportSeverity, type GeometryPathCommand, type HistoryProfile, type HistoryResult, type HitTestResult, type ImageCrop, type ImageEffect, type ImagePrimitive, type InheritedGeometry, type LayoutProfile, type MarkdownAnchor, type OpenPresentationOptions, type OperationFailure, type OperationRefusal, PRESENCE_LABEL_DURATION_MS, type Paint, type PaintSlideOptions, type ParagraphAlignment, type ParagraphSnapshot, type PictureDraft, type PlaceholderPrimitive, type PositionedGlyph, type PositionedTextLine, type PositionedTextRun, type PptxAnchor, type PptxAnchorScope, type PptxCaretAnchor, type PptxEditFailure, type PptxEditFailureCode, type PptxEditHistory, type PptxEditPreview, type PptxEditReceipt, type PptxEditRefusal, type PptxEditRequest, type PptxEditResult, type PptxEditSource, type PptxEditStep, type PptxEditTarget, type PptxExportComment, type PptxExportDiagnostic, type PptxExportDiagnosticCode, PptxExportError, type PptxExportFailure, type PptxExportFailureCode, type PptxExportList, type PptxExportMark, type PptxExportNotes, type PptxExportObject, type PptxExportObjectKind, type PptxExportOptions, type PptxExportParagraph, type PptxExportRefusal, type PptxExportResult, type PptxExportRun, type PptxExportShape, type PptxExportShapeKind, type PptxExportSlide, type PptxExportStory, type PptxExportTable, type PptxExportTableCell, type PptxFindMatch, type PptxFindRequest, type PptxFindResult, type PptxFindScope, type PptxFontFace, type PptxMarkdownContent, type PptxMarkdownOptions, type PptxParagraphText, type PptxPresence, type PptxPresenceCursor, type PptxPresenceListener, type PptxPresencePeer, type PptxPresenceState, type PptxPresenceUser, type PptxReadRequest, type PptxReadResult, type PptxShapeTarget, type PptxSlideTarget, type PptxSourceProvenance, type PptxStoryTarget, type PptxStoryText, type PptxStructuredContent, type PptxTextField, type PptxTextGuard, type PptxTextMatch, type PptxTextRange, type PptxTextSearchOptions, type PptxTextSpan, type PptxTextTarget, type PptxValidationResult, type PresentationHandle, type PresetShapeDraft, type PrimitiveTransform, type Profiled, type ProfiledLayout, type Proposal, type ProposalAcceptance, type ProposalChange, type ProposalDiffSlide, type ProposalEdit, type ProposalPreview, type ProposalTextChange, type ShapeAdjustReceipt, type ShapeDraft, type ShapeFill, type ShapeFillReceipt, type ShapeGradient, type ShapeKind, type ShapeLineEnd, type ShapeOutline, type ShapePrimitive, type ShapeReceipt, type ShapeRect, type ShapeSnapshot, type ShapeStroke, type ShapeStrokeReceipt, type ShapeZOrderReceipt, type SlideCanvasLike, type SlideDisplayList, type SlidePrimitive, type SlideReceipt, type SlideSnapshot, type SlideToPngOptions, StaleProposalError, type StorySnapshot, type Stroke, type StrokeEnd, type TextBoxPrimitive, type TextReceipt, type TextRunSnapshot, type TextStyle, type TextStylePatch, type TextStyleSnapshot, type TransformReceipt, type UndoCaptureMode, type UpdateEvent, type ValidationSuccess, type WasmInitInput, decodePresentationImage, exportPptxMarkdown, exportPptxStructured, initWasm, inspectPresentation, isProposalsAvailable, isWasmAvailable, needsElementDecode, openPresentation, paintSlide, presenceColorForClientId, presentationImageBlob, renderPptxMarkdown, sizeCanvasForSlide, slideToPng, wasmVersion };
|
|
26
|
+
export { CanvasImageResolver, type PresentationImageDecodeOptions, SlideDisplayList, type SlideToPngOptions, decodePresentationImage, needsElementDecode, presentationImageBlob, slideToPng };
|