@pptx-editor.dev/editor-api 0.0.1-placeholder → 0.2.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.
@@ -0,0 +1,3401 @@
1
+ /*!
2
+ Copyright (c) 2026 Eigenpal, Inc. All rights reserved.
3
+ Licensed under the EigenPal Pro Evaluation License 1.0. See LICENSE.md in this package.
4
+ Production use requires a commercial agreement: licensing@eigenpal.com
5
+ */
6
+ import { AutomationHandle, AutomationRef, AutomationOperation, AutomationValue, AutomationItemKey, AutomationCellAddress, AutomationTextSpan, AutomationParagraphWrite, AutomationBackgroundWrite, AutomationBackgroundRead, AutomationCustomXmlPartRead, AutomationTableCellFormatRead, AutomationCellBorderSide, AutomationHost, AutomationCapabilities } from '@pptx-editor.dev/core/automation';
7
+ import { ImageRasterizer } from '@pptx-editor.dev/core/editor';
8
+ import { FontSource } from '@pptx-editor.dev/core/layout';
9
+
10
+ /**
11
+ * What went wrong, as a value a consumer may branch on.
12
+ *
13
+ * @public
14
+ */
15
+ type PptxEditorErrorCode =
16
+ /** A property was read before a `load(...)` for it completed in a `sync()`. */
17
+ 'PropertyNotLoaded'
18
+ /** A `ClientResult` value was read before the sync that fills it. */
19
+ | 'ValueNotLoaded'
20
+ /**
21
+ * The object cannot be addressed: its run ended and nothing tracked it, the call that would
22
+ * have created it was in a refused sync, or the presentation no longer holds it (an edit
23
+ * removed it). A lookup from a refused sync is sent again, so its proxy stays usable.
24
+ */
25
+ | 'InvalidObjectPath'
26
+ /** The object still belongs to a run that has not finished, so it cannot be handed over. */
27
+ | 'ObjectInUse'
28
+ /** An argument or load option this API does not accept. */
29
+ | 'InvalidArgument'
30
+ /** Opening the presentation exceeded a bounded reader limit. */
31
+ | 'ResourceLimitExceeded'
32
+ /** The collection has no such item: `getItem` with an unknown id, `getItemAt` out of range. */
33
+ | 'ItemNotFound'
34
+ /**
35
+ * The call is outside the supported subset for this host or content, and nothing changed.
36
+ * Examples: a server runtime has no selection; a shape has no text frame.
37
+ */
38
+ | 'NotSupported'
39
+ /** The member is one this API does not implement, and nothing changed. */
40
+ | 'NotImplemented'
41
+ /** The request context's `run` has finished, so it can no longer be used. */
42
+ | 'InvalidRequestContext'
43
+ /** The runtime was disposed. Every later operation fails this way. */
44
+ | 'RuntimeDisposed'
45
+ /**
46
+ * The batch was built from an older read, so nothing was applied: another writer changed the
47
+ * presentation after this context read it. Read again before retrying.
48
+ */
49
+ | 'StaleDocument'
50
+ /** The host is live but holds no presentation right now: an editor between documents. */
51
+ | 'DocumentUnavailable'
52
+ /** The presentation refused the change, or answered something this runtime cannot use. */
53
+ | 'GeneralException';
54
+ /** A public reason for a refusal: a stable code and a fixed hint. */
55
+ interface PptxEditorDiagnostic {
56
+ readonly code: string;
57
+ readonly hint: string;
58
+ }
59
+ /**
60
+ * The fields a {@link PptxEditorError} is constructed from.
61
+ *
62
+ * @public
63
+ */
64
+ interface PptxEditorErrorInit {
65
+ /** Which refusal this is. The stable thing to branch on. */
66
+ readonly code: PptxEditorErrorCode;
67
+ /** The consumer-facing path of the object or property involved, never a handle. */
68
+ readonly target?: string;
69
+ /** The revision the context had read at, for `StaleDocument`. */
70
+ readonly expectedRevision?: number;
71
+ /** The revision the presentation was actually at, for `StaleDocument`. */
72
+ readonly actualRevision?: number;
73
+ /** The public reason, when the engine gave one this API knows. */
74
+ readonly diagnostic?: PptxEditorDiagnostic;
75
+ /** The `context.trace` messages queued before the call that failed. */
76
+ readonly traceMessages?: readonly string[];
77
+ }
78
+ /**
79
+ * Why the engine refused, as a public diagnostic code with its fixed hint.
80
+ *
81
+ * @public
82
+ */
83
+ interface PptxEditorInnerError {
84
+ /** A stable public diagnostic code, such as `edit.stale-target`. */
85
+ readonly code: string;
86
+ /** The fixed hint for the code: the cause, then the action. Never presentation content. */
87
+ readonly message: string;
88
+ }
89
+ /**
90
+ * Debug details in the shape of Office.js `OfficeExtension.DebugInfo`.
91
+ *
92
+ * @public
93
+ */
94
+ interface PptxEditorDebugInfo {
95
+ /** The same code as {@link PptxEditorError.code}. */
96
+ readonly code: PptxEditorErrorCode;
97
+ /** The same message as the error's own. */
98
+ readonly message: string;
99
+ /** The consumer-facing path of the object or property involved, when there is one. */
100
+ readonly errorLocation?: string;
101
+ /** Why the engine refused, when it knows a specific reason. */
102
+ readonly innerError?: PptxEditorInnerError;
103
+ }
104
+ /**
105
+ * Every refusal this runtime throws.
106
+ *
107
+ * Branch on {@link PptxEditorError.code}, never on the message. Codes are stable public API.
108
+ * Nothing from the engine or the file appears in the message: a consumer gets a stable code, a
109
+ * fixed sentence, and `target`, the consumer-facing path they wrote themselves.
110
+ *
111
+ * @example
112
+ * ```ts
113
+ * try {
114
+ * await context.sync();
115
+ * } catch (error) {
116
+ * if (isPptxEditorError(error) && error.code === 'StaleDocument') {
117
+ * // Read again: another writer changed the presentation first.
118
+ * }
119
+ * }
120
+ * ```
121
+ *
122
+ * @public
123
+ */
124
+ declare class PptxEditorError extends Error {
125
+ /** Which refusal this is. Stable across versions; the thing to branch on. */
126
+ readonly code: PptxEditorErrorCode;
127
+ /** Consumer-facing path of the object or property involved, when there is one to name. */
128
+ readonly target?: string;
129
+ /** For `StaleDocument`: the revision the context had last read at. */
130
+ readonly expectedRevision?: number;
131
+ /** For `StaleDocument`: the revision the presentation was actually at. */
132
+ readonly actualRevision?: number;
133
+ /** Debug details, as Office.js `OfficeExtension.Error.debugInfo` has them. */
134
+ readonly debugInfo: PptxEditorDebugInfo;
135
+ /**
136
+ * The messages of `context.trace` calls queued before the call that failed, in order, as
137
+ * Office.js `OfficeExtension.Error.traceMessages`. Empty when the sync had none.
138
+ */
139
+ readonly traceMessages: readonly string[];
140
+ constructor(init: PptxEditorErrorInit);
141
+ }
142
+ /**
143
+ * Whether a caught value is one of ours. By `name` as well as by `instanceof`: a consumer can
144
+ * end up with two copies of this module, and `instanceof` fails across them.
145
+ *
146
+ * @public
147
+ */
148
+ declare function isPptxEditorError(value: unknown): value is PptxEditorError;
149
+
150
+ type ObjectPathState =
151
+ /** Promised: created by a queued action that has not answered yet. */
152
+ {
153
+ readonly status: 'pending';
154
+ }
155
+ /** Addressable: the host has named this object. */
156
+ | {
157
+ readonly status: 'resolved';
158
+ readonly handle: AutomationHandle;
159
+ }
160
+ /** A `get…OrNullObject` that found nothing. Not an error, and never addressable. */
161
+ | {
162
+ readonly status: 'null';
163
+ }
164
+ /** Its run ended without tracking it. Terminal. */
165
+ | {
166
+ readonly status: 'released';
167
+ };
168
+ /** The batch index of an action, while a batch is planned. */
169
+ type IndexOf = (producer: object) => number | undefined;
170
+ declare class ObjectPath {
171
+ #private;
172
+ readonly label: string;
173
+ private constructor();
174
+ /** A path that is addressable from the moment it exists: a root, or an item just hydrated. */
175
+ static of(label: string, handle: AutomationHandle): ObjectPath;
176
+ /** A path a queued action will fill in, or mark null. */
177
+ static pending(label: string): ObjectPath;
178
+ /**
179
+ * A pending path that the same queued action as this one settles, for an object that its
180
+ * answer names or finds absent. A call in the same batch waits for that read.
181
+ */
182
+ sibling(label: string): ObjectPath;
183
+ /** A path that is whatever its owner's path is, under its own name. */
184
+ static derived(label: string, parent: ObjectPath): ObjectPath;
185
+ get state(): ObjectPathState;
186
+ /** The path this one shares its fate with, followed to the end. */
187
+ get origin(): ObjectPath;
188
+ get isAddressable(): boolean;
189
+ get isPending(): boolean;
190
+ get isNull(): boolean;
191
+ get isReleased(): boolean;
192
+ /**
193
+ * Name the action whose answer resolves this path. `refable` is false when the answer is not
194
+ * the handle itself, so a call in the same batch waits for that read.
195
+ */
196
+ producedBy(action: object, refable?: boolean): void;
197
+ /**
198
+ * What to put in an operation: the handle, or the result reference of the producing action
199
+ * when it is in the batch being planned. Anything else refuses with `InvalidObjectPath`.
200
+ */
201
+ ref(indexOf: IndexOf): AutomationRef;
202
+ /** The handle, once resolved. */
203
+ handle(): AutomationHandle;
204
+ /** Hydration: the read answered, and this is the object it named. A released path stays so. */
205
+ resolveTo(handle: AutomationHandle): void;
206
+ /** Hydration: the read answered, and there was nothing there. */
207
+ resolveNull(): void;
208
+ /** The run ended and nothing kept this object alive. A derived path follows its owner. */
209
+ release(): void;
210
+ }
211
+
212
+ /** Whether an action reads or writes. Drives the conditional-revision rule in `sync()`. */
213
+ type ActionSort = 'read' | 'write';
214
+ interface QueuedAction {
215
+ readonly sort: ActionSort;
216
+ /** The consumer-facing name of what this action is for, for errors. Never a handle. */
217
+ readonly label: string;
218
+ /**
219
+ * The object the action is on. A read on an object that an earlier round of the same sync
220
+ * found null is dropped: a null object has nothing to read.
221
+ */
222
+ readonly target?: ObjectPath;
223
+ /**
224
+ * True for a listing whose answer queues more reads (`load('items/<name>')`). In a sync that
225
+ * writes, such a listing ahead of every write goes in an earlier round, with its item reads,
226
+ * so the writes stay last and atomic.
227
+ */
228
+ readonly continues?: boolean;
229
+ /**
230
+ * The host operation for this action, called once at dispatch. `indexOf` gives the batch
231
+ * index of a producing action, for result references. May throw `InvalidObjectPath`, which
232
+ * refuses the batch before anything is sent.
233
+ */
234
+ plan(indexOf: IndexOf): AutomationOperation;
235
+ /**
236
+ * A call whose argument this API refused. A sync that holds one refuses with it before it
237
+ * sends anything, so the whole batch applies nothing.
238
+ */
239
+ readonly refusal?: Error;
240
+ /** The host's answer for this action, in batch order. */
241
+ settle(value: AutomationValue): void;
242
+ }
243
+ declare class ActionQueue {
244
+ #private;
245
+ get size(): number;
246
+ /** The labels of the actions queued now, in order, for `context.debugInfo`. */
247
+ labels(): string[];
248
+ push(action: QueuedAction): void;
249
+ /**
250
+ * Run `work` while a sync settles an answer, and keep what it queued for that same sync. This
251
+ * is how `load('items/name')` reads each item: the items are known only once the listing has
252
+ * answered.
253
+ */
254
+ continuing(work: () => void): void;
255
+ /**
256
+ * Remember where the queue is now. The function returned drops what was queued since, so a
257
+ * `load(...)` that refuses part way leaves nothing behind.
258
+ */
259
+ checkpoint(): () => void;
260
+ /** Hand over the reads `continuing` kept, and forget them. */
261
+ takeContinuations(): readonly QueuedAction[];
262
+ /** Hand over everything queued and forget it. Never replayed. */
263
+ take(): readonly QueuedAction[];
264
+ /** Drop everything queued: what a finished run does with actions nobody synced. */
265
+ clear(): void;
266
+ }
267
+
268
+ /**
269
+ * The object form of `load(...)`: which properties, and how much of a collection.
270
+ *
271
+ * An unknown key, a non-integer `top`, a property name that is not an identifier, or a value of
272
+ * the wrong type is refused as `InvalidArgument` here, naming the option — a misspelled key is
273
+ * the difference between "load selected properties" and "load nothing", which would otherwise
274
+ * surface as a `PropertyNotLoaded` much later at a call that looks correct.
275
+ *
276
+ * @public
277
+ */
278
+ interface LoadQueryOptions {
279
+ /** Which properties to load, as names or paths such as `items/fill/type`. */
280
+ readonly select?: string | readonly string[];
281
+ /**
282
+ * Navigation properties to load with their default set, as names or paths such as
283
+ * `items/fill`. A path that `select` also names deeper loads only what `select` names.
284
+ */
285
+ readonly expand?: string | readonly string[];
286
+ /** For a collection: at most this many items. */
287
+ readonly top?: number;
288
+ /** For a collection: skip this many items first. */
289
+ readonly skip?: number;
290
+ }
291
+ /**
292
+ * The property-tree form of `load(...)`, as the Office.js `*LoadOptions` interfaces give it.
293
+ *
294
+ * `true` loads a property. An object loads a navigation property with the properties it names;
295
+ * an empty object loads its default set. `$all: true` loads every scalar property of that
296
+ * object. On a collection, the keys name properties of each item, and `$top` and `$skip` limit
297
+ * the items. `items` is accepted as a key too, so `{ shapes: { items: { name: true } } }` and
298
+ * `{ shapes: { name: true } }` load the same thing.
299
+ *
300
+ * @public
301
+ */
302
+ interface LoadPropertyOptions {
303
+ /** Load every scalar property of this object, or of each item of a collection. */
304
+ readonly $all?: boolean;
305
+ /** For a collection: at most this many items. */
306
+ readonly $top?: number;
307
+ /** For a collection: skip this many items first. */
308
+ readonly $skip?: number;
309
+ /** A property: `true` loads it, an object loads a navigation property with what it names. */
310
+ readonly [property: string]: boolean | number | LoadPropertyOptions | undefined;
311
+ }
312
+ /**
313
+ * Everything `load(...)` accepts: one property name or path, several, a
314
+ * {@link LoadQueryOptions} object, or a {@link LoadPropertyOptions} tree.
315
+ *
316
+ * @example
317
+ * ```ts
318
+ * shape.load('name');
319
+ * shape.load(['name', 'left', 'fill/foregroundColor']);
320
+ * slide.load('shapes/items/textFrame/textRange/text');
321
+ * slide.load({ shapes: { items: { name: true, fill: { type: true } } } });
322
+ * shapes.load({ select: 'items/name', top: 5 });
323
+ * shapes.load('$all');
324
+ * ```
325
+ *
326
+ * A path names a property through navigation properties, for example `fill/type` on a shape.
327
+ * On a collection, `items/<path>` loads `items` and that path on each item in the same
328
+ * `context.sync()`. A path without the `items/` prefix means the same thing on a collection, so
329
+ * `shapes.load('name')` equals `shapes.load('items/name')`. `$all` loads every scalar property
330
+ * of the object it ends on, and `items/$all` of each item. `load()` and `load('items')` on a
331
+ * collection load every scalar property of each item, in one more round trip.
332
+ *
333
+ * A name that is not a property of the object it reaches is refused as `InvalidArgument`, with
334
+ * the object and the name as the error's `target`.
335
+ *
336
+ * @public
337
+ */
338
+ type LoadOption = string | readonly string[] | LoadQueryOptions | LoadPropertyOptions;
339
+ interface ResolvedLoadOptions {
340
+ /** Selected scalar or navigation property names of this object, without `$all`. */
341
+ readonly select: readonly string[];
342
+ /** True when `$all` was named: load every scalar property as well as `select`. */
343
+ readonly all: boolean;
344
+ /** Navigation properties named with a deeper path, each with the request for that object. */
345
+ readonly nested: ReadonlyMap<string, ResolvedLoadOptions>;
346
+ /**
347
+ * The request for each item of a collection, from `items/<path>` paths or an `items` key.
348
+ * An object that is not a collection refuses it.
349
+ */
350
+ readonly items?: ResolvedLoadOptions;
351
+ /** The property names that `items` selects. Empty when none was named. */
352
+ readonly itemSelect: readonly string[];
353
+ readonly top?: number;
354
+ readonly skip?: number;
355
+ /**
356
+ * Set on the request for each item of a collection and on everything below it: a text read of
357
+ * an item that cannot hold text (a picture, a group) fills nothing instead of failing the sync.
358
+ */
359
+ readonly orNull?: boolean;
360
+ }
361
+
362
+ /** Turns a path into what an operation names: a handle or a result reference. */
363
+ type RefOf = (path: ObjectPath) => AutomationRef;
364
+ /** Navigation properties a load may name: loading one loads that object. */
365
+ type Navigation = Readonly<Record<string, () => ClientObject>>;
366
+ declare abstract class ModelObject extends ClientObject {
367
+ /**
368
+ * The scalar properties a load asked for. An empty selection means every scalar property. A
369
+ * navigation property name loads that object instead. Any other name is `InvalidArgument`.
370
+ */
371
+ protected selection(request: ResolvedLoadOptions, available: readonly string[], navigation?: Navigation): readonly string[];
372
+ /**
373
+ * Queue one read whose answer of `kind` fills `names` through `project`. A null answer (the
374
+ * object turned out not to exist in this batch) fills nothing.
375
+ */
376
+ protected loadScalars<K extends AutomationValue['kind']>(names: readonly string[], kind: K, plan: (ref: RefOf) => AutomationOperation, project: (value: Extract<AutomationValue, {
377
+ kind: K;
378
+ }>) => Readonly<Record<string, unknown>>): void;
379
+ /** @internal The consumer-facing path of a member, for the `target` of a refusal. */
380
+ protected at(name: string): string;
381
+ /** Queue a command that answers `applied`. Nothing is written until `sync()`. */
382
+ protected command(name: string, plan: (ref: RefOf) => AutomationOperation): void;
383
+ /**
384
+ * A navigation object (`slide.layout`, `shape.parentGroup`) over a pending path, with the read
385
+ * that answers its handle queued now. A call on it in the same sync names that read's answer.
386
+ */
387
+ protected navigation<T>(name: string, make: (path: ObjectPath) => T, plan: (ref: RefOf) => AutomationOperation, nullable?: boolean): T;
388
+ /** @internal */
389
+ protected onLoad(request: ResolvedLoadOptions): void;
390
+ }
391
+
392
+ /**
393
+ * The application the presentation is open in. It has no properties or methods.
394
+ *
395
+ * @public
396
+ */
397
+ declare class Application extends ModelObject {
398
+ /** @internal */
399
+ private constructor();
400
+ /** @internal The application of a request context. It addresses nothing in the host. */
401
+ static open(context: RequestContext): Application;
402
+ /** @internal There is nothing to load. */
403
+ protected onLoad(request: ResolvedLoadOptions): void;
404
+ }
405
+
406
+ /**
407
+ * A value a queued method promised to produce, readable after the next `sync()`.
408
+ *
409
+ * Not a `Promise`: a method call inside a batch has not been sent yet, so there is nothing that
410
+ * could resolve on its own. Reading one early is `ValueNotLoaded`.
411
+ *
412
+ * @example
413
+ * ```ts
414
+ * const count = context.presentation.slides.getCount();
415
+ * await context.sync();
416
+ * console.log(count.value);
417
+ * ```
418
+ *
419
+ * @public
420
+ */
421
+ declare class ClientResult<T> {
422
+ #private;
423
+ private constructor();
424
+ /** The value, once a `sync()` has filled it in. */
425
+ get value(): T;
426
+ /** Whether the sync that fills this has happened. */
427
+ get isLoaded(): boolean;
428
+ /** @internal The box and the way to fill it, so only the creator can settle it. */
429
+ static create<T>(target: string): {
430
+ result: ClientResult<T>;
431
+ fill: (value: T) => void;
432
+ };
433
+ }
434
+
435
+ /** @public */
436
+ declare enum ShapeType {
437
+ unsupported = "Unsupported",
438
+ image = "Image",
439
+ geometricShape = "GeometricShape",
440
+ group = "Group",
441
+ line = "Line",
442
+ table = "Table",
443
+ callout = "Callout",
444
+ chart = "Chart",
445
+ contentApp = "ContentApp",
446
+ diagram = "Diagram",
447
+ freeform = "Freeform",
448
+ graphic = "Graphic",
449
+ ink = "Ink",
450
+ media = "Media",
451
+ model3D = "Model3D",
452
+ ole = "Ole",
453
+ placeholder = "Placeholder",
454
+ textBox = "TextBox"
455
+ }
456
+ /** @public */
457
+ declare enum BindingType {
458
+ shape = "Shape"
459
+ }
460
+ /** @public */
461
+ declare enum ConnectorType {
462
+ straight = "Straight",
463
+ elbow = "Elbow",
464
+ curve = "Curve"
465
+ }
466
+ /** @public */
467
+ declare enum HyperlinkType {
468
+ textRange = "TextRange",
469
+ shape = "Shape"
470
+ }
471
+ /** @public */
472
+ declare enum ShapeZOrder {
473
+ bringForward = "BringForward",
474
+ bringToFront = "BringToFront",
475
+ sendBackward = "SendBackward",
476
+ sendToBack = "SendToBack"
477
+ }
478
+ /** @public */
479
+ declare enum ShapeFillType {
480
+ noFill = "NoFill",
481
+ solid = "Solid",
482
+ gradient = "Gradient",
483
+ pattern = "Pattern",
484
+ pictureAndTexture = "PictureAndTexture",
485
+ slideBackground = "SlideBackground"
486
+ }
487
+ /** @public */
488
+ declare enum ShapeLineDashStyle {
489
+ dash = "Dash",
490
+ dashDot = "DashDot",
491
+ dashDotDot = "DashDotDot",
492
+ longDash = "LongDash",
493
+ longDashDot = "LongDashDot",
494
+ roundDot = "RoundDot",
495
+ solid = "Solid",
496
+ squareDot = "SquareDot",
497
+ longDashDotDot = "LongDashDotDot",
498
+ systemDash = "SystemDash",
499
+ systemDot = "SystemDot",
500
+ systemDashDot = "SystemDashDot"
501
+ }
502
+ /** @public */
503
+ declare enum ShapeLineStyle {
504
+ single = "Single",
505
+ thickBetweenThin = "ThickBetweenThin",
506
+ thickThin = "ThickThin",
507
+ thinThick = "ThinThick",
508
+ thinThin = "ThinThin"
509
+ }
510
+ /** @public */
511
+ declare enum ShapeAutoSize {
512
+ autoSizeNone = "AutoSizeNone",
513
+ autoSizeTextToFitShape = "AutoSizeTextToFitShape",
514
+ autoSizeShapeToFitText = "AutoSizeShapeToFitText",
515
+ autoSizeMixed = "AutoSizeMixed"
516
+ }
517
+ /** @public */
518
+ declare enum TextVerticalAlignment {
519
+ top = "Top",
520
+ middle = "Middle",
521
+ bottom = "Bottom",
522
+ topCentered = "TopCentered",
523
+ middleCentered = "MiddleCentered",
524
+ bottomCentered = "BottomCentered"
525
+ }
526
+ /** @public */
527
+ declare enum ParagraphHorizontalAlignment {
528
+ left = "Left",
529
+ center = "Center",
530
+ right = "Right",
531
+ justify = "Justify",
532
+ justifyLow = "JustifyLow",
533
+ distributed = "Distributed",
534
+ thaiDistributed = "ThaiDistributed"
535
+ }
536
+ /** @public */
537
+ declare enum ShapeFontUnderlineStyle {
538
+ none = "None",
539
+ single = "Single",
540
+ double = "Double",
541
+ heavy = "Heavy",
542
+ dotted = "Dotted",
543
+ dottedHeavy = "DottedHeavy",
544
+ dash = "Dash",
545
+ dashHeavy = "DashHeavy",
546
+ dashLong = "DashLong",
547
+ dashLongHeavy = "DashLongHeavy",
548
+ dotDash = "DotDash",
549
+ dotDashHeavy = "DotDashHeavy",
550
+ dotDotDash = "DotDotDash",
551
+ dotDotDashHeavy = "DotDotDashHeavy",
552
+ wavy = "Wavy",
553
+ wavyHeavy = "WavyHeavy",
554
+ wavyDouble = "WavyDouble"
555
+ }
556
+ /** @public */
557
+ declare enum PlaceholderType {
558
+ unsupported = "Unsupported",
559
+ date = "Date",
560
+ slideNumber = "SlideNumber",
561
+ footer = "Footer",
562
+ header = "Header",
563
+ title = "Title",
564
+ body = "Body",
565
+ centerTitle = "CenterTitle",
566
+ subtitle = "Subtitle",
567
+ verticalTitle = "VerticalTitle",
568
+ verticalBody = "VerticalBody",
569
+ content = "Content",
570
+ chart = "Chart",
571
+ table = "Table",
572
+ onlinePicture = "OnlinePicture",
573
+ media = "Media",
574
+ verticalContent = "VerticalContent",
575
+ picture = "Picture",
576
+ cameo = "Cameo"
577
+ }
578
+ /** @public */
579
+ declare enum SlideLayoutType {
580
+ blank = "Blank",
581
+ chart = "Chart",
582
+ chartAndText = "ChartAndText",
583
+ clipArtAndText = "ClipArtAndText",
584
+ clipArtAndVerticalText = "ClipArtAndVerticalText",
585
+ comparison = "Comparison",
586
+ contentWithCaption = "ContentWithCaption",
587
+ custom = "Custom",
588
+ fourObjects = "FourObjects",
589
+ largeObject = "LargeObject",
590
+ mediaClipAndText = "MediaClipAndText",
591
+ mixed = "Mixed",
592
+ object = "Object",
593
+ objectAndText = "ObjectAndText",
594
+ objectAndTwoObjects = "ObjectAndTwoObjects",
595
+ objectOverText = "ObjectOverText",
596
+ organizationChart = "OrganizationChart",
597
+ pictureWithCaption = "PictureWithCaption",
598
+ sectionHeader = "SectionHeader",
599
+ table = "Table",
600
+ text = "Text",
601
+ textAndChart = "TextAndChart",
602
+ textAndClipArt = "TextAndClipArt",
603
+ textAndMediaClip = "TextAndMediaClip",
604
+ textAndObject = "TextAndObject",
605
+ textAndTwoObjects = "TextAndTwoObjects",
606
+ textOverObject = "TextOverObject",
607
+ title = "Title",
608
+ titleOnly = "TitleOnly",
609
+ twoColumnText = "TwoColumnText",
610
+ twoObjects = "TwoObjects",
611
+ twoObjectsAndObject = "TwoObjectsAndObject",
612
+ twoObjectsAndText = "TwoObjectsAndText",
613
+ twoObjectsOverText = "TwoObjectsOverText",
614
+ verticalText = "VerticalText",
615
+ verticalTitleAndText = "VerticalTitleAndText",
616
+ verticalTitleAndTextOverChart = "VerticalTitleAndTextOverChart"
617
+ }
618
+ /** @public */
619
+ declare enum BulletType {
620
+ unsupported = "Unsupported",
621
+ none = "None",
622
+ numbered = "Numbered",
623
+ unnumbered = "Unnumbered"
624
+ }
625
+ /** @public */
626
+ declare enum BulletStyle {
627
+ unsupported = "Unsupported",
628
+ alphabetLowercaseParenthesesBoth = "AlphabetLowercaseParenthesesBoth",
629
+ alphabetUppercaseParenthesesBoth = "AlphabetUppercaseParenthesesBoth",
630
+ alphabetLowercaseParenthesisRight = "AlphabetLowercaseParenthesisRight",
631
+ alphabetUppercaseParenthesisRight = "AlphabetUppercaseParenthesisRight",
632
+ alphabetLowercasePeriod = "AlphabetLowercasePeriod",
633
+ alphabetUppercasePeriod = "AlphabetUppercasePeriod",
634
+ arabicNumeralParenthesesBoth = "ArabicNumeralParenthesesBoth",
635
+ arabicNumeralParenthesisRight = "ArabicNumeralParenthesisRight",
636
+ arabicNumeralPeriod = "ArabicNumeralPeriod",
637
+ arabicNumeralPlain = "ArabicNumeralPlain",
638
+ romanLowercaseParenthesesBoth = "RomanLowercaseParenthesesBoth",
639
+ romanUppercaseParenthesesBoth = "RomanUppercaseParenthesesBoth",
640
+ romanLowercaseParenthesisRight = "RomanLowercaseParenthesisRight",
641
+ romanUppercaseParenthesisRight = "RomanUppercaseParenthesisRight",
642
+ romanLowercasePeriod = "RomanLowercasePeriod",
643
+ romanUppercasePeriod = "RomanUppercasePeriod",
644
+ circleNumberDoubleBytePlain = "CircleNumberDoubleBytePlain",
645
+ circleNumberWideDoubleByteBlackPlain = "CircleNumberWideDoubleByteBlackPlain",
646
+ circleNumberWideDoubleByteWhitePlain = "CircleNumberWideDoubleByteWhitePlain",
647
+ arabicDoubleBytePeriod = "ArabicDoubleBytePeriod",
648
+ arabicDoubleBytePlain = "ArabicDoubleBytePlain",
649
+ simplifiedChinesePeriod = "SimplifiedChinesePeriod",
650
+ simplifiedChinesePlain = "SimplifiedChinesePlain",
651
+ traditionalChinesePeriod = "TraditionalChinesePeriod",
652
+ traditionalChinesePlain = "TraditionalChinesePlain",
653
+ kanjiSimplifiedChineseDoubleBytePeriod = "KanjiSimplifiedChineseDoubleBytePeriod",
654
+ kanjiKoreanPlain = "KanjiKoreanPlain",
655
+ kanjiKoreanPeriod = "KanjiKoreanPeriod",
656
+ arabicAlphabetDash = "ArabicAlphabetDash",
657
+ arabicAbjadDash = "ArabicAbjadDash",
658
+ hebrewAlphabetDash = "HebrewAlphabetDash",
659
+ thaiAlphabetPeriod = "ThaiAlphabetPeriod",
660
+ thaiAlphabetParenthesisRight = "ThaiAlphabetParenthesisRight",
661
+ thaiAlphabetParenthesesBoth = "ThaiAlphabetParenthesesBoth",
662
+ thaiNumeralPeriod = "ThaiNumeralPeriod",
663
+ thaiNumeralParenthesisRight = "ThaiNumeralParenthesisRight",
664
+ thaiNumeralParenthesesBoth = "ThaiNumeralParenthesesBoth",
665
+ hindiAlphabetPeriod = "HindiAlphabetPeriod",
666
+ hindiNumeralPeriod = "HindiNumeralPeriod",
667
+ hindiNumeralParenthesisRight = "HindiNumeralParenthesisRight",
668
+ hindiAlphabet1Period = "HindiAlphabet1Period"
669
+ }
670
+ /** @public */
671
+ declare enum SlideBackgroundFillType {
672
+ gradient = "Gradient",
673
+ pattern = "Pattern",
674
+ pictureOrTexture = "PictureOrTexture",
675
+ solid = "Solid",
676
+ unsupported = "Unsupported"
677
+ }
678
+ /** @public */
679
+ declare enum SlideBackgroundGradientFillType {
680
+ linear = "Linear",
681
+ path = "Path",
682
+ radial = "Radial",
683
+ rectangular = "Rectangular",
684
+ shadeFromTitle = "ShadeFromTitle",
685
+ unsupported = "Unsupported"
686
+ }
687
+ /** @public */
688
+ declare enum SlideBackgroundPatternFillType {
689
+ cross = "Cross",
690
+ darkDownwardDiagonal = "DarkDownwardDiagonal",
691
+ darkHorizontal = "DarkHorizontal",
692
+ darkUpwardDiagonal = "DarkUpwardDiagonal",
693
+ darkVertical = "DarkVertical",
694
+ dashedDownwardDiagonal = "DashedDownwardDiagonal",
695
+ dashedHorizontal = "DashedHorizontal",
696
+ dashedUpwardDiagonal = "DashedUpwardDiagonal",
697
+ dashedVertical = "DashedVertical",
698
+ diagonalBrick = "DiagonalBrick",
699
+ diagonalCross = "DiagonalCross",
700
+ divot = "Divot",
701
+ dottedDiamond = "DottedDiamond",
702
+ dottedGrid = "DottedGrid",
703
+ downwardDiagonal = "DownwardDiagonal",
704
+ horizontal = "Horizontal",
705
+ horizontalBrick = "HorizontalBrick",
706
+ largeCheckerBoard = "LargeCheckerBoard",
707
+ largeConfetti = "LargeConfetti",
708
+ largeGrid = "LargeGrid",
709
+ lightDownwardDiagonal = "LightDownwardDiagonal",
710
+ lightHorizontal = "LightHorizontal",
711
+ lightUpwardDiagonal = "LightUpwardDiagonal",
712
+ lightVertical = "LightVertical",
713
+ narrowHorizontal = "NarrowHorizontal",
714
+ narrowVertical = "NarrowVertical",
715
+ outlinedDiamond = "OutlinedDiamond",
716
+ percent10 = "Percent10",
717
+ percent20 = "Percent20",
718
+ percent25 = "Percent25",
719
+ percent30 = "Percent30",
720
+ percent40 = "Percent40",
721
+ percent5 = "Percent5",
722
+ percent50 = "Percent50",
723
+ percent60 = "Percent60",
724
+ percent70 = "Percent70",
725
+ percent75 = "Percent75",
726
+ percent80 = "Percent80",
727
+ percent90 = "Percent90",
728
+ plaid = "Plaid",
729
+ shingle = "Shingle",
730
+ smallCheckerBoard = "SmallCheckerBoard",
731
+ smallConfetti = "SmallConfetti",
732
+ smallGrid = "SmallGrid",
733
+ solidDiamond = "SolidDiamond",
734
+ sphere = "Sphere",
735
+ trellis = "Trellis",
736
+ unsupported = "Unsupported",
737
+ upwardDiagonal = "UpwardDiagonal",
738
+ vertical = "Vertical",
739
+ wave = "Wave",
740
+ weave = "Weave",
741
+ wideDownwardDiagonal = "WideDownwardDiagonal",
742
+ wideUpwardDiagonal = "WideUpwardDiagonal",
743
+ zigZag = "ZigZag"
744
+ }
745
+ /** @public */
746
+ declare enum ThemeColor {
747
+ accent1 = "Accent1",
748
+ accent2 = "Accent2",
749
+ accent3 = "Accent3",
750
+ accent4 = "Accent4",
751
+ accent5 = "Accent5",
752
+ accent6 = "Accent6",
753
+ dark1 = "Dark1",
754
+ dark2 = "Dark2",
755
+ followedHyperlink = "FollowedHyperlink",
756
+ hyperlink = "Hyperlink",
757
+ light1 = "Light1",
758
+ light2 = "Light2",
759
+ mixed = "Mixed",
760
+ none = "None"
761
+ }
762
+ /** @public */
763
+ declare enum TableStyle {
764
+ darkStyle1 = "DarkStyle1",
765
+ darkStyle1Accent1 = "DarkStyle1Accent1",
766
+ darkStyle1Accent2 = "DarkStyle1Accent2",
767
+ darkStyle1Accent3 = "DarkStyle1Accent3",
768
+ darkStyle1Accent4 = "DarkStyle1Accent4",
769
+ darkStyle1Accent5 = "DarkStyle1Accent5",
770
+ darkStyle1Accent6 = "DarkStyle1Accent6",
771
+ darkStyle2 = "DarkStyle2",
772
+ darkStyle2Accent1 = "DarkStyle2Accent1",
773
+ darkStyle2Accent2 = "DarkStyle2Accent2",
774
+ darkStyle2Accent3 = "DarkStyle2Accent3",
775
+ lightStyle1 = "LightStyle1",
776
+ lightStyle1Accent1 = "LightStyle1Accent1",
777
+ lightStyle1Accent2 = "LightStyle1Accent2",
778
+ lightStyle1Accent3 = "LightStyle1Accent3",
779
+ lightStyle1Accent4 = "LightStyle1Accent4",
780
+ lightStyle1Accent5 = "LightStyle1Accent5",
781
+ lightStyle1Accent6 = "LightStyle1Accent6",
782
+ lightStyle2 = "LightStyle2",
783
+ lightStyle2Accent1 = "LightStyle2Accent1",
784
+ lightStyle2Accent2 = "LightStyle2Accent2",
785
+ lightStyle2Accent3 = "LightStyle2Accent3",
786
+ lightStyle2Accent4 = "LightStyle2Accent4",
787
+ lightStyle2Accent5 = "LightStyle2Accent5",
788
+ lightStyle2Accent6 = "LightStyle2Accent6",
789
+ lightStyle3 = "LightStyle3",
790
+ lightStyle3Accent1 = "LightStyle3Accent1",
791
+ lightStyle3Accent2 = "LightStyle3Accent2",
792
+ lightStyle3Accent3 = "LightStyle3Accent3",
793
+ lightStyle3Accent4 = "LightStyle3Accent4",
794
+ lightStyle3Accent5 = "LightStyle3Accent5",
795
+ lightStyle3Accent6 = "LightStyle3Accent6",
796
+ mediumStyle1 = "MediumStyle1",
797
+ mediumStyle1Accent1 = "MediumStyle1Accent1",
798
+ mediumStyle1Accent2 = "MediumStyle1Accent2",
799
+ mediumStyle1Accent3 = "MediumStyle1Accent3",
800
+ mediumStyle1Accent4 = "MediumStyle1Accent4",
801
+ mediumStyle1Accent5 = "MediumStyle1Accent5",
802
+ mediumStyle1Accent6 = "MediumStyle1Accent6",
803
+ mediumStyle2 = "MediumStyle2",
804
+ mediumStyle2Accent1 = "MediumStyle2Accent1",
805
+ mediumStyle2Accent2 = "MediumStyle2Accent2",
806
+ mediumStyle2Accent3 = "MediumStyle2Accent3",
807
+ mediumStyle2Accent4 = "MediumStyle2Accent4",
808
+ mediumStyle2Accent5 = "MediumStyle2Accent5",
809
+ mediumStyle2Accent6 = "MediumStyle2Accent6",
810
+ mediumStyle3 = "MediumStyle3",
811
+ mediumStyle3Accent1 = "MediumStyle3Accent1",
812
+ mediumStyle3Accent2 = "MediumStyle3Accent2",
813
+ mediumStyle3Accent3 = "MediumStyle3Accent3",
814
+ mediumStyle3Accent4 = "MediumStyle3Accent4",
815
+ mediumStyle3Accent5 = "MediumStyle3Accent5",
816
+ mediumStyle3Accent6 = "MediumStyle3Accent6",
817
+ mediumStyle4 = "MediumStyle4",
818
+ mediumStyle4Accent1 = "MediumStyle4Accent1",
819
+ mediumStyle4Accent2 = "MediumStyle4Accent2",
820
+ mediumStyle4Accent3 = "MediumStyle4Accent3",
821
+ mediumStyle4Accent4 = "MediumStyle4Accent4",
822
+ mediumStyle4Accent5 = "MediumStyle4Accent5",
823
+ mediumStyle4Accent6 = "MediumStyle4Accent6",
824
+ noStyleNoGrid = "NoStyleNoGrid",
825
+ noStyleTableGrid = "NoStyleTableGrid",
826
+ themedStyle1Accent1 = "ThemedStyle1Accent1",
827
+ themedStyle1Accent2 = "ThemedStyle1Accent2",
828
+ themedStyle1Accent3 = "ThemedStyle1Accent3",
829
+ themedStyle1Accent4 = "ThemedStyle1Accent4",
830
+ themedStyle1Accent5 = "ThemedStyle1Accent5",
831
+ themedStyle1Accent6 = "ThemedStyle1Accent6",
832
+ themedStyle2Accent1 = "ThemedStyle2Accent1",
833
+ themedStyle2Accent2 = "ThemedStyle2Accent2",
834
+ themedStyle2Accent3 = "ThemedStyle2Accent3",
835
+ themedStyle2Accent4 = "ThemedStyle2Accent4",
836
+ themedStyle2Accent5 = "ThemedStyle2Accent5",
837
+ themedStyle2Accent6 = "ThemedStyle2Accent6"
838
+ }
839
+ /** @public */
840
+ declare enum InsertSlideFormatting {
841
+ keepSourceFormatting = "KeepSourceFormatting",
842
+ useDestinationTheme = "UseDestinationTheme"
843
+ }
844
+ /** The format of a shape picture from `Shape.getImageAsBase64`. @public */
845
+ declare enum ShapeGetImageFormatType {
846
+ png = "Png"
847
+ }
848
+ /** The type of a custom document property value. @public */
849
+ declare enum DocumentPropertyType {
850
+ boolean = "Boolean",
851
+ date = "Date",
852
+ number = "Number",
853
+ string = "String"
854
+ }
855
+
856
+ /**
857
+ * The adjust values of a shape's preset geometry: the handles that change, for example, the
858
+ * corner radius of a rounded rectangle. A length is a fraction of the shape size (0.5 is half);
859
+ * an angle is in degrees. A write is bounded to the range of the preset's adjust handle.
860
+ *
861
+ * A shape with no preset geometry (a freeform, a group, a table) refuses with `NotSupported`.
862
+ *
863
+ * @public
864
+ */
865
+ declare class Adjustments extends ModelObject {
866
+ #private;
867
+ /** @internal */
868
+ constructor(context: RequestContext, path: ObjectPath, shape: ObjectPath);
869
+ /** The number of adjust values that the preset defines. */
870
+ get count(): number;
871
+ /** The adjust value at a zero-based index, after the next `sync()`. */
872
+ get(index: number): ClientResult<number>;
873
+ /** Set the adjust value at a zero-based index. */
874
+ set(index: number, value: number): void;
875
+ /** @internal */
876
+ protected onLoad(request: ResolvedLoadOptions): void;
877
+ }
878
+
879
+ declare abstract class ItemCollection<T extends ClientObject> extends ModelObject {
880
+ #private;
881
+ /** @internal The read that lists this collection's members. */
882
+ protected abstract listing(ref: RefOf): AutomationOperation;
883
+ /** @internal The proxy for a member the host named. */
884
+ protected abstract itemOf(path: ObjectPath, nullable: boolean): T;
885
+ /** @internal The members a listing answered. */
886
+ protected handlesOf(value: AutomationValue, label: string): readonly AutomationHandle[];
887
+ /**
888
+ * @internal The read that finds one member, or undefined when the host has no lookup for this
889
+ * collection: an index then picks from the listing, and an id is `NotImplemented`.
890
+ */
891
+ protected abstract lookup(ref: RefOf, key: AutomationItemKey, orNull: boolean): AutomationOperation | undefined;
892
+ /** The loaded members. */
893
+ get items(): T[];
894
+ /** @internal */
895
+ protected get loadsItemPaths(): boolean;
896
+ /** @internal */
897
+ protected onLoad(request: ResolvedLoadOptions): void;
898
+ /** @internal The path of a member the host named. */
899
+ protected memberPath(handle: AutomationHandle, index: number): ObjectPath;
900
+ /** The number of members, after the next `sync()`. */
901
+ getCount(): ClientResult<number>;
902
+ /** @internal A member by key, as a proxy over the lookup queued now. */
903
+ protected find(key: AutomationItemKey, name: string, orNull: boolean): T;
904
+ /** @internal Whether `lookup` answers for this collection. */
905
+ protected get hasLookup(): boolean;
906
+ /** @internal Check an index argument. */
907
+ protected indexArg(index: unknown): number;
908
+ /** @internal Check a key argument. */
909
+ protected keyArg(key: unknown, name: string): string;
910
+ }
911
+
912
+ /** What a fill belongs to: a shape, or one cell of a table shape (`a:tcPr`). */
913
+ type FillTarget = {
914
+ readonly kind: 'shape';
915
+ readonly shape: ObjectPath;
916
+ } | {
917
+ readonly kind: 'cell';
918
+ readonly shape: ObjectPath;
919
+ readonly cell: AutomationCellAddress;
920
+ };
921
+ /**
922
+ * The fill of a shape.
923
+ *
924
+ * @public
925
+ */
926
+ declare class ShapeFill extends ModelObject {
927
+ #private;
928
+ /** @internal */
929
+ constructor(context: RequestContext, path: ObjectPath, target: FillTarget);
930
+ /** The solid fill color as `#RRGGBB`, or an empty string for any other fill. */
931
+ get foregroundColor(): string;
932
+ set foregroundColor(value: string);
933
+ /** The transparency of a solid fill, from 0 (opaque) to 1 (clear). */
934
+ get transparency(): number;
935
+ set transparency(value: number);
936
+ /** The kind of fill. */
937
+ get type(): ShapeFillType | `${ShapeFillType}`;
938
+ /** Remove the fill (`a:noFill`). */
939
+ clear(): void;
940
+ /** Fill with a solid color, `#RRGGBB` or a preset color name. */
941
+ setSolidColor(color: string): void;
942
+ /**
943
+ * Fill with a picture, stretched (`a:blipFill`): PNG, JPEG, or GIF bytes in base64. A table
944
+ * cell refuses a picture fill with `InvalidArgument`.
945
+ */
946
+ setImage(base64EncodedImage: string): void;
947
+ /** @internal */
948
+ protected onLoad(request: ResolvedLoadOptions): void;
949
+ }
950
+ /**
951
+ * The outline of a shape, or a line.
952
+ *
953
+ * @public
954
+ */
955
+ declare class ShapeLineFormat extends ModelObject {
956
+ #private;
957
+ /** @internal */
958
+ constructor(context: RequestContext, path: ObjectPath, shape: ObjectPath);
959
+ /** The line color as `#RRGGBB`, or an empty string when it has none. */
960
+ get color(): string;
961
+ set color(value: string);
962
+ /** The dash style. */
963
+ get dashStyle(): ShapeLineDashStyle | `${ShapeLineDashStyle}`;
964
+ set dashStyle(value: ShapeLineDashStyle | `${ShapeLineDashStyle}`);
965
+ /** The compound line style. */
966
+ get style(): ShapeLineStyle | `${ShapeLineStyle}`;
967
+ set style(value: ShapeLineStyle | `${ShapeLineStyle}`);
968
+ /** The transparency, from 0 (opaque) to 1 (clear). */
969
+ get transparency(): number;
970
+ set transparency(value: number);
971
+ /** Whether the line shows. */
972
+ get visible(): boolean;
973
+ set visible(value: boolean);
974
+ /** The line weight, in points. */
975
+ get weight(): number;
976
+ set weight(value: number);
977
+ /** @internal */
978
+ protected onLoad(request: ResolvedLoadOptions): void;
979
+ }
980
+
981
+ /**
982
+ * A preset geometry for `ShapeCollection.addGeometricShape`.
983
+ *
984
+ * @public
985
+ */
986
+ declare enum GeometricShapeType {
987
+ lineInverse = "LineInverse",
988
+ triangle = "Triangle",
989
+ rightTriangle = "RightTriangle",
990
+ rectangle = "Rectangle",
991
+ diamond = "Diamond",
992
+ parallelogram = "Parallelogram",
993
+ trapezoid = "Trapezoid",
994
+ nonIsoscelesTrapezoid = "NonIsoscelesTrapezoid",
995
+ pentagon = "Pentagon",
996
+ hexagon = "Hexagon",
997
+ heptagon = "Heptagon",
998
+ octagon = "Octagon",
999
+ decagon = "Decagon",
1000
+ dodecagon = "Dodecagon",
1001
+ star4 = "Star4",
1002
+ star5 = "Star5",
1003
+ star6 = "Star6",
1004
+ star7 = "Star7",
1005
+ star8 = "Star8",
1006
+ star10 = "Star10",
1007
+ star12 = "Star12",
1008
+ star16 = "Star16",
1009
+ star24 = "Star24",
1010
+ star32 = "Star32",
1011
+ roundRectangle = "RoundRectangle",
1012
+ round1Rectangle = "Round1Rectangle",
1013
+ round2SameRectangle = "Round2SameRectangle",
1014
+ round2DiagonalRectangle = "Round2DiagonalRectangle",
1015
+ snipRoundRectangle = "SnipRoundRectangle",
1016
+ snip1Rectangle = "Snip1Rectangle",
1017
+ snip2SameRectangle = "Snip2SameRectangle",
1018
+ snip2DiagonalRectangle = "Snip2DiagonalRectangle",
1019
+ plaque = "Plaque",
1020
+ ellipse = "Ellipse",
1021
+ teardrop = "Teardrop",
1022
+ homePlate = "HomePlate",
1023
+ chevron = "Chevron",
1024
+ pieWedge = "PieWedge",
1025
+ pie = "Pie",
1026
+ blockArc = "BlockArc",
1027
+ donut = "Donut",
1028
+ noSmoking = "NoSmoking",
1029
+ rightArrow = "RightArrow",
1030
+ leftArrow = "LeftArrow",
1031
+ upArrow = "UpArrow",
1032
+ downArrow = "DownArrow",
1033
+ stripedRightArrow = "StripedRightArrow",
1034
+ notchedRightArrow = "NotchedRightArrow",
1035
+ bentUpArrow = "BentUpArrow",
1036
+ leftRightArrow = "LeftRightArrow",
1037
+ upDownArrow = "UpDownArrow",
1038
+ leftUpArrow = "LeftUpArrow",
1039
+ leftRightUpArrow = "LeftRightUpArrow",
1040
+ quadArrow = "QuadArrow",
1041
+ leftArrowCallout = "LeftArrowCallout",
1042
+ rightArrowCallout = "RightArrowCallout",
1043
+ upArrowCallout = "UpArrowCallout",
1044
+ downArrowCallout = "DownArrowCallout",
1045
+ leftRightArrowCallout = "LeftRightArrowCallout",
1046
+ upDownArrowCallout = "UpDownArrowCallout",
1047
+ quadArrowCallout = "QuadArrowCallout",
1048
+ bentArrow = "BentArrow",
1049
+ uturnArrow = "UturnArrow",
1050
+ circularArrow = "CircularArrow",
1051
+ leftCircularArrow = "LeftCircularArrow",
1052
+ leftRightCircularArrow = "LeftRightCircularArrow",
1053
+ curvedRightArrow = "CurvedRightArrow",
1054
+ curvedLeftArrow = "CurvedLeftArrow",
1055
+ curvedUpArrow = "CurvedUpArrow",
1056
+ curvedDownArrow = "CurvedDownArrow",
1057
+ swooshArrow = "SwooshArrow",
1058
+ cube = "Cube",
1059
+ can = "Can",
1060
+ lightningBolt = "LightningBolt",
1061
+ heart = "Heart",
1062
+ sun = "Sun",
1063
+ moon = "Moon",
1064
+ smileyFace = "SmileyFace",
1065
+ irregularSeal1 = "IrregularSeal1",
1066
+ irregularSeal2 = "IrregularSeal2",
1067
+ foldedCorner = "FoldedCorner",
1068
+ bevel = "Bevel",
1069
+ frame = "Frame",
1070
+ halfFrame = "HalfFrame",
1071
+ corner = "Corner",
1072
+ diagonalStripe = "DiagonalStripe",
1073
+ chord = "Chord",
1074
+ arc = "Arc",
1075
+ leftBracket = "LeftBracket",
1076
+ rightBracket = "RightBracket",
1077
+ leftBrace = "LeftBrace",
1078
+ rightBrace = "RightBrace",
1079
+ bracketPair = "BracketPair",
1080
+ bracePair = "BracePair",
1081
+ callout1 = "Callout1",
1082
+ callout2 = "Callout2",
1083
+ callout3 = "Callout3",
1084
+ accentCallout1 = "AccentCallout1",
1085
+ accentCallout2 = "AccentCallout2",
1086
+ accentCallout3 = "AccentCallout3",
1087
+ borderCallout1 = "BorderCallout1",
1088
+ borderCallout2 = "BorderCallout2",
1089
+ borderCallout3 = "BorderCallout3",
1090
+ accentBorderCallout1 = "AccentBorderCallout1",
1091
+ accentBorderCallout2 = "AccentBorderCallout2",
1092
+ accentBorderCallout3 = "AccentBorderCallout3",
1093
+ wedgeRectCallout = "WedgeRectCallout",
1094
+ wedgeRRectCallout = "WedgeRRectCallout",
1095
+ wedgeEllipseCallout = "WedgeEllipseCallout",
1096
+ cloudCallout = "CloudCallout",
1097
+ cloud = "Cloud",
1098
+ ribbon = "Ribbon",
1099
+ ribbon2 = "Ribbon2",
1100
+ ellipseRibbon = "EllipseRibbon",
1101
+ ellipseRibbon2 = "EllipseRibbon2",
1102
+ leftRightRibbon = "LeftRightRibbon",
1103
+ verticalScroll = "VerticalScroll",
1104
+ horizontalScroll = "HorizontalScroll",
1105
+ wave = "Wave",
1106
+ doubleWave = "DoubleWave",
1107
+ plus = "Plus",
1108
+ flowChartProcess = "FlowChartProcess",
1109
+ flowChartDecision = "FlowChartDecision",
1110
+ flowChartInputOutput = "FlowChartInputOutput",
1111
+ flowChartPredefinedProcess = "FlowChartPredefinedProcess",
1112
+ flowChartInternalStorage = "FlowChartInternalStorage",
1113
+ flowChartDocument = "FlowChartDocument",
1114
+ flowChartMultidocument = "FlowChartMultidocument",
1115
+ flowChartTerminator = "FlowChartTerminator",
1116
+ flowChartPreparation = "FlowChartPreparation",
1117
+ flowChartManualInput = "FlowChartManualInput",
1118
+ flowChartManualOperation = "FlowChartManualOperation",
1119
+ flowChartConnector = "FlowChartConnector",
1120
+ flowChartPunchedCard = "FlowChartPunchedCard",
1121
+ flowChartPunchedTape = "FlowChartPunchedTape",
1122
+ flowChartSummingJunction = "FlowChartSummingJunction",
1123
+ flowChartOr = "FlowChartOr",
1124
+ flowChartCollate = "FlowChartCollate",
1125
+ flowChartSort = "FlowChartSort",
1126
+ flowChartExtract = "FlowChartExtract",
1127
+ flowChartMerge = "FlowChartMerge",
1128
+ flowChartOfflineStorage = "FlowChartOfflineStorage",
1129
+ flowChartOnlineStorage = "FlowChartOnlineStorage",
1130
+ flowChartMagneticTape = "FlowChartMagneticTape",
1131
+ flowChartMagneticDisk = "FlowChartMagneticDisk",
1132
+ flowChartMagneticDrum = "FlowChartMagneticDrum",
1133
+ flowChartDisplay = "FlowChartDisplay",
1134
+ flowChartDelay = "FlowChartDelay",
1135
+ flowChartAlternateProcess = "FlowChartAlternateProcess",
1136
+ flowChartOffpageConnector = "FlowChartOffpageConnector",
1137
+ actionButtonBlank = "ActionButtonBlank",
1138
+ actionButtonHome = "ActionButtonHome",
1139
+ actionButtonHelp = "ActionButtonHelp",
1140
+ actionButtonInformation = "ActionButtonInformation",
1141
+ actionButtonForwardNext = "ActionButtonForwardNext",
1142
+ actionButtonBackPrevious = "ActionButtonBackPrevious",
1143
+ actionButtonEnd = "ActionButtonEnd",
1144
+ actionButtonBeginning = "ActionButtonBeginning",
1145
+ actionButtonReturn = "ActionButtonReturn",
1146
+ actionButtonDocument = "ActionButtonDocument",
1147
+ actionButtonSound = "ActionButtonSound",
1148
+ actionButtonMovie = "ActionButtonMovie",
1149
+ gear6 = "Gear6",
1150
+ gear9 = "Gear9",
1151
+ funnel = "Funnel",
1152
+ mathPlus = "MathPlus",
1153
+ mathMinus = "MathMinus",
1154
+ mathMultiply = "MathMultiply",
1155
+ mathDivide = "MathDivide",
1156
+ mathEqual = "MathEqual",
1157
+ mathNotEqual = "MathNotEqual",
1158
+ cornerTabs = "CornerTabs",
1159
+ squareTabs = "SquareTabs",
1160
+ plaqueTabs = "PlaqueTabs",
1161
+ chartX = "ChartX",
1162
+ chartStar = "ChartStar",
1163
+ chartPlus = "ChartPlus"
1164
+ }
1165
+
1166
+ /**
1167
+ * The text frame of a shape (`p:txBody` and its `a:bodyPr`).
1168
+ *
1169
+ * @public
1170
+ */
1171
+ declare class TextFrame extends ModelObject {
1172
+ #private;
1173
+ /** @internal */
1174
+ constructor(context: RequestContext, path: ObjectPath, shape: ObjectPath, nullable?: boolean);
1175
+ /** How the text and the shape fit each other. */
1176
+ get autoSizeSetting(): ShapeAutoSize | `${ShapeAutoSize}`;
1177
+ set autoSizeSetting(value: ShapeAutoSize | `${ShapeAutoSize}`);
1178
+ /** The bottom inset, in points. */
1179
+ get bottomMargin(): number;
1180
+ set bottomMargin(value: number);
1181
+ /** The left inset, in points. */
1182
+ get leftMargin(): number;
1183
+ set leftMargin(value: number);
1184
+ /** The right inset, in points. */
1185
+ get rightMargin(): number;
1186
+ set rightMargin(value: number);
1187
+ /** The top inset, in points. */
1188
+ get topMargin(): number;
1189
+ set topMargin(value: number);
1190
+ /** The vertical anchor of the text. */
1191
+ get verticalAlignment(): TextVerticalAlignment | `${TextVerticalAlignment}`;
1192
+ set verticalAlignment(value: TextVerticalAlignment | `${TextVerticalAlignment}`);
1193
+ /** Whether lines wrap at the frame width. */
1194
+ get wordWrap(): boolean;
1195
+ set wordWrap(value: boolean);
1196
+ /** Whether the frame holds any text. */
1197
+ get hasText(): boolean;
1198
+ /** All the text of the frame. */
1199
+ get textRange(): TextRange;
1200
+ /** Delete all the text. */
1201
+ deleteText(): void;
1202
+ /** The shape that holds the frame. */
1203
+ getParentShape(): Shape;
1204
+ /** @internal */
1205
+ protected onLoad(request: ResolvedLoadOptions): void;
1206
+ }
1207
+ /** A span, or the whole text when absent. */
1208
+ type Span = AutomationTextSpan | undefined;
1209
+ /** The read of a paragraph format, planned against the batch. */
1210
+ type ParagraphRead = (ref: RefOf) => AutomationOperation;
1211
+ /**
1212
+ * A run of text in a text frame.
1213
+ *
1214
+ * @public
1215
+ */
1216
+ declare class TextRange extends ModelObject {
1217
+ #private;
1218
+ /** @internal */
1219
+ constructor(context: RequestContext, path: ObjectPath, shape: ObjectPath, span: Span, nullable?: boolean);
1220
+ /** @internal The reader's selected text, over a pending path the selection read resolves. */
1221
+ static selected(owner: ModelObject, name: string, nullable: boolean): TextRange;
1222
+ /**
1223
+ * @internal A nullable range over a pending path whose shape and span a later read gives:
1224
+ * the text range of a hyperlink that a lookup finds. `settle` resolves it, or marks it null.
1225
+ */
1226
+ static later(context: RequestContext, path: ObjectPath): {
1227
+ range: TextRange;
1228
+ settle: (to: {
1229
+ shape: AutomationHandle;
1230
+ span: Span;
1231
+ } | null) => void;
1232
+ };
1233
+ /** The text. Paragraphs are separated by `\r`, and a line break reads as `\v`. */
1234
+ get text(): string;
1235
+ set text(value: string);
1236
+ /** The zero-based start of the range in the text of the frame. */
1237
+ get start(): number;
1238
+ set start(value: number);
1239
+ /** The length of the range. */
1240
+ get length(): number;
1241
+ set length(value: number);
1242
+ /** The character formatting of the range. */
1243
+ get font(): ShapeFont;
1244
+ /** The paragraph formatting of the paragraphs the range touches. */
1245
+ get paragraphFormat(): ParagraphFormat;
1246
+ /** The text links that overlap the range, in text order. */
1247
+ get hyperlinks(): HyperlinkScopedCollection;
1248
+ /** The text frame that holds the range. */
1249
+ getParentTextFrame(): TextFrame;
1250
+ /**
1251
+ * A range inside this one, from `start` (relative to this range) for `length` characters, or
1252
+ * to the end of this range when `length` is absent.
1253
+ */
1254
+ getSubstring(start: number, length?: number): TextRange;
1255
+ /** Select the range in the editor. A server runtime refuses with `NotSupported`. */
1256
+ setSelected(): void;
1257
+ /** Link the range to an address. Answers the hyperlink. */
1258
+ setHyperlink(options?: HyperlinkAddOptions): Hyperlink;
1259
+ /** @internal */
1260
+ protected onLoad(request: ResolvedLoadOptions): void;
1261
+ }
1262
+ /**
1263
+ * The character formatting of a text range. A property reads `null` when the range mixes values.
1264
+ *
1265
+ * @public
1266
+ */
1267
+ declare class ShapeFont extends ModelObject {
1268
+ #private;
1269
+ /** @internal */
1270
+ constructor(context: RequestContext, path: ObjectPath, shape: ObjectPath, span: () => Span, cell?: AutomationCellAddress);
1271
+ get allCaps(): boolean | null;
1272
+ set allCaps(value: boolean | null);
1273
+ get bold(): boolean | null;
1274
+ set bold(value: boolean | null);
1275
+ /** The color as `#RRGGBB`. */
1276
+ get color(): string | null;
1277
+ set color(value: string | null);
1278
+ get doubleStrikethrough(): boolean | null;
1279
+ set doubleStrikethrough(value: boolean | null);
1280
+ get italic(): boolean | null;
1281
+ set italic(value: boolean | null);
1282
+ /** The font family name. */
1283
+ get name(): string | null;
1284
+ set name(value: string | null);
1285
+ /** The size, in points. */
1286
+ get size(): number | null;
1287
+ set size(value: number | null);
1288
+ get smallCaps(): boolean | null;
1289
+ set smallCaps(value: boolean | null);
1290
+ get strikethrough(): boolean | null;
1291
+ set strikethrough(value: boolean | null);
1292
+ get subscript(): boolean | null;
1293
+ set subscript(value: boolean | null);
1294
+ get superscript(): boolean | null;
1295
+ set superscript(value: boolean | null);
1296
+ get underline(): ShapeFontUnderlineStyle | `${ShapeFontUnderlineStyle}` | null;
1297
+ set underline(value: ShapeFontUnderlineStyle | `${ShapeFontUnderlineStyle}` | null);
1298
+ /** @internal */
1299
+ protected onLoad(request: ResolvedLoadOptions): void;
1300
+ }
1301
+ /**
1302
+ * The paragraph formatting of the paragraphs a text range touches. A property reads `null` when
1303
+ * they differ.
1304
+ *
1305
+ * @public
1306
+ */
1307
+ declare class ParagraphFormat extends ModelObject {
1308
+ #private;
1309
+ /** @internal */
1310
+ constructor(context: RequestContext, path: ObjectPath, shape: ObjectPath, span: () => Span, cell?: AutomationCellAddress);
1311
+ /** The horizontal alignment (`a:pPr/@algn`). */
1312
+ get horizontalAlignment(): ParagraphHorizontalAlignment | `${ParagraphHorizontalAlignment}` | null;
1313
+ set horizontalAlignment(value: ParagraphHorizontalAlignment | `${ParagraphHorizontalAlignment}` | null);
1314
+ /**
1315
+ * The outline level from 1 to 9, as for `TableCell.indentLevel`: one more than `a:pPr/@lvl`,
1316
+ * so a paragraph with no `lvl` reads 1.
1317
+ */
1318
+ get indentLevel(): number;
1319
+ set indentLevel(value: number);
1320
+ /** The bullets of the paragraphs. */
1321
+ get bulletFormat(): BulletFormat;
1322
+ /** @internal */
1323
+ protected onLoad(request: ResolvedLoadOptions): void;
1324
+ }
1325
+ /**
1326
+ * The bullets of paragraphs (`a:buNone`, `a:buChar`, `a:buAutoNum`).
1327
+ *
1328
+ * @public
1329
+ */
1330
+ declare class BulletFormat extends ModelObject {
1331
+ #private;
1332
+ /** @internal */
1333
+ constructor(context: RequestContext, path: ObjectPath, write: (name: string, paragraph: AutomationParagraphWrite) => void, plan: () => ParagraphRead);
1334
+ /** The numbering scheme of numbered bullets, or `null` when the paragraphs differ. */
1335
+ get style(): BulletStyle | `${BulletStyle}` | null;
1336
+ set style(value: BulletStyle | `${BulletStyle}` | null);
1337
+ /** The kind of bullet, or `null` when the paragraphs differ. */
1338
+ get type(): BulletType | `${BulletType}` | null;
1339
+ set type(value: BulletType | `${BulletType}` | null);
1340
+ /** Whether the paragraphs show bullets, or `null` when they differ. */
1341
+ get visible(): boolean | null;
1342
+ set visible(value: boolean | null);
1343
+ /** @internal */
1344
+ protected onLoad(request: ResolvedLoadOptions): void;
1345
+ }
1346
+
1347
+ /**
1348
+ * Options for a new hyperlink.
1349
+ *
1350
+ * @public
1351
+ */
1352
+ interface HyperlinkAddOptions {
1353
+ /** The address the link opens. */
1354
+ address?: string;
1355
+ /** The tip that shows over the link. */
1356
+ screenTip?: string;
1357
+ }
1358
+ /** A span, null for a shape link, or a getter for the range of a text link a write made. */
1359
+ type LinkSpan = AutomationTextSpan | null | (() => AutomationTextSpan | undefined);
1360
+ /**
1361
+ * One hyperlink: on a text range or on a whole shape.
1362
+ *
1363
+ * @public
1364
+ */
1365
+ declare class Hyperlink extends ModelObject {
1366
+ #private;
1367
+ /**
1368
+ * @internal `values` absent: the link is a lookup that has not answered, and nothing is
1369
+ * loaded until it does.
1370
+ */
1371
+ constructor(context: RequestContext, path: ObjectPath, shape: ObjectPath, span: LinkSpan | undefined, values?: {
1372
+ address: string;
1373
+ screenTip: string;
1374
+ });
1375
+ /** @internal A link a write just made, with the values it wrote. */
1376
+ static created(context: RequestContext, shape: ObjectPath, span: LinkSpan, address: string, screenTip: string): Hyperlink;
1377
+ /** The address the link opens. */
1378
+ get address(): string;
1379
+ set address(value: string);
1380
+ /** The tip that shows over the link. */
1381
+ get screenTip(): string;
1382
+ set screenTip(value: string);
1383
+ /** Whether the link is on a text range or on a whole shape. */
1384
+ get type(): HyperlinkType | `${HyperlinkType}`;
1385
+ /** Remove the link. The text or shape stays. */
1386
+ delete(): void;
1387
+ /** The shape a shape link is on, or a null object for a text link. */
1388
+ getLinkedShapeOrNullObject(): Shape;
1389
+ /** The text range a text link is on, or a null object for a shape link. */
1390
+ getLinkedTextRangeOrNullObject(): TextRange;
1391
+ /** @internal Values come with the object; a load has nothing more to read. */
1392
+ protected onLoad(request: ResolvedLoadOptions): void;
1393
+ }
1394
+ /** A list of hyperlinks that one read answers: of a slide, or of a text range. */
1395
+ declare abstract class HyperlinkList extends ModelObject {
1396
+ /** @internal The read that lists the hyperlinks. */
1397
+ protected abstract listing(ref: RefOf): AutomationOperation;
1398
+ /** The loaded hyperlinks. */
1399
+ get items(): Hyperlink[];
1400
+ /** The number of hyperlinks, after the next `sync()`. */
1401
+ getCount(): ClientResult<number>;
1402
+ /** The hyperlink at a zero-based position; `ItemNotFound` at the sync when there is none. */
1403
+ getItemAt(index: number): Hyperlink;
1404
+ /** @internal */
1405
+ protected get loadsItemPaths(): boolean;
1406
+ /** @internal */
1407
+ protected onLoad(request: ResolvedLoadOptions): void;
1408
+ }
1409
+ /**
1410
+ * The hyperlinks of a slide, in shape order.
1411
+ *
1412
+ * @public
1413
+ */
1414
+ declare class HyperlinkCollection extends HyperlinkList {
1415
+ #private;
1416
+ /** @internal */
1417
+ constructor(context: RequestContext, path: ObjectPath, slide: ObjectPath);
1418
+ /** Link a text range or a whole shape. Answers the new hyperlink. */
1419
+ add(target: TextRange | Shape, options?: HyperlinkAddOptions): Hyperlink;
1420
+ /** @internal */
1421
+ protected listing(ref: RefOf): AutomationOperation;
1422
+ }
1423
+ /**
1424
+ * The hyperlinks of a text range: each text link that overlaps the range, in text order. A link
1425
+ * keeps its whole span, so one that starts before the range reads from its own start. An empty
1426
+ * range holds the link around its point.
1427
+ *
1428
+ * @public
1429
+ */
1430
+ declare class HyperlinkScopedCollection extends HyperlinkList {
1431
+ #private;
1432
+ /** @internal */
1433
+ constructor(context: RequestContext, path: ObjectPath, shape: ObjectPath, span: () => AutomationTextSpan | undefined);
1434
+ /** @internal */
1435
+ protected listing(ref: RefOf): AutomationOperation;
1436
+ }
1437
+
1438
+ /**
1439
+ * Options for `Slide.getImageAsBase64`. The picture keeps the slide's aspect ratio and fits into
1440
+ * the box: with both sizes it fits into both, with one size it takes that size, and with neither
1441
+ * it has the slide's own size at 96 pixels per inch.
1442
+ *
1443
+ * @public
1444
+ */
1445
+ interface SlideGetImageOptions {
1446
+ /** The height of the box, in pixels. */
1447
+ height?: number;
1448
+ /** The width of the box, in pixels. */
1449
+ width?: number;
1450
+ }
1451
+ /**
1452
+ * Options for `Shape.getImageAsBase64`. The picture keeps the shape's aspect ratio and fits into
1453
+ * the box, as for a slide.
1454
+ *
1455
+ * @public
1456
+ */
1457
+ interface ShapeGetImageOptions {
1458
+ /** The image format. Only PNG. */
1459
+ format?: ShapeGetImageFormatType | `${ShapeGetImageFormatType}` | undefined;
1460
+ /** The height of the box, in pixels. */
1461
+ height?: number;
1462
+ /** The width of the box, in pixels. */
1463
+ width?: number;
1464
+ }
1465
+
1466
+ /**
1467
+ * Options for `SlideBackgroundFill.setSolidFill`.
1468
+ *
1469
+ * @public
1470
+ */
1471
+ interface SlideBackgroundSolidFillOptions {
1472
+ /** `#RRGGBB` or a preset color name. The current solid color, or white, when absent. */
1473
+ color?: string | undefined;
1474
+ /** From 0 (opaque) to 1 (clear). The current transparency, or 0, when absent. */
1475
+ transparency?: number | undefined;
1476
+ }
1477
+ /**
1478
+ * Options for `SlideBackgroundFill.setGradientFill`.
1479
+ *
1480
+ * @public
1481
+ */
1482
+ interface SlideBackgroundGradientFillOptions {
1483
+ /** The shading. The current shading, or `Linear`, when absent. */
1484
+ type?: SlideBackgroundGradientFillType | `${SlideBackgroundGradientFillType}` | undefined;
1485
+ }
1486
+ /**
1487
+ * Options for `SlideBackgroundFill.setPatternFill`.
1488
+ *
1489
+ * @public
1490
+ */
1491
+ interface SlideBackgroundPatternFillOptions {
1492
+ /** The color behind the pattern. The current one, or white, when absent. */
1493
+ backgroundColor?: string | undefined;
1494
+ /** The color of the pattern. The current one, or black, when absent. */
1495
+ foregroundColor?: string | undefined;
1496
+ /** The pattern. The current one, or `Percent5`, when absent. */
1497
+ pattern?: SlideBackgroundPatternFillType | `${SlideBackgroundPatternFillType}` | undefined;
1498
+ }
1499
+ /**
1500
+ * Options for `SlideBackgroundFill.setPictureOrTextureFill`.
1501
+ *
1502
+ * @public
1503
+ */
1504
+ interface SlideBackgroundPictureOrTextureFillOptions {
1505
+ /** PNG, JPEG, or GIF bytes in base64. The current picture when absent. */
1506
+ imageBase64?: string | undefined;
1507
+ /** From 0 (opaque) to 1 (clear). */
1508
+ transparency: number;
1509
+ }
1510
+ /** The object that writes and reads one background, by the slide, layout, or master path. */
1511
+ declare abstract class BackgroundPart extends ModelObject {
1512
+ /** @internal The slide, layout, or master; for a typed fill, its null-object path. */
1513
+ protected readonly owner: ObjectPath;
1514
+ /** @internal */
1515
+ constructor(context: RequestContext, path: ObjectPath, owner: ObjectPath, nullable?: boolean);
1516
+ /** @internal Queue one background write. */
1517
+ protected writeBackground(name: string, background: AutomationBackgroundWrite): void;
1518
+ /** @internal Queue the background read that fills `names`. */
1519
+ protected loadBackground(names: readonly string[], project: (background: AutomationBackgroundRead) => Readonly<Record<string, unknown>>): void;
1520
+ }
1521
+ /**
1522
+ * A solid background fill.
1523
+ *
1524
+ * @public
1525
+ */
1526
+ declare class SlideBackgroundSolidFill extends BackgroundPart {
1527
+ /** The color as `#RRGGBB`. */
1528
+ get color(): string;
1529
+ set color(value: string);
1530
+ /** The transparency, from 0 (opaque) to 1 (clear). */
1531
+ get transparency(): number;
1532
+ set transparency(value: number);
1533
+ /** @internal */
1534
+ protected onLoad(request: ResolvedLoadOptions): void;
1535
+ }
1536
+ /**
1537
+ * A gradient background fill.
1538
+ *
1539
+ * @public
1540
+ */
1541
+ declare class SlideBackgroundGradientFill extends BackgroundPart {
1542
+ /** The shading: `a:lin`, or an `a:path` of `circle` (Radial), `rect`, or `shape` (Path). */
1543
+ get type(): SlideBackgroundGradientFillType | `${SlideBackgroundGradientFillType}`;
1544
+ set type(value: SlideBackgroundGradientFillType | `${SlideBackgroundGradientFillType}`);
1545
+ /** @internal */
1546
+ protected onLoad(request: ResolvedLoadOptions): void;
1547
+ }
1548
+ /**
1549
+ * A pattern background fill (`a:pattFill`).
1550
+ *
1551
+ * @public
1552
+ */
1553
+ declare class SlideBackgroundPatternFill extends BackgroundPart {
1554
+ /** The color behind the pattern, as `#RRGGBB`. */
1555
+ get backgroundColor(): string;
1556
+ set backgroundColor(value: string);
1557
+ /** The color of the pattern, as `#RRGGBB`. */
1558
+ get foregroundColor(): string;
1559
+ set foregroundColor(value: string);
1560
+ /** The pattern (`ST_PresetPatternVal`). */
1561
+ get pattern(): SlideBackgroundPatternFillType | `${SlideBackgroundPatternFillType}`;
1562
+ set pattern(value: SlideBackgroundPatternFillType | `${SlideBackgroundPatternFillType}`);
1563
+ /** @internal */
1564
+ protected onLoad(request: ResolvedLoadOptions): void;
1565
+ }
1566
+ /**
1567
+ * A picture background fill (`a:blipFill`), stretched to the slide.
1568
+ *
1569
+ * @public
1570
+ */
1571
+ declare class SlideBackgroundPictureOrTextureFill extends BackgroundPart {
1572
+ /** The transparency of the picture (`a:alphaModFix`), from 0 (opaque) to 1 (clear). */
1573
+ get transparency(): number;
1574
+ set transparency(value: number);
1575
+ /** Show other picture bytes: PNG, JPEG, or GIF in base64. The transparency stays. */
1576
+ setImage(base64EncodedImage: string): void;
1577
+ /** @internal */
1578
+ protected onLoad(request: ResolvedLoadOptions): void;
1579
+ }
1580
+ /**
1581
+ * The fill of a background.
1582
+ *
1583
+ * @public
1584
+ */
1585
+ declare class SlideBackgroundFill extends BackgroundPart {
1586
+ #private;
1587
+ /** The kind of fill. `Unsupported` for no fill. */
1588
+ get type(): SlideBackgroundFillType | `${SlideBackgroundFillType}`;
1589
+ /** The gradient fill, or a null object when the fill is of another kind. */
1590
+ getGradientFillOrNullObject(): SlideBackgroundGradientFill;
1591
+ /** The pattern fill, or a null object when the fill is of another kind. */
1592
+ getPatternFillOrNullObject(): SlideBackgroundPatternFill;
1593
+ /** The picture fill, or a null object when the fill is of another kind. */
1594
+ getPictureOrTextureFillOrNullObject(): SlideBackgroundPictureOrTextureFill;
1595
+ /** The solid fill, or a null object when the fill is of another kind. */
1596
+ getSolidFillOrNullObject(): SlideBackgroundSolidFill;
1597
+ /** Fill with a gradient. The stops of a current gradient stay. */
1598
+ setGradientFill(options?: SlideBackgroundGradientFillOptions): void;
1599
+ /** Fill with a pattern (`a:pattFill`). */
1600
+ setPatternFill(options?: SlideBackgroundPatternFillOptions): void;
1601
+ /** Fill with a stretched picture. Without `imageBase64`, the current picture stays. */
1602
+ setPictureOrTextureFill(options?: SlideBackgroundPictureOrTextureFillOptions): void;
1603
+ /** Fill with one color. */
1604
+ setSolidFill(options?: SlideBackgroundSolidFillOptions): void;
1605
+ /** @internal */
1606
+ protected onLoad(request: ResolvedLoadOptions): void;
1607
+ }
1608
+ /**
1609
+ * The background of a slide.
1610
+ *
1611
+ * @public
1612
+ */
1613
+ declare class SlideBackground extends BackgroundPart {
1614
+ #private;
1615
+ /** Whether the shapes of the layout and master are hidden (`p:sld/@showMasterSp="0"`). */
1616
+ get areBackgroundGraphicsHidden(): boolean;
1617
+ set areBackgroundGraphicsHidden(value: boolean);
1618
+ /**
1619
+ * Whether the slide shows the background of its layout or master (it has no own `p:bg`).
1620
+ * Setting `false` copies the shown background into the slide.
1621
+ */
1622
+ get isMasterBackgroundFollowed(): boolean;
1623
+ set isMasterBackgroundFollowed(value: boolean);
1624
+ /** The fill the slide shows. */
1625
+ get fill(): SlideBackgroundFill;
1626
+ /** Remove the own background: the slide shows the background of its layout or master. */
1627
+ reset(): void;
1628
+ /** @internal */
1629
+ protected onLoad(request: ResolvedLoadOptions): void;
1630
+ }
1631
+ /**
1632
+ * The background of a slide layout.
1633
+ *
1634
+ * @public
1635
+ */
1636
+ declare class SlideLayoutBackground extends BackgroundPart {
1637
+ #private;
1638
+ /** Whether the shapes of the master are hidden (`p:sldLayout/@showMasterSp="0"`). */
1639
+ get areBackgroundGraphicsHidden(): boolean;
1640
+ set areBackgroundGraphicsHidden(value: boolean);
1641
+ /**
1642
+ * Whether the layout shows the background of its master (it has no own `p:bg`). Setting
1643
+ * `false` copies the master background into the layout.
1644
+ */
1645
+ get isMasterBackgroundFollowed(): boolean;
1646
+ set isMasterBackgroundFollowed(value: boolean);
1647
+ /** The fill the layout shows. */
1648
+ get fill(): SlideBackgroundFill;
1649
+ /** Remove the own background: the layout shows the background of its master. */
1650
+ reset(): void;
1651
+ /** @internal */
1652
+ protected onLoad(request: ResolvedLoadOptions): void;
1653
+ }
1654
+ /**
1655
+ * The background of a slide master.
1656
+ *
1657
+ * @public
1658
+ */
1659
+ declare class SlideMasterBackground extends BackgroundPart {
1660
+ #private;
1661
+ /** The fill of the master background. */
1662
+ get fill(): SlideBackgroundFill;
1663
+ /** @internal */
1664
+ protected onLoad(request: ResolvedLoadOptions): void;
1665
+ }
1666
+
1667
+ type Read = AutomationCustomXmlPartRead;
1668
+ /**
1669
+ * One custom XML part.
1670
+ *
1671
+ * @public
1672
+ */
1673
+ declare class CustomXmlPart extends ModelObject {
1674
+ #private;
1675
+ /** @internal */
1676
+ constructor(context: RequestContext, path: ObjectPath, owner: ObjectPath, id: string, nullable?: boolean);
1677
+ /** The id: the part's `ds:itemID` GUID, braced and upper case. */
1678
+ get id(): string;
1679
+ /** The namespace URI of the root element, or an empty string. */
1680
+ get namespaceUri(): string;
1681
+ /** The XML text of the part, after the next `sync()`. */
1682
+ getXml(): ClientResult<string>;
1683
+ /** Replace the XML text. Text that is not well-formed XML refuses with `InvalidArgument`. */
1684
+ setXml(xml: string): void;
1685
+ /** Delete the part from its owner. A part another owner still names stays for that owner. */
1686
+ delete(): void;
1687
+ /** @internal */
1688
+ protected onLoad(request: ResolvedLoadOptions): void;
1689
+ }
1690
+ /** What both collections share: the reads of a list, filtered by namespace or not. */
1691
+ declare abstract class CustomXmlPartList extends ModelObject {
1692
+ #private;
1693
+ /** @internal */
1694
+ constructor(context: RequestContext, path: ObjectPath, namespaceUri?: string);
1695
+ /** The loaded parts. */
1696
+ get items(): CustomXmlPart[];
1697
+ /** The number of parts, after the next `sync()`. */
1698
+ getCount(): ClientResult<number>;
1699
+ /** The part with this id; `ItemNotFound` at the sync when there is none. */
1700
+ getItem(id: string): CustomXmlPart;
1701
+ /** The part at a zero-based position; `ItemNotFound` at the sync when there is none. */
1702
+ getItemAt(index: number): CustomXmlPart;
1703
+ /** The part with this id, or a null object. */
1704
+ getItemOrNullObject(id: string): CustomXmlPart;
1705
+ /** A part over a pending path that a read resolves to the owner, or null. */
1706
+ protected find(name: string, pick: (all: readonly Read[]) => Read | undefined, id: string | undefined, orNull: boolean): CustomXmlPart;
1707
+ /** @internal */
1708
+ protected get loadsItemPaths(): boolean;
1709
+ /** @internal */
1710
+ protected onLoad(request: ResolvedLoadOptions): void;
1711
+ }
1712
+ /**
1713
+ * The custom XML parts of a presentation, slide, layout, master, or shape.
1714
+ *
1715
+ * @example
1716
+ * ```ts
1717
+ * await runtime.run(async (context) => {
1718
+ * const parts = context.presentation.customXmlParts;
1719
+ * const part = parts.add('<review xmlns="urn:example:review"><status>open</status></review>');
1720
+ * part.load('id');
1721
+ * await context.sync();
1722
+ * console.log(part.id);
1723
+ * });
1724
+ * ```
1725
+ *
1726
+ * @public
1727
+ */
1728
+ declare class CustomXmlPartCollection extends CustomXmlPartList {
1729
+ /** @internal */
1730
+ constructor(context: RequestContext, path: ObjectPath);
1731
+ /**
1732
+ * Add a part with this XML text. Text that is not well-formed XML, or that declares a DTD or
1733
+ * an entity, refuses with `InvalidArgument` at the sync.
1734
+ */
1735
+ add(xml: string): CustomXmlPart;
1736
+ /** The parts whose root element has this namespace URI. */
1737
+ getByNamespace(namespaceUri: string): CustomXmlPartScopedCollection;
1738
+ }
1739
+ /**
1740
+ * The custom XML parts of one namespace, from `CustomXmlPartCollection.getByNamespace`.
1741
+ *
1742
+ * @public
1743
+ */
1744
+ declare class CustomXmlPartScopedCollection extends CustomXmlPartList {
1745
+ /** @internal */
1746
+ constructor(context: RequestContext, path: ObjectPath, namespaceUri: string);
1747
+ /** The only part; `ItemNotFound` at the sync unless there is exactly one. */
1748
+ getOnlyItem(): CustomXmlPart;
1749
+ /** The only part, or a null object unless there is exactly one. */
1750
+ getOnlyItemOrNullObject(): CustomXmlPart;
1751
+ }
1752
+
1753
+ /**
1754
+ * One tag: a key and a value.
1755
+ *
1756
+ * @public
1757
+ */
1758
+ declare class Tag extends ModelObject {
1759
+ #private;
1760
+ /** @internal */
1761
+ constructor(context: RequestContext, path: ObjectPath, owner: ObjectPath, key: string, nullable?: boolean);
1762
+ /** The key, in upper case. */
1763
+ get key(): string;
1764
+ /** The value. */
1765
+ get value(): string;
1766
+ set value(value: string);
1767
+ /** @internal */
1768
+ protected onLoad(request: ResolvedLoadOptions): void;
1769
+ }
1770
+ /**
1771
+ * The tags of a presentation, slide, or shape.
1772
+ *
1773
+ * @public
1774
+ */
1775
+ declare class TagCollection extends ModelObject {
1776
+ #private;
1777
+ /** @internal */
1778
+ constructor(context: RequestContext, path: ObjectPath);
1779
+ /** The loaded tags. */
1780
+ get items(): Tag[];
1781
+ /** Add a tag, or set the value of the tag with this key. */
1782
+ add(key: string, value: string): void;
1783
+ /** Delete the tag with this key. `ItemNotFound` at the sync when there is none. */
1784
+ delete(key: string): void;
1785
+ /** The number of tags, after the next `sync()`. */
1786
+ getCount(): ClientResult<number>;
1787
+ /** The tag with this key; `ItemNotFound` at the sync when there is none. */
1788
+ getItem(key: string): Tag;
1789
+ /** The tag at a zero-based position. */
1790
+ getItemAt(index: number): Tag;
1791
+ /** The tag with this key, or a null object. */
1792
+ getItemOrNullObject(key: string): Tag;
1793
+ /** @internal */
1794
+ protected get loadsItemPaths(): boolean;
1795
+ /** @internal */
1796
+ protected onLoad(request: ResolvedLoadOptions): void;
1797
+ }
1798
+
1799
+ /**
1800
+ * The theme colors of a slide, a layout, or a master. Every slide, layout, and master that uses
1801
+ * the same theme shares them, so a write changes all of them.
1802
+ *
1803
+ * @public
1804
+ */
1805
+ declare class ThemeColorScheme extends ModelObject {
1806
+ #private;
1807
+ /** @internal */
1808
+ constructor(context: RequestContext, path: ObjectPath, owner: ObjectPath);
1809
+ /** One theme color as `#RRGGBB`. `Mixed` and `None` are `InvalidArgument`. */
1810
+ getThemeColor(color: ThemeColor): ClientResult<string>;
1811
+ /** One theme color as `#RRGGBB`. `Mixed` and `None` are `InvalidArgument`. */
1812
+ getThemeColor(color: 'Accent1' | 'Accent2' | 'Accent3' | 'Accent4' | 'Accent5' | 'Accent6' | 'Dark1' | 'Dark2' | 'FollowedHyperlink' | 'Hyperlink' | 'Light1' | 'Light2' | 'Mixed' | 'None'): ClientResult<string>;
1813
+ /** Set one theme color: `#RRGGBB` or a preset color name. */
1814
+ setThemeColor(color: ThemeColor, rgbColor: string): void;
1815
+ /** Set one theme color: `#RRGGBB` or a preset color name. */
1816
+ setThemeColor(color: 'Accent1' | 'Accent2' | 'Accent3' | 'Accent4' | 'Accent5' | 'Accent6' | 'Dark1' | 'Dark2' | 'FollowedHyperlink' | 'Hyperlink' | 'Light1' | 'Light2' | 'Mixed' | 'None', rgbColor: string): void;
1817
+ }
1818
+
1819
+ /**
1820
+ * Options for `SlideCollection.add`.
1821
+ *
1822
+ * @public
1823
+ */
1824
+ interface AddSlideOptions {
1825
+ /** The layout of the new slide, by id. The first layout of the master when absent. */
1826
+ layoutId?: string;
1827
+ /** The master of the new slide, by id. The master of the last slide when absent. */
1828
+ slideMasterId?: string;
1829
+ }
1830
+ /**
1831
+ * A slide.
1832
+ *
1833
+ * @public
1834
+ */
1835
+ declare class Slide extends ModelObject {
1836
+ #private;
1837
+ /** @internal */
1838
+ constructor(context: RequestContext, path: ObjectPath, nullable?: boolean);
1839
+ /** The slide id (`p:sldId/@id`). Stable across moves. */
1840
+ get id(): string;
1841
+ /** The zero-based position of the slide. */
1842
+ get index(): number;
1843
+ /** The shapes of the slide, in z-order. */
1844
+ get shapes(): ShapeCollection;
1845
+ /** The tags of the slide. */
1846
+ get tags(): TagCollection;
1847
+ /** The custom XML parts of the slide. */
1848
+ get customXmlParts(): CustomXmlPartCollection;
1849
+ /** The hyperlinks of the slide: text links and shape click links. */
1850
+ get hyperlinks(): HyperlinkCollection;
1851
+ /** The background of the slide. */
1852
+ get background(): SlideBackground;
1853
+ /** The theme colors of the slide: those of the theme of its master. */
1854
+ get themeColorScheme(): ThemeColorScheme;
1855
+ /** The layout of the slide. */
1856
+ get layout(): SlideLayout;
1857
+ /** The master of the slide. */
1858
+ get slideMaster(): SlideMaster;
1859
+ /** Change the layout, re-mapping placeholders by type and index. */
1860
+ applyLayout(slideLayout: SlideLayout): void;
1861
+ /** Delete the slide. */
1862
+ delete(): void;
1863
+ /** Move the slide to a zero-based position. */
1864
+ moveTo(slideIndex: number): void;
1865
+ /**
1866
+ * A PNG picture of the slide as base64, drawn by the editor's own renderer. A runtime over a
1867
+ * live editor in a browser draws pictures, and so does a server runtime created with a
1868
+ * `rasterize` option; any other runtime refuses with `NotSupported`.
1869
+ *
1870
+ * @example
1871
+ * ```ts
1872
+ * const image = slide.getImageAsBase64({ width: 640 });
1873
+ * await context.sync();
1874
+ * const png = `data:image/png;base64,${image.value}`;
1875
+ * ```
1876
+ */
1877
+ getImageAsBase64(options?: SlideGetImageOptions): ClientResult<string>;
1878
+ /** The slide as a presentation of its own, Base64-encoded PPTX bytes. */
1879
+ exportAsBase64(): ClientResult<string>;
1880
+ /** Select shapes of this slide by id. A server runtime refuses with `NotSupported`. */
1881
+ setSelectedShapes(shapeIds: string[]): void;
1882
+ /** @internal */
1883
+ protected onLoad(request: ResolvedLoadOptions): void;
1884
+ }
1885
+ /**
1886
+ * The slides of the presentation, in order.
1887
+ *
1888
+ * @public
1889
+ */
1890
+ declare class SlideCollection extends ItemCollection<Slide> {
1891
+ /** @internal */
1892
+ constructor(context: RequestContext, path: ObjectPath);
1893
+ /** Add a slide at the end, from a layout and master by id. */
1894
+ add(options?: AddSlideOptions): void;
1895
+ /** The listed slides as a presentation of their own, Base64-encoded PPTX bytes. */
1896
+ exportAsBase64Presentation(values: Array<string | Slide>): ClientResult<string>;
1897
+ /** A slide by id; `ItemNotFound` at the sync when there is none. */
1898
+ getItem(key: string): Slide;
1899
+ /** A slide by zero-based position; `ItemNotFound` at the sync when there is none. */
1900
+ getItemAt(index: number): Slide;
1901
+ /** A slide by id, or a null object. */
1902
+ getItemOrNullObject(id: string): Slide;
1903
+ /** @internal */
1904
+ protected listing(): AutomationOperation;
1905
+ /** @internal */
1906
+ protected itemOf(path: ObjectPath, nullable: boolean): Slide;
1907
+ /** @internal */
1908
+ protected lookup(_ref: RefOf, key: AutomationItemKey, orNull: boolean): AutomationOperation;
1909
+ }
1910
+ /**
1911
+ * A set of slides: the reader's selection.
1912
+ *
1913
+ * @public
1914
+ */
1915
+ declare class SlideScopedCollection extends ItemCollection<Slide> {
1916
+ /** @internal */
1917
+ constructor(context: RequestContext, path: ObjectPath, source: 'selection');
1918
+ /** The slides as a presentation of their own, Base64-encoded PPTX bytes. */
1919
+ exportAsBase64Presentation(): ClientResult<string>;
1920
+ /** A selected slide by id; `ItemNotFound` at the sync when there is none. */
1921
+ getItem(key: string): Slide;
1922
+ /** A selected slide by position in the selection. */
1923
+ getItemAt(index: number): Slide;
1924
+ /** A selected slide by id, or a null object. */
1925
+ getItemOrNullObject(id: string): Slide;
1926
+ /** @internal */
1927
+ protected listing(): AutomationOperation;
1928
+ /** @internal */
1929
+ protected handlesOf(value: AutomationValue, label: string): readonly AutomationHandle[];
1930
+ /** @internal */
1931
+ protected get hasLookup(): boolean;
1932
+ /** @internal */
1933
+ protected itemOf(path: ObjectPath, nullable: boolean): Slide;
1934
+ /** @internal */
1935
+ protected lookup(): undefined;
1936
+ }
1937
+ /**
1938
+ * A slide layout (`p:sldLayout`).
1939
+ *
1940
+ * @public
1941
+ */
1942
+ declare class SlideLayout extends ModelObject {
1943
+ #private;
1944
+ /** @internal */
1945
+ constructor(context: RequestContext, path: ObjectPath, nullable?: boolean);
1946
+ /** The layout id (`p:sldLayoutId/@id`). */
1947
+ get id(): string;
1948
+ /** The layout name (`p:cSld/@name`). */
1949
+ get name(): string;
1950
+ /** The layout type (`p:sldLayout/@type`). */
1951
+ get type(): SlideLayoutType | `${SlideLayoutType}`;
1952
+ /** The shapes of the layout. */
1953
+ get shapes(): ShapeCollection;
1954
+ /** The background of the layout. */
1955
+ get background(): SlideLayoutBackground;
1956
+ /** The custom XML parts of the layout. */
1957
+ get customXmlParts(): CustomXmlPartCollection;
1958
+ /** The theme colors of the layout: those of the theme of its master. */
1959
+ get themeColorScheme(): ThemeColorScheme;
1960
+ /** @internal */
1961
+ protected onLoad(request: ResolvedLoadOptions): void;
1962
+ }
1963
+ /**
1964
+ * The layouts of a slide master, in `p:sldLayoutIdLst` order.
1965
+ *
1966
+ * @public
1967
+ */
1968
+ declare class SlideLayoutCollection extends ItemCollection<SlideLayout> {
1969
+ #private;
1970
+ /** @internal */
1971
+ constructor(context: RequestContext, path: ObjectPath, master: ObjectPath);
1972
+ /** A layout by id; `ItemNotFound` at the sync when there is none. */
1973
+ getItem(key: string): SlideLayout;
1974
+ /** A layout by zero-based position. */
1975
+ getItemAt(index: number): SlideLayout;
1976
+ /** A layout by id, or a null object. */
1977
+ getItemOrNullObject(id: string): SlideLayout;
1978
+ /** @internal */
1979
+ protected listing(ref: RefOf): AutomationOperation;
1980
+ /** @internal */
1981
+ protected itemOf(path: ObjectPath, nullable: boolean): SlideLayout;
1982
+ /** @internal */
1983
+ protected lookup(ref: RefOf, key: AutomationItemKey, orNull: boolean): AutomationOperation;
1984
+ }
1985
+ /**
1986
+ * A slide master (`p:sldMaster`).
1987
+ *
1988
+ * @public
1989
+ */
1990
+ declare class SlideMaster extends ModelObject {
1991
+ #private;
1992
+ /** @internal */
1993
+ constructor(context: RequestContext, path: ObjectPath, nullable?: boolean);
1994
+ /** The master id (`p:sldMasterId/@id`). */
1995
+ get id(): string;
1996
+ /** The master name (`p:cSld/@name`). */
1997
+ get name(): string;
1998
+ /** The layouts of the master. */
1999
+ get layouts(): SlideLayoutCollection;
2000
+ /** The shapes of the master. */
2001
+ get shapes(): ShapeCollection;
2002
+ /** The background of the master. */
2003
+ get background(): SlideMasterBackground;
2004
+ /** The custom XML parts of the master. */
2005
+ get customXmlParts(): CustomXmlPartCollection;
2006
+ /** The theme colors of the master: those of the theme of its master. */
2007
+ get themeColorScheme(): ThemeColorScheme;
2008
+ /** @internal */
2009
+ protected onLoad(request: ResolvedLoadOptions): void;
2010
+ }
2011
+ /**
2012
+ * The slide masters of the presentation, in `p:sldMasterIdLst` order.
2013
+ *
2014
+ * @public
2015
+ */
2016
+ declare class SlideMasterCollection extends ItemCollection<SlideMaster> {
2017
+ /** @internal */
2018
+ constructor(context: RequestContext, path: ObjectPath);
2019
+ /** A master by id; `ItemNotFound` at the sync when there is none. */
2020
+ getItem(key: string): SlideMaster;
2021
+ /** A master by zero-based position. */
2022
+ getItemAt(index: number): SlideMaster;
2023
+ /** A master by id, or a null object. */
2024
+ getItemOrNullObject(id: string): SlideMaster;
2025
+ /** @internal */
2026
+ protected listing(): AutomationOperation;
2027
+ /** @internal */
2028
+ protected itemOf(path: ObjectPath, nullable: boolean): SlideMaster;
2029
+ /** @internal */
2030
+ protected lookup(_ref: RefOf, key: AutomationItemKey, orNull: boolean): AutomationOperation;
2031
+ }
2032
+
2033
+ /** The cell a format object writes through: the table shape and a grid position. */
2034
+ interface CellTarget {
2035
+ readonly shape: ObjectPath;
2036
+ readonly cell: AutomationCellAddress;
2037
+ }
2038
+ /** An object over one cell's `a:tcPr`. */
2039
+ declare abstract class CellFormatPart extends ModelObject {
2040
+ /** @internal */
2041
+ protected readonly target: CellTarget;
2042
+ /** @internal */
2043
+ constructor(context: RequestContext, path: ObjectPath, target: CellTarget);
2044
+ /** @internal Queue the cell format read that fills `names`. */
2045
+ protected loadCellFormat(names: readonly string[], project: (format: AutomationTableCellFormatRead) => Readonly<Record<string, unknown>>): void;
2046
+ }
2047
+ /**
2048
+ * One border of a table cell: an edge or a diagonal. It reads the line the cell shows, its own
2049
+ * or the table style's; a cell with no line there reads `undefined` for each property. A write
2050
+ * keeps the properties it does not set, and an outside edge also changes the cell across it.
2051
+ *
2052
+ * @public
2053
+ */
2054
+ declare class Border extends CellFormatPart {
2055
+ #private;
2056
+ /** @internal */
2057
+ constructor(context: RequestContext, path: ObjectPath, target: CellTarget, side: AutomationCellBorderSide);
2058
+ /** The line color as `#RRGGBB`. A write also takes a preset color name. */
2059
+ get color(): string | undefined;
2060
+ set color(value: string | undefined);
2061
+ /** The dash style. */
2062
+ get dashStyle(): ShapeLineDashStyle | `${ShapeLineDashStyle}` | undefined;
2063
+ set dashStyle(value: ShapeLineDashStyle | `${ShapeLineDashStyle}` | undefined);
2064
+ /** The transparency, from 0 (opaque) to 1 (clear). */
2065
+ get transparency(): number | undefined;
2066
+ set transparency(value: number | undefined);
2067
+ /** The line weight, in points. */
2068
+ get weight(): number | undefined;
2069
+ set weight(value: number | undefined);
2070
+ /** @internal */
2071
+ protected onLoad(request: ResolvedLoadOptions): void;
2072
+ }
2073
+ /**
2074
+ * The borders of a table cell (`a:tcPr/a:lnL`, `a:lnR`, `a:lnT`, `a:lnB`, `a:lnTlToBr`,
2075
+ * `a:lnBlToTr`).
2076
+ *
2077
+ * @public
2078
+ */
2079
+ declare class Borders extends CellFormatPart {
2080
+ #private;
2081
+ /** The bottom edge. */
2082
+ get bottom(): Border;
2083
+ /** The diagonal from the top-left to the bottom-right corner. */
2084
+ get diagonalDown(): Border;
2085
+ /** The diagonal from the bottom-left to the top-right corner. */
2086
+ get diagonalUp(): Border;
2087
+ /** The left edge. */
2088
+ get left(): Border;
2089
+ /** The right edge. */
2090
+ get right(): Border;
2091
+ /** The top edge. */
2092
+ get top(): Border;
2093
+ /** @internal */
2094
+ protected onLoad(request: ResolvedLoadOptions): void;
2095
+ }
2096
+ /**
2097
+ * The margins of a table cell, in points (`a:tcPr/@marL`, `@marR`, `@marT`, `@marB`). Writing
2098
+ * `undefined` removes the margin, back to its default (7.2 points left and right, 3.6 points
2099
+ * top and bottom).
2100
+ *
2101
+ * @public
2102
+ */
2103
+ declare class Margins extends CellFormatPart {
2104
+ #private;
2105
+ /** The bottom margin, in points. */
2106
+ get bottom(): number | undefined;
2107
+ set bottom(value: number | undefined);
2108
+ /** The left margin, in points. */
2109
+ get left(): number | undefined;
2110
+ set left(value: number | undefined);
2111
+ /** The right margin, in points. */
2112
+ get right(): number | undefined;
2113
+ set right(value: number | undefined);
2114
+ /** The top margin, in points. */
2115
+ get top(): number | undefined;
2116
+ set top(value: number | undefined);
2117
+ /** @internal */
2118
+ protected onLoad(request: ResolvedLoadOptions): void;
2119
+ }
2120
+ /**
2121
+ * The style options and the style of a table (`a:tblPr`). A style is found by its name in the
2122
+ * presentation's `ppt/tableStyles.xml`: `MediumStyle2Accent1` is "Medium Style 2 - Accent 1".
2123
+ * The presentation must define the style, except `MediumStyle2Accent1`, which is built in, and
2124
+ * `NoStyleNoGrid`, which removes the style choice.
2125
+ *
2126
+ * @public
2127
+ */
2128
+ declare class TableStyleSettings extends ModelObject {
2129
+ #private;
2130
+ /** @internal */
2131
+ constructor(context: RequestContext, path: ObjectPath, shape: ObjectPath);
2132
+ /** Whether the columns show banded formatting (`a:tblPr/@bandCol`). */
2133
+ get areColumnsBanded(): boolean;
2134
+ set areColumnsBanded(value: boolean);
2135
+ /** Whether the rows show banded formatting (`a:tblPr/@bandRow`). */
2136
+ get areRowsBanded(): boolean;
2137
+ set areRowsBanded(value: boolean);
2138
+ /** Whether the first column has its own format (`a:tblPr/@firstCol`). */
2139
+ get isFirstColumnHighlighted(): boolean;
2140
+ set isFirstColumnHighlighted(value: boolean);
2141
+ /** Whether the first row has its own format (`a:tblPr/@firstRow`). */
2142
+ get isFirstRowHighlighted(): boolean;
2143
+ set isFirstRowHighlighted(value: boolean);
2144
+ /** Whether the last column has its own format (`a:tblPr/@lastCol`). */
2145
+ get isLastColumnHighlighted(): boolean;
2146
+ set isLastColumnHighlighted(value: boolean);
2147
+ /** Whether the last row has its own format (`a:tblPr/@lastRow`). */
2148
+ get isLastRowHighlighted(): boolean;
2149
+ set isLastRowHighlighted(value: boolean);
2150
+ /**
2151
+ * The table style. A table with no style reads `NoStyleNoGrid`. A style whose name has no
2152
+ * `TableStyle` value refuses the read with `NotImplemented`.
2153
+ */
2154
+ get style(): TableStyle | `${TableStyle}`;
2155
+ set style(value: TableStyle | `${TableStyle}`);
2156
+ /** @internal */
2157
+ protected onLoad(request: ResolvedLoadOptions): void;
2158
+ }
2159
+
2160
+ /**
2161
+ * Character formatting for one run of `TableCell.textRuns`. In a write, an absent property
2162
+ * keeps the cell's format. A read gives every property, except `color` when the text has no
2163
+ * solid fill.
2164
+ *
2165
+ * @public
2166
+ */
2167
+ interface FontProperties {
2168
+ allCaps?: boolean | undefined;
2169
+ bold?: boolean | undefined;
2170
+ /** `#RRGGBB` or a preset color name. */
2171
+ color?: string | undefined;
2172
+ doubleStrikethrough?: boolean | undefined;
2173
+ italic?: boolean | undefined;
2174
+ name?: string | undefined;
2175
+ /** Points. */
2176
+ size?: number | undefined;
2177
+ smallCaps?: boolean | undefined;
2178
+ strikethrough?: boolean | undefined;
2179
+ subscript?: boolean | undefined;
2180
+ superscript?: boolean | undefined;
2181
+ underline?: ShapeFontUnderlineStyle | `${ShapeFontUnderlineStyle}` | undefined;
2182
+ }
2183
+ /**
2184
+ * One run of text with its own format, for `TableCell.textRuns`.
2185
+ *
2186
+ * @public
2187
+ */
2188
+ interface TextRun {
2189
+ font?: FontProperties | undefined;
2190
+ text: string;
2191
+ }
2192
+ /**
2193
+ * One cell of a table.
2194
+ *
2195
+ * @public
2196
+ */
2197
+ declare class TableCell extends ModelObject {
2198
+ #private;
2199
+ /** @internal */
2200
+ constructor(context: RequestContext, path: ObjectPath, row: number, column: number);
2201
+ /** The text of the cell. */
2202
+ get text(): string;
2203
+ set text(value: string);
2204
+ /** The zero-based row of the cell; the first row of its merged area. */
2205
+ get rowIndex(): number;
2206
+ /** The zero-based column of the cell; the first column of its merged area. */
2207
+ get columnIndex(): number;
2208
+ /** How many rows the cell spans. */
2209
+ get rowCount(): number;
2210
+ /** How many columns the cell spans. */
2211
+ get columnCount(): number;
2212
+ /** The character format of the cell's text. */
2213
+ get font(): ShapeFont;
2214
+ /** The borders of the cell (`a:tcPr` lines). */
2215
+ get borders(): Borders;
2216
+ /** The margins of the cell (`a:tcPr/@marL` and the like), in points. */
2217
+ get margins(): Margins;
2218
+ /** The cell's fill (`a:tcPr`). */
2219
+ get fill(): ShapeFill;
2220
+ /** The horizontal alignment of the cell's paragraphs (`a:pPr/@algn`). */
2221
+ get horizontalAlignment(): ParagraphHorizontalAlignment | `${ParagraphHorizontalAlignment}` | null;
2222
+ set horizontalAlignment(value: ParagraphHorizontalAlignment | `${ParagraphHorizontalAlignment}` | null);
2223
+ /** The indent level of the cell's paragraphs, from 1; null when they differ. */
2224
+ get indentLevel(): number | null;
2225
+ set indentLevel(value: number | null);
2226
+ /**
2227
+ * The vertical alignment of the cell's text (`a:tcPr/@anchor`); the `…Centered` values also
2228
+ * set `@anchorCtr` (ECMA-376 Part 1, 21.1.3.17).
2229
+ */
2230
+ get verticalAlignment(): TextVerticalAlignment | `${TextVerticalAlignment}`;
2231
+ set verticalAlignment(value: TextVerticalAlignment | `${TextVerticalAlignment}`);
2232
+ /**
2233
+ * The cell's text as runs, each with its own character format. Neighbouring text with the
2234
+ * same format reads as one run, and the run texts join to `text`. A write replaces the text
2235
+ * with the runs in one sync.
2236
+ */
2237
+ get textRuns(): TextRun[];
2238
+ set textRuns(value: TextRun[]);
2239
+ /** Make the cell span `rowCount` rows and `columnCount` columns from its first grid position. */
2240
+ resize(rowCount: number, columnCount: number): void;
2241
+ /** Split the cell into `rowCount` rows and `columnCount` columns of cells. */
2242
+ split(rowCount: number, columnCount: number): void;
2243
+ /** @internal */
2244
+ protected onLoad(request: ResolvedLoadOptions): void;
2245
+ }
2246
+
2247
+ /** Options for `Table.clear`. @public */
2248
+ interface TableClearOptions {
2249
+ all?: boolean;
2250
+ format?: boolean;
2251
+ text?: boolean;
2252
+ }
2253
+ /**
2254
+ * The table of a table shape.
2255
+ *
2256
+ * @public
2257
+ */
2258
+ declare class Table extends ModelObject {
2259
+ #private;
2260
+ /** @internal */
2261
+ constructor(context: RequestContext, path: ObjectPath, shape: Shape);
2262
+ /** The number of columns. */
2263
+ get columnCount(): number;
2264
+ /** The number of rows. */
2265
+ get rowCount(): number;
2266
+ /** The text of each cell, by row then column. A merged area's text is in its first cell. */
2267
+ get values(): string[][];
2268
+ /** The rows. */
2269
+ get rows(): TableRowCollection;
2270
+ /** The columns. */
2271
+ get columns(): TableColumnCollection;
2272
+ /** The style options and the style of the table (`a:tblPr`). */
2273
+ get styleSettings(): TableStyleSettings;
2274
+ /** The merged areas of the table: one cell for each, its first cell, with its span. */
2275
+ getMergedAreas(): TableCellCollection;
2276
+ /** The table shape. */
2277
+ getShape(): Shape;
2278
+ /** A cell by zero-based row and column, or a null object outside the table. */
2279
+ getCellOrNullObject(rowIndex: number, columnIndex: number): TableCell;
2280
+ /** Merge a rectangle of cells into its first cell. */
2281
+ mergeCells(rowIndex: number, columnIndex: number, rowCount: number, columnCount: number): void;
2282
+ /**
2283
+ * Clear the text, the direct format, or both, of every cell. With no options, or `all`, both
2284
+ * go. The direct format is each cell's `a:tcPr` and its paragraph and run properties;
2285
+ * hyperlinks and the table style stay.
2286
+ */
2287
+ clear(options?: TableClearOptions): void;
2288
+ /** @internal */
2289
+ protected onLoad(request: ResolvedLoadOptions): void;
2290
+ }
2291
+ /** The names a row or a column uses. */
2292
+ interface LineKind {
2293
+ readonly target: 'row' | 'column';
2294
+ readonly index: string;
2295
+ readonly size: string;
2296
+ }
2297
+ /** A row or a column of a table. */
2298
+ declare abstract class TableLine extends ModelObject {
2299
+ #private;
2300
+ /** @internal */
2301
+ constructor(context: RequestContext, path: ObjectPath, at: number, size: number, kind: LineKind);
2302
+ /** @internal */
2303
+ protected get target(): 'row' | 'column';
2304
+ /** Delete this line. */
2305
+ delete(): void;
2306
+ /** @internal Set the height or width, in points. */
2307
+ protected writeSize(name: string, value: number): void;
2308
+ /** @internal Values come with the line; a load has nothing more to read. */
2309
+ protected onLoad(request: ResolvedLoadOptions): void;
2310
+ }
2311
+ /**
2312
+ * One row of a table.
2313
+ *
2314
+ * @public
2315
+ */
2316
+ declare class TableRow extends TableLine {
2317
+ /** @internal */
2318
+ constructor(context: RequestContext, path: ObjectPath, at: number, size: number);
2319
+ /** The zero-based row index. */
2320
+ get rowIndex(): number;
2321
+ /** The row height, in points (`a:tr/@h`). */
2322
+ get height(): number;
2323
+ set height(value: number);
2324
+ /** The height of the row as stored, in points. */
2325
+ get currentHeight(): number;
2326
+ }
2327
+ /**
2328
+ * One column of a table.
2329
+ *
2330
+ * @public
2331
+ */
2332
+ declare class TableColumn extends TableLine {
2333
+ /** @internal */
2334
+ constructor(context: RequestContext, path: ObjectPath, at: number, size: number);
2335
+ /** The zero-based column index. */
2336
+ get columnIndex(): number;
2337
+ /** The column width, in points (`a:gridCol/@w`). */
2338
+ get width(): number;
2339
+ set width(value: number);
2340
+ }
2341
+ /** The rows or the columns of a table. */
2342
+ declare abstract class TableLines<T extends TableLine> extends ModelObject {
2343
+ #private;
2344
+ /** @internal */
2345
+ protected abstract get target(): 'row' | 'column';
2346
+ /** @internal */
2347
+ protected abstract make(path: ObjectPath, at: number, size: number): T;
2348
+ /** The loaded lines. */
2349
+ get items(): T[];
2350
+ /** Insert `count` lines at `index`, or at the end. They copy the line before them. */
2351
+ add(index_?: number | null | undefined, count_?: number | undefined): void;
2352
+ /** The number of lines, after the next `sync()`. */
2353
+ getCount(): ClientResult<number>;
2354
+ /** The line at a zero-based position; `ItemNotFound` at the sync when there is none. */
2355
+ getItemAt(index_: number): T;
2356
+ /** @internal Delete lines, last first so the indices stay valid. */
2357
+ protected deleteLines(lines: readonly T[], name: string): void;
2358
+ /** @internal */
2359
+ protected get loadsItemPaths(): boolean;
2360
+ /** @internal */
2361
+ protected onLoad(request: ResolvedLoadOptions): void;
2362
+ }
2363
+ /**
2364
+ * The rows of a table.
2365
+ *
2366
+ * @public
2367
+ */
2368
+ declare class TableRowCollection extends TableLines<TableRow> {
2369
+ /** @internal */
2370
+ constructor(context: RequestContext, path: ObjectPath);
2371
+ /** Delete rows. */
2372
+ deleteRows(rows: TableRow[]): void;
2373
+ /** @internal */
2374
+ protected get target(): 'row';
2375
+ /** @internal */
2376
+ protected make(path: ObjectPath, at: number, size: number): TableRow;
2377
+ }
2378
+ /**
2379
+ * The columns of a table.
2380
+ *
2381
+ * @public
2382
+ */
2383
+ declare class TableColumnCollection extends TableLines<TableColumn> {
2384
+ /** @internal */
2385
+ constructor(context: RequestContext, path: ObjectPath);
2386
+ /** Delete columns. */
2387
+ deleteColumns(columns: TableColumn[]): void;
2388
+ /** @internal */
2389
+ protected get target(): 'column';
2390
+ /** @internal */
2391
+ protected make(path: ObjectPath, at: number, size: number): TableColumn;
2392
+ }
2393
+ /**
2394
+ * The merged areas of a table, from `Table.getMergedAreas`. Each item is the first cell of one
2395
+ * area, and its `rowCount` and `columnCount` give the span.
2396
+ *
2397
+ * @public
2398
+ */
2399
+ declare class TableCellCollection extends ModelObject {
2400
+ #private;
2401
+ /** @internal */
2402
+ constructor(context: RequestContext, path: ObjectPath);
2403
+ /** The loaded cells. */
2404
+ get items(): TableCell[];
2405
+ /** The number of merged areas, after the next `sync()`. */
2406
+ getCount(): ClientResult<number>;
2407
+ /**
2408
+ * The merged area that holds the cell at a zero-based row and column of the table, as its
2409
+ * first cell, or a null object when no merged area holds that cell.
2410
+ */
2411
+ getItemAtOrNullObject(row: number, column: number): TableCell;
2412
+ /** @internal */
2413
+ protected get loadsItemPaths(): boolean;
2414
+ /** @internal */
2415
+ protected onLoad(request: ResolvedLoadOptions): void;
2416
+ }
2417
+
2418
+ /**
2419
+ * One line of a cell, for `TableCellBorders`.
2420
+ *
2421
+ * @public
2422
+ */
2423
+ interface BorderProperties {
2424
+ /** `#RRGGBB` or a preset color name. */
2425
+ color?: string | undefined;
2426
+ dashStyle?: ShapeLineDashStyle | `${ShapeLineDashStyle}` | undefined;
2427
+ /** From 0 (opaque) to 1 (clear). */
2428
+ transparency?: number | undefined;
2429
+ /** Points. */
2430
+ weight?: number | undefined;
2431
+ }
2432
+ /**
2433
+ * The lines of a cell, for `TableCellProperties`.
2434
+ *
2435
+ * @public
2436
+ */
2437
+ interface TableCellBorders {
2438
+ bottom?: BorderProperties | undefined;
2439
+ diagonalDown?: BorderProperties | undefined;
2440
+ diagonalUp?: BorderProperties | undefined;
2441
+ left?: BorderProperties | undefined;
2442
+ right?: BorderProperties | undefined;
2443
+ top?: BorderProperties | undefined;
2444
+ }
2445
+ /**
2446
+ * The margins of a cell in points, for `TableCellProperties`.
2447
+ *
2448
+ * @public
2449
+ */
2450
+ interface TableCellMargins {
2451
+ bottom?: number | undefined;
2452
+ left?: number | undefined;
2453
+ right?: number | undefined;
2454
+ top?: number | undefined;
2455
+ }
2456
+ /**
2457
+ * A solid fill, for `TableCellProperties`.
2458
+ *
2459
+ * @public
2460
+ */
2461
+ interface FillProperties {
2462
+ /** `#RRGGBB` or a preset color name. */
2463
+ color?: string | undefined;
2464
+ /** From 0 (opaque) to 1 (clear). */
2465
+ transparency?: number | undefined;
2466
+ }
2467
+ /**
2468
+ * The format and content of a cell, for `TableAddOptions`.
2469
+ *
2470
+ * @public
2471
+ */
2472
+ interface TableCellProperties {
2473
+ borders?: TableCellBorders | undefined;
2474
+ fill?: FillProperties | undefined;
2475
+ font?: FontProperties | undefined;
2476
+ horizontalAlignment?: ParagraphHorizontalAlignment | `${ParagraphHorizontalAlignment}` | undefined;
2477
+ indentLevel?: number | undefined;
2478
+ margins?: TableCellMargins | undefined;
2479
+ text?: string | undefined;
2480
+ textRuns?: TextRun[] | undefined;
2481
+ verticalAlignment?: TextVerticalAlignment | `${TextVerticalAlignment}` | undefined;
2482
+ }
2483
+ /**
2484
+ * One column of a new table, for `TableAddOptions`.
2485
+ *
2486
+ * @public
2487
+ */
2488
+ interface TableColumnProperties {
2489
+ /** Points. */
2490
+ columnWidth?: number | undefined;
2491
+ }
2492
+ /**
2493
+ * One row of a new table, for `TableAddOptions`.
2494
+ *
2495
+ * @public
2496
+ */
2497
+ interface TableRowProperties {
2498
+ /** Points. */
2499
+ rowHeight?: number | undefined;
2500
+ }
2501
+ /**
2502
+ * One merged area of a new table, for `TableAddOptions`.
2503
+ *
2504
+ * @public
2505
+ */
2506
+ interface TableMergedAreaProperties {
2507
+ columnCount: number;
2508
+ columnIndex: number;
2509
+ rowCount: number;
2510
+ rowIndex: number;
2511
+ }
2512
+ /**
2513
+ * Options for `ShapeCollection.addTable`. They apply in this order: `values`, `style`, the
2514
+ * column widths and row heights, `mergedAreas`, `uniformCellProperties`, then
2515
+ * `specificCellProperties`.
2516
+ *
2517
+ * @public
2518
+ */
2519
+ interface TableAddOptions {
2520
+ /** One entry for each column. */
2521
+ columns?: TableColumnProperties[] | undefined;
2522
+ height?: number | undefined;
2523
+ left?: number | undefined;
2524
+ mergedAreas?: TableMergedAreaProperties[] | undefined;
2525
+ /** One entry for each row. */
2526
+ rows?: TableRowProperties[] | undefined;
2527
+ /** The properties of each cell, by row then column. Its size must equal the table's. */
2528
+ specificCellProperties?: TableCellProperties[][] | undefined;
2529
+ style?: TableStyle | `${TableStyle}` | undefined;
2530
+ top?: number | undefined;
2531
+ /** The properties of every cell. */
2532
+ uniformCellProperties?: TableCellProperties | undefined;
2533
+ /** The text of each cell, by row then column. Its size must equal the table's. */
2534
+ values?: string[][] | undefined;
2535
+ width?: number | undefined;
2536
+ }
2537
+
2538
+ /**
2539
+ * Where a new shape goes, in points from the top left of the slide.
2540
+ *
2541
+ * @public
2542
+ */
2543
+ interface ShapeAddOptions {
2544
+ height?: number;
2545
+ left?: number;
2546
+ top?: number;
2547
+ width?: number;
2548
+ }
2549
+ /**
2550
+ * A shape on a slide, layout, or master: a geometric shape, a text box, a picture, a line, a
2551
+ * group, a table, or another graphic frame.
2552
+ *
2553
+ * @public
2554
+ */
2555
+ declare class Shape extends ModelObject {
2556
+ #private;
2557
+ /** @internal */
2558
+ constructor(context: RequestContext, path: ObjectPath, nullable?: boolean);
2559
+ /** The shape id (`p:cNvPr/@id`), unique on its slide. */
2560
+ get id(): string;
2561
+ /** The shape name (`p:cNvPr/@name`). */
2562
+ get name(): string;
2563
+ set name(value: string);
2564
+ /** What kind of shape this is. */
2565
+ get type(): ShapeType | `${ShapeType}`;
2566
+ /** The distance from the left edge of the slide, in points. */
2567
+ get left(): number;
2568
+ set left(value: number);
2569
+ /** The distance from the top edge of the slide, in points. */
2570
+ get top(): number;
2571
+ set top(value: number);
2572
+ /** The width, in points. */
2573
+ get width(): number;
2574
+ set width(value: number);
2575
+ /** The height, in points. */
2576
+ get height(): number;
2577
+ set height(value: number);
2578
+ /** The rotation, in degrees clockwise. */
2579
+ get rotation(): number;
2580
+ set rotation(value: number);
2581
+ /** Whether the shape shows (`p:cNvPr/@hidden` is not set). */
2582
+ get visible(): boolean;
2583
+ set visible(value: boolean);
2584
+ /** The zero-based position in the z-order of its parent. */
2585
+ get zOrderPosition(): number;
2586
+ /** How deep in groups the shape is: 0 at the top level. */
2587
+ get level(): number;
2588
+ /** The alternative text title (`p:cNvPr/@title`). */
2589
+ get altTextTitle(): string;
2590
+ set altTextTitle(value: string);
2591
+ /** The alternative text description (`p:cNvPr/@descr`). */
2592
+ get altTextDescription(): string;
2593
+ set altTextDescription(value: string);
2594
+ /** Whether the shape is decorative, so readers of alternative text skip it. */
2595
+ get isDecorative(): boolean;
2596
+ set isDecorative(value: boolean);
2597
+ /** The creation id of the shape. The file format has none, so this reads `null`. */
2598
+ get creationId(): string | null;
2599
+ /** The adjust values of the shape's preset geometry (`a:prstGeom/a:avLst`). */
2600
+ get adjustments(): Adjustments;
2601
+ /** The fill of the shape. */
2602
+ get fill(): ShapeFill;
2603
+ /** The outline of the shape. */
2604
+ get lineFormat(): ShapeLineFormat;
2605
+ /** The text frame. `NotSupported` at the sync for a shape that holds no text. */
2606
+ get textFrame(): TextFrame;
2607
+ /** The tags of the shape. */
2608
+ get tags(): TagCollection;
2609
+ /** The custom XML parts of the shape. */
2610
+ get customXmlParts(): CustomXmlPartCollection;
2611
+ /** The group this shape is, for a group shape. */
2612
+ get group(): ShapeGroup;
2613
+ /** The placeholder properties, for a placeholder. */
2614
+ get placeholderFormat(): PlaceholderFormat;
2615
+ /** The group that holds this shape. `ItemNotFound` at the sync for a shape at the top level. */
2616
+ get parentGroup(): Shape;
2617
+ /** Delete the shape. */
2618
+ delete(): void;
2619
+ /**
2620
+ * A PNG picture of the shape, without the slide behind it, as base64, drawn by the editor's
2621
+ * own renderer. A runtime over a live editor in a browser draws pictures, and so does a server
2622
+ * runtime created with a `rasterize` option; any other runtime refuses with `NotSupported`.
2623
+ *
2624
+ * @example
2625
+ * ```ts
2626
+ * const image = shape.getImageAsBase64({ width: 640 });
2627
+ * await context.sync();
2628
+ * const png = `data:image/png;base64,${image.value}`;
2629
+ * ```
2630
+ */
2631
+ getImageAsBase64(options?: ShapeGetImageOptions): ClientResult<string>;
2632
+ /** The slide the shape is on; `ItemNotFound` at the sync for a layout or master shape. */
2633
+ getParentSlide(): Slide;
2634
+ /** The slide the shape is on, or a null object. */
2635
+ getParentSlideOrNullObject(): Slide;
2636
+ /** The layout the shape is on; `ItemNotFound` at the sync for any other shape. */
2637
+ getParentSlideLayout(): SlideLayout;
2638
+ /** The layout the shape is on, or a null object. */
2639
+ getParentSlideLayoutOrNullObject(): SlideLayout;
2640
+ /** The master the shape is on; `ItemNotFound` at the sync for any other shape. */
2641
+ getParentSlideMaster(): SlideMaster;
2642
+ /** The master the shape is on, or a null object. */
2643
+ getParentSlideMasterOrNullObject(): SlideMaster;
2644
+ /** The table of a table shape. `NotSupported` at the sync for any other shape. */
2645
+ getTable(): Table;
2646
+ /** The text frame, or a null object for a shape that holds no text. */
2647
+ getTextFrameOrNullObject(): TextFrame;
2648
+ /** Set the click link of the whole shape. */
2649
+ setHyperlink(options?: HyperlinkAddOptions): Hyperlink;
2650
+ /** Move the shape in the z-order of its parent. */
2651
+ setZOrder(position: ShapeZOrder): void;
2652
+ /** Move the shape in the z-order of its parent. */
2653
+ setZOrder(position: 'BringForward' | 'BringToFront' | 'SendBackward' | 'SendToBack'): void;
2654
+ /** @internal */
2655
+ protected onLoad(request: ResolvedLoadOptions): void;
2656
+ }
2657
+ /** What a shape collection lists: a container's shapes, or the reader's selected shapes. */
2658
+ type ShapeSource = {
2659
+ readonly kind: 'container';
2660
+ readonly container: ObjectPath;
2661
+ } | {
2662
+ readonly kind: 'selection';
2663
+ };
2664
+ /** The members both shape collections share. */
2665
+ declare abstract class ShapeList extends ItemCollection<Shape> {
2666
+ /** @internal */
2667
+ protected abstract readonly source: ShapeSource;
2668
+ /** A shape by id; `ItemNotFound` at the sync when there is none. */
2669
+ getItem(key: string): Shape;
2670
+ /** A shape by zero-based position in the z-order. */
2671
+ getItemAt(index: number): Shape;
2672
+ /** A shape by id, or a null object. */
2673
+ getItemOrNullObject(id: string): Shape;
2674
+ /** @internal */
2675
+ protected listing(ref: RefOf): AutomationOperation;
2676
+ /** @internal */
2677
+ protected handlesOf(value: AutomationValue, label: string): readonly AutomationHandle[];
2678
+ /** @internal */
2679
+ protected get hasLookup(): boolean;
2680
+ /** @internal */
2681
+ protected itemOf(path: ObjectPath, nullable: boolean): Shape;
2682
+ /** @internal */
2683
+ protected lookup(ref: RefOf, key: AutomationItemKey, orNull: boolean): AutomationOperation | undefined;
2684
+ /** @internal Queue the group of `shapes` and answer the new group shape. */
2685
+ protected groupOf(shapes: readonly (() => ObjectPath[])[], name: string): Shape;
2686
+ }
2687
+ /**
2688
+ * The shapes of a slide, layout, master, or group, in z-order.
2689
+ *
2690
+ * @public
2691
+ */
2692
+ declare class ShapeCollection extends ShapeList {
2693
+ #private;
2694
+ /** @internal */
2695
+ protected readonly source: ShapeSource;
2696
+ /** @internal */
2697
+ constructor(context: RequestContext, path: ObjectPath, container: ObjectPath);
2698
+ /** Add a preset geometric shape (`a:prstGeom`, ECMA-376 Part 1, 20.1.9.18). */
2699
+ addGeometricShape(geometricShapeType: GeometricShapeType, options?: ShapeAddOptions): Shape;
2700
+ /** Add a preset geometric shape (`a:prstGeom`, ECMA-376 Part 1, 20.1.9.18). */
2701
+ addGeometricShape(geometricShapeType: `${GeometricShapeType}`, options?: ShapeAddOptions): Shape;
2702
+ /** Add a line or connector (`p:cxnSp`). */
2703
+ addLine(connectorType?: ConnectorType, options?: ShapeAddOptions): Shape;
2704
+ /** Add a line or connector (`p:cxnSp`). */
2705
+ addLine(connectorType?: 'Straight' | 'Elbow' | 'Curve', options?: ShapeAddOptions): Shape;
2706
+ /** Add a text box with `text`. */
2707
+ addTextBox(text_: string, options?: ShapeAddOptions): Shape;
2708
+ /** Add a table (`a:tbl` in a graphic frame) of `rowCount` rows and `columnCount` columns. */
2709
+ addTable(rowCount: number, columnCount: number, options?: TableAddOptions): Shape;
2710
+ /** Group shapes of this collection, by shape or by id. Answers the new group. */
2711
+ addGroup(values: Array<string | Shape>): Shape;
2712
+ }
2713
+ /**
2714
+ * A set of shapes: the reader's selection, or the members of a group.
2715
+ *
2716
+ * @public
2717
+ */
2718
+ declare class ShapeScopedCollection extends ShapeList {
2719
+ /** @internal */
2720
+ protected readonly source: ShapeSource;
2721
+ /** @internal */
2722
+ constructor(context: RequestContext, path: ObjectPath, source: ShapeSource);
2723
+ /**
2724
+ * Group the shapes of this collection and answer the new group. The items need no load: when
2725
+ * a completed load has not filled them in, the sync reads them first, in an earlier round at
2726
+ * the same revision, and then groups them.
2727
+ */
2728
+ group(): Shape;
2729
+ }
2730
+ /**
2731
+ * A group shape (`p:grpSp`).
2732
+ *
2733
+ * @public
2734
+ */
2735
+ declare class ShapeGroup extends ModelObject {
2736
+ #private;
2737
+ /** @internal */
2738
+ constructor(context: RequestContext, path: ObjectPath, shape: Shape);
2739
+ /** The id of the group shape. */
2740
+ get id(): string;
2741
+ /** The creation id. The file format has none, so this reads `null`. */
2742
+ get creationId(): string | null;
2743
+ /** The group as a shape. */
2744
+ get shape(): Shape;
2745
+ /** The members of the group, in z-order. */
2746
+ get shapes(): ShapeScopedCollection;
2747
+ /** Ungroup: the members move to the group's parent, and the group is deleted. */
2748
+ ungroup(): void;
2749
+ /** @internal */
2750
+ protected onLoad(request: ResolvedLoadOptions): void;
2751
+ }
2752
+ /**
2753
+ * The placeholder properties of a shape (`p:ph`, ECMA-376 Part 1, 19.3.1.36).
2754
+ *
2755
+ * @public
2756
+ */
2757
+ declare class PlaceholderFormat extends ModelObject {
2758
+ #private;
2759
+ /** @internal */
2760
+ constructor(context: RequestContext, path: ObjectPath, shape: ObjectPath);
2761
+ /** The placeholder type. A shape that is no placeholder reads `Unsupported`. */
2762
+ get type(): PlaceholderType | `${PlaceholderType}`;
2763
+ /** The kind of content the placeholder holds, or null for a shape placeholder. */
2764
+ get containedType(): ShapeType | `${ShapeType}` | null;
2765
+ /** @internal */
2766
+ protected onLoad(request: ResolvedLoadOptions): void;
2767
+ }
2768
+
2769
+ /**
2770
+ * A binding: an id that names one shape for the lifetime of the runtime.
2771
+ *
2772
+ * @public
2773
+ */
2774
+ declare class Binding extends ModelObject {
2775
+ #private;
2776
+ /**
2777
+ * @internal The path resolves to the presentation; the id names the binding. An empty id: a
2778
+ * lookup by position that has not answered, and nothing is loaded until it does.
2779
+ */
2780
+ constructor(context: RequestContext, path: ObjectPath, id: string, nullable?: boolean);
2781
+ /** The id of the binding. */
2782
+ get id(): string;
2783
+ /** What the binding names. Always `Shape`. */
2784
+ get type(): 'Shape' | BindingType;
2785
+ /** Delete the binding. The shape stays. */
2786
+ delete(): void;
2787
+ /** The shape the binding names. A binding whose shape is gone refuses with `ItemNotFound`. */
2788
+ getShape(): Shape;
2789
+ /** @internal The id and the type come with the object; a load has nothing more to read. */
2790
+ protected onLoad(request: ResolvedLoadOptions): void;
2791
+ }
2792
+ /**
2793
+ * The bindings of the runtime, in the order they were added. They live in memory and are never
2794
+ * saved with the presentation.
2795
+ *
2796
+ * @example
2797
+ * ```ts
2798
+ * await runtime.run(async (context) => {
2799
+ * const shape = context.presentation.slides.getItemAt(0).shapes.getItemAt(0);
2800
+ * context.presentation.bindings.add(shape, 'Shape', 'title');
2801
+ * await context.sync();
2802
+ * });
2803
+ * ```
2804
+ *
2805
+ * @public
2806
+ */
2807
+ declare class BindingCollection extends ModelObject {
2808
+ #private;
2809
+ /** @internal */
2810
+ constructor(context: RequestContext, path: ObjectPath);
2811
+ /** The loaded bindings. */
2812
+ get items(): Binding[];
2813
+ /** Bind a shape under `id`. A binding that has that id moves to the shape. */
2814
+ add(shape: Shape, bindingType: BindingType, id: string): Binding;
2815
+ /** Bind a shape under `id`. A binding that has that id moves to the shape. */
2816
+ add(shape: Shape, bindingType: 'Shape', id: string): Binding;
2817
+ /**
2818
+ * Bind the one selected shape under `id`. Needs a runtime over a live editor; any selection
2819
+ * other than one shape refuses with `InvalidArgument`.
2820
+ */
2821
+ addFromSelection(bindingType: BindingType, id: string): Binding;
2822
+ /**
2823
+ * Bind the one selected shape under `id`. Needs a runtime over a live editor; any selection
2824
+ * other than one shape refuses with `InvalidArgument`.
2825
+ */
2826
+ addFromSelection(bindingType: 'Shape', id: string): Binding;
2827
+ /** The number of bindings, after the next `sync()`. */
2828
+ getCount(): ClientResult<number>;
2829
+ /** The binding with this id; `ItemNotFound` at the sync when there is none. */
2830
+ getItem(key: string): Binding;
2831
+ /** The binding at a zero-based position; `ItemNotFound` at the sync when there is none. */
2832
+ getItemAt(index: number): Binding;
2833
+ /** The binding with this id, or a null object. */
2834
+ getItemOrNullObject(key: string): Binding;
2835
+ /** @internal */
2836
+ protected get loadsItemPaths(): boolean;
2837
+ /** @internal */
2838
+ protected onLoad(request: ResolvedLoadOptions): void;
2839
+ }
2840
+
2841
+ /**
2842
+ * One custom document property: a key, a type, and a value.
2843
+ *
2844
+ * @public
2845
+ */
2846
+ declare class CustomProperty extends ModelObject {
2847
+ #private;
2848
+ /** @internal */
2849
+ constructor(context: RequestContext, path: ObjectPath, owner: ObjectPath, key: string, nullable?: boolean);
2850
+ /** The key. Lookups compare keys without case. */
2851
+ get key(): string;
2852
+ /** The type of the value. */
2853
+ get type(): DocumentPropertyType | 'Boolean' | 'Date' | 'Number' | 'String';
2854
+ /** The value. A write of another JavaScript type changes the type too. */
2855
+ get value(): boolean | Date | number | string;
2856
+ set value(value: boolean | Date | number | string);
2857
+ /** Delete the property. */
2858
+ delete(): void;
2859
+ /** @internal */
2860
+ protected onLoad(request: ResolvedLoadOptions): void;
2861
+ }
2862
+ /**
2863
+ * The custom document properties of the presentation.
2864
+ *
2865
+ * @example
2866
+ * ```ts
2867
+ * await runtime.run(async (context) => {
2868
+ * const custom = context.presentation.properties.customProperties;
2869
+ * custom.add('Client', 'Northwind');
2870
+ * custom.add('Reviewed', new Date());
2871
+ * await context.sync();
2872
+ * });
2873
+ * ```
2874
+ *
2875
+ * @public
2876
+ */
2877
+ declare class CustomPropertyCollection extends ModelObject {
2878
+ #private;
2879
+ /** @internal */
2880
+ constructor(context: RequestContext, path: ObjectPath);
2881
+ /** The loaded properties. */
2882
+ get items(): CustomProperty[];
2883
+ /** Add a property, or set the value and type of the property with this key. */
2884
+ add(key: string, value: boolean | Date | number | string): CustomProperty;
2885
+ /** Delete every listed property. A property of another variant type stays. */
2886
+ deleteAll(): void;
2887
+ /** The number of properties, after the next `sync()`. */
2888
+ getCount(): ClientResult<number>;
2889
+ /** The property with this key; `ItemNotFound` at the sync when there is none. */
2890
+ getItem(key: string): CustomProperty;
2891
+ /** The property at a zero-based position; `ItemNotFound` at the sync when there is none. */
2892
+ getItemAt(index: number): CustomProperty;
2893
+ /** The property with this key, or a null object. */
2894
+ getItemOrNullObject(key: string): CustomProperty;
2895
+ /** @internal */
2896
+ protected get loadsItemPaths(): boolean;
2897
+ /** @internal */
2898
+ protected onLoad(request: ResolvedLoadOptions): void;
2899
+ }
2900
+
2901
+ /**
2902
+ * Options for `Presentation.insertSlidesFromBase64`.
2903
+ *
2904
+ * @public
2905
+ */
2906
+ interface InsertSlideOptions {
2907
+ /** How the inserted slides are formatted. */
2908
+ formatting?: InsertSlideFormatting | `${InsertSlideFormatting}` | undefined;
2909
+ /** The slides of the source presentation to insert, by id. */
2910
+ sourceSlideIds?: string[];
2911
+ /** The slide the new slides follow, by id. */
2912
+ targetSlideId?: string;
2913
+ }
2914
+ /**
2915
+ * The presentation: its slides, masters, tags, properties, and page setup.
2916
+ *
2917
+ * @example
2918
+ * ```ts
2919
+ * await runtime.run(async (context) => {
2920
+ * const slides = context.presentation.slides;
2921
+ * slides.load('items/id');
2922
+ * await context.sync();
2923
+ * console.log(slides.items.map((slide) => slide.id));
2924
+ * });
2925
+ * ```
2926
+ *
2927
+ * @public
2928
+ */
2929
+ declare class Presentation extends ModelObject {
2930
+ #private;
2931
+ /** @internal */
2932
+ private constructor();
2933
+ /** @internal The presentation of a request context, with a lookup queued at first use. */
2934
+ static open(context: RequestContext): Presentation;
2935
+ /** The id of the presentation. */
2936
+ get id(): string;
2937
+ /** The title of the presentation, from the core properties. */
2938
+ get title(): string;
2939
+ /** The slides, in order. */
2940
+ get slides(): SlideCollection;
2941
+ /** The slide masters, in order. */
2942
+ get slideMasters(): SlideMasterCollection;
2943
+ /** The tags of the presentation. */
2944
+ get tags(): TagCollection;
2945
+ /** The custom XML parts of the presentation. */
2946
+ get customXmlParts(): CustomXmlPartCollection;
2947
+ /**
2948
+ * The bindings of this runtime: ids that name shapes. They live in memory for the lifetime of
2949
+ * the runtime and are never saved with the presentation.
2950
+ */
2951
+ get bindings(): BindingCollection;
2952
+ /** The document properties (title, author, …). */
2953
+ get properties(): DocumentProperties;
2954
+ /** The slide size. */
2955
+ get pageSetup(): PageSetup;
2956
+ /** The selected slides of the reader. A server runtime refuses with `NotSupported`. */
2957
+ getSelectedSlides(): SlideScopedCollection;
2958
+ /** The selected shapes of the reader. A server runtime refuses with `NotSupported`. */
2959
+ getSelectedShapes(): ShapeScopedCollection;
2960
+ /** The selected text. `ItemNotFound` at the sync when no text is selected. */
2961
+ getSelectedTextRange(): TextRange;
2962
+ /** The selected text, or a null object when no text is selected. */
2963
+ getSelectedTextRangeOrNullObject(): TextRange;
2964
+ /** Select slides by id. A server runtime refuses with `NotSupported`. */
2965
+ setSelectedSlides(slideIds: string[]): void;
2966
+ /**
2967
+ * Insert the slides of another presentation, given as Base64-encoded PPTX bytes. Each slide
2968
+ * comes with its notes, pictures, media, charts, and other parts. With `KeepSourceFormatting`
2969
+ * (the default), its layout, master, and theme come too; with `UseDestinationTheme`, it goes on
2970
+ * the layout of this presentation with the same type. Without `targetSlideId`, the slides go
2971
+ * first. Comments come along, with their authors merged by name and initials. An unknown slide
2972
+ * id refuses with `ItemNotFound`; a slide with threaded comments or an embedded control refuses
2973
+ * with `NotSupported`, naming the slide ids. Nothing changes when the call is refused.
2974
+ *
2975
+ * @example
2976
+ * ```ts
2977
+ * await runtime.run(async (context) => {
2978
+ * context.presentation.insertSlidesFromBase64(base64, {
2979
+ * formatting: 'UseDestinationTheme',
2980
+ * targetSlideId: '256',
2981
+ * });
2982
+ * await context.sync();
2983
+ * });
2984
+ * ```
2985
+ */
2986
+ insertSlidesFromBase64(base64File: string, options?: InsertSlideOptions): void;
2987
+ /** @internal */
2988
+ protected onLoad(request: ResolvedLoadOptions): void;
2989
+ }
2990
+ /**
2991
+ * The core and extended document properties (`docProps/core.xml`, `docProps/app.xml`).
2992
+ *
2993
+ * @public
2994
+ */
2995
+ declare class DocumentProperties extends ModelObject {
2996
+ #private;
2997
+ /** @internal */
2998
+ constructor(context: RequestContext, path: ObjectPath);
2999
+ /** The custom document properties (`docProps/custom.xml`). */
3000
+ get customProperties(): CustomPropertyCollection;
3001
+ get author(): string;
3002
+ set author(value: string);
3003
+ get category(): string;
3004
+ set category(value: string);
3005
+ get comments(): string;
3006
+ set comments(value: string);
3007
+ get company(): string;
3008
+ set company(value: string);
3009
+ /**
3010
+ * When the presentation was created, from `dcterms:created`. Without one, or with a value
3011
+ * that is not a date, it is an invalid `Date`: check `Number.isNaN(creationDate.getTime())`.
3012
+ */
3013
+ get creationDate(): Date;
3014
+ get keywords(): string;
3015
+ set keywords(value: string);
3016
+ get lastAuthor(): string;
3017
+ get manager(): string;
3018
+ set manager(value: string);
3019
+ get revisionNumber(): number;
3020
+ set revisionNumber(value: number);
3021
+ get subject(): string;
3022
+ set subject(value: string);
3023
+ get title(): string;
3024
+ set title(value: string);
3025
+ /** @internal */
3026
+ protected onLoad(request: ResolvedLoadOptions): void;
3027
+ }
3028
+ /**
3029
+ * The slide size, in points (`p:sldSz`, ECMA-376 Part 1, 19.2.1.39).
3030
+ *
3031
+ * @public
3032
+ */
3033
+ declare class PageSetup extends ModelObject {
3034
+ /** @internal */
3035
+ constructor(context: RequestContext, path: ObjectPath);
3036
+ get slideHeight(): number;
3037
+ set slideHeight(value: number);
3038
+ get slideWidth(): number;
3039
+ set slideWidth(value: number);
3040
+ /** @internal */
3041
+ protected onLoad(request: ResolvedLoadOptions): void;
3042
+ }
3043
+
3044
+ /**
3045
+ * The objects a context keeps addressable beyond the run that created them.
3046
+ *
3047
+ * An ordinary proxy stops being usable when its run ends. Tracking one keeps its address alive so
3048
+ * a later `run(object, callback)` can adopt it, and untracking releases it — which matters for
3049
+ * long-lived callers, since a tracked object is a presentation reference that will not be collected
3050
+ * on its own.
3051
+ *
3052
+ * @public
3053
+ */
3054
+ declare class TrackedObjects {
3055
+ #private;
3056
+ /** @internal Built by the static factories above, never directly. */
3057
+ constructor(internals: ContextInternals, owns: (object: ClientObject) => boolean);
3058
+ /** Keep these objects usable after this run ends. */
3059
+ add(object: ClientObject | readonly ClientObject[]): void;
3060
+ /** Stop keeping them: they are released when this run ends, like any other object. */
3061
+ remove(object: ClientObject | readonly ClientObject[]): void;
3062
+ }
3063
+
3064
+ /** What a context needs from the runtime that made it. */
3065
+ interface RuntimeSession {
3066
+ readonly host: AutomationHost;
3067
+ readonly capabilities: PresentationCapabilities;
3068
+ /** Told about each refused batch before it is thrown. A listener that throws is ignored. */
3069
+ readonly onRefusal?: (error: PptxEditorError, operations: readonly AutomationOperation[]) => void;
3070
+ /**
3071
+ * Told about each batch that threw an error other than a refusal, before it propagates: an
3072
+ * engine defect. A listener that throws is ignored.
3073
+ */
3074
+ readonly onException?: (error: unknown, operations: readonly AutomationOperation[]) => void;
3075
+ /** Identity for adoption checks. */
3076
+ readonly id: object;
3077
+ /** Refuse if the runtime has been disposed. */
3078
+ assertLive(target?: string): void;
3079
+ /** Build the presentation proxy for a context. Injected, so this module does not import it. */
3080
+ openPresentation(context: RequestContext): Presentation;
3081
+ /** Build the application proxy for a context. Injected for the same reason. */
3082
+ openApplication(context: RequestContext): Application;
3083
+ /** The Office.js type name of an object of the model, for `loadRecursive`. */
3084
+ typeName(object: ClientObject): string | undefined;
3085
+ /** Every type name `loadRecursive` takes. */
3086
+ readonly typeNames: readonly string[];
3087
+ }
3088
+ /**
3089
+ * Debug information about a request context, as Office.js `OfficeExtension.RequestContextDebugInfo`.
3090
+ *
3091
+ * @public
3092
+ */
3093
+ interface RequestContextDebugInfo {
3094
+ /**
3095
+ * What the next `sync()` sends, in order: the consumer-facing path of each queued call, such
3096
+ * as `presentation.slides.getItemAt(0).load`, and the message of each `trace` call. Never a
3097
+ * handle or presentation content.
3098
+ */
3099
+ pendingStatements: string[];
3100
+ }
3101
+ /**
3102
+ * The Office.js `OfficeExtension.ClientRequestContext`: here the same class as
3103
+ * {@link RequestContext}, under the name that code written for Office.js uses for the base of
3104
+ * every request context.
3105
+ *
3106
+ * @public
3107
+ */
3108
+ type ClientRequestContext = RequestContext;
3109
+ /**
3110
+ * What a `run` hands its callback: one queue, one presentation, one sync at a time.
3111
+ *
3112
+ * `sync()` sends every queued call as one atomic batch: all of it applies, or none of it. A
3113
+ * context that has READ remembers the revision it read at, and a later sync that writes is
3114
+ * conditional on it, failing `StaleDocument` if another writer moved the presentation. A context
3115
+ * that has read nothing writes unconditionally.
3116
+ *
3117
+ * @public
3118
+ */
3119
+ declare class RequestContext {
3120
+ #private;
3121
+ private constructor();
3122
+ /** The presentation this run is against: the same object for the life of the context. */
3123
+ get presentation(): Presentation;
3124
+ /** The application the presentation is open in. It has no properties or methods. */
3125
+ get application(): Application;
3126
+ /** What the next `sync()` sends, for debugging. See {@link RequestContextDebugInfo}. */
3127
+ get debugInfo(): RequestContextDebugInfo;
3128
+ /** What the presentation host behind this context can do. */
3129
+ get capabilities(): PresentationCapabilities;
3130
+ /** Objects kept addressable past the run that created them. See {@link TrackedObjects}. */
3131
+ get trackedObjects(): TrackedObjects;
3132
+ /** Queue a load on `object`, as Office.js `context.load(object, option)`. */
3133
+ load<T extends ClientObject>(object: T, option?: LoadOption): T;
3134
+ /**
3135
+ * Queue loads on `object` and on the objects its loads reach, by type: each object whose
3136
+ * Office.js type name is a key of `options` loads that option, and the objects its load
3137
+ * fills in (navigation properties and collection items) go on, down to `maxDepth` levels
3138
+ * below `object` (at most 32, which is also the default). An object whose type is not a key
3139
+ * loads nothing and stops the walk there. Everything loads in the next `sync()`; each level
3140
+ * costs one more host batch.
3141
+ *
3142
+ * @example
3143
+ * ```ts
3144
+ * context.loadRecursive(context.presentation.slides, {
3145
+ * SlideCollection: 'items',
3146
+ * Slide: 'id,shapes',
3147
+ * ShapeCollection: 'items',
3148
+ * Shape: 'name',
3149
+ * });
3150
+ * await context.sync();
3151
+ * ```
3152
+ */
3153
+ loadRecursive(object: ClientObject, options: {
3154
+ [typeName: string]: LoadOption | string | string[];
3155
+ }, maxDepth?: number): void;
3156
+ /**
3157
+ * Queue a trace message. A sync that fails gives the messages queued before the failed call
3158
+ * in `error.traceMessages`, as Office.js does. The message goes nowhere else.
3159
+ */
3160
+ trace(message: string): void;
3161
+ /**
3162
+ * Send everything queued as one atomic batch, then hydrate the answers. An empty queue is not
3163
+ * a round trip, so a defensive `sync()` at the end of a run costs nothing.
3164
+ *
3165
+ * A sync called while an earlier one is in flight takes the calls queued so far at once and
3166
+ * sends them when the earlier sync has settled, so syncs apply in the order they were called
3167
+ * and no call moves to another batch. A refused sync does not stop the syncs after it.
3168
+ *
3169
+ * As in Office.js, a refused sync that the caller does not await or catch is an unhandled
3170
+ * rejection: the returned promise is the only one that carries the refusal.
3171
+ */
3172
+ sync<T>(passThroughValue?: T): Promise<T>;
3173
+ /** @internal The seam proxies reach the context through. */
3174
+ get [INTERNALS](): ContextInternals;
3175
+ /** @internal Only `run` may build one, and only `run` may end one. */
3176
+ static begin(session: RuntimeSession): {
3177
+ context: RequestContext;
3178
+ adopt: (objects: readonly ClientObject[]) => void;
3179
+ idle: () => Promise<void>;
3180
+ /** `completed`: the callback returned, so calls still queued are a mistake worth a warning. */
3181
+ finish: (completed?: boolean) => void;
3182
+ };
3183
+ }
3184
+
3185
+ declare const INTERNALS: unique symbol;
3186
+ declare const RELEASE: unique symbol;
3187
+ declare const REBIND: unique symbol;
3188
+ declare const PATH: unique symbol;
3189
+ declare const LOAD_REQUEST: unique symbol;
3190
+ declare const DEFER_REFUSAL: unique symbol;
3191
+ declare const LOADED_VALUES: unique symbol;
3192
+ /** What a proxy may ask of the context it belongs to. */
3193
+ interface ContextInternals {
3194
+ readonly host: AutomationHost;
3195
+ readonly capabilities: AutomationCapabilities;
3196
+ readonly queue: ActionQueue;
3197
+ /**
3198
+ * Identity of the runtime behind this context. Compared, never called: it is how adoption
3199
+ * refuses an object minted by another runtime, whose handles name another presentation.
3200
+ */
3201
+ readonly session: object;
3202
+ /** Refuse if this context can no longer be used. `target` names what the caller reached for. */
3203
+ assertUsable(target?: string): void;
3204
+ /** Whether this context's run has ended. */
3205
+ isFinished(): boolean;
3206
+ /** The revision this context last read at, or `null` if it has never read. */
3207
+ readRevision(): number | null;
3208
+ register(object: RuntimeManagedObject): void;
3209
+ track(object: RuntimeManagedObject): void;
3210
+ untrack(object: RuntimeManagedObject): void;
3211
+ isTracked(object: RuntimeManagedObject): boolean;
3212
+ /** Give up every claim on an object: it belongs to another context now. */
3213
+ disown(object: RuntimeManagedObject): void;
3214
+ /**
3215
+ * Work that a settled answer starts and the sync must wait for (a picture the host draws).
3216
+ * The sync that dispatched the answer awaits it before it continues, and fails if it fails.
3217
+ */
3218
+ defer(work: Promise<void>): void;
3219
+ }
3220
+ /** What a context may do to a proxy it owns. */
3221
+ interface RuntimeManagedObject {
3222
+ /** @internal Drop this object's presentation reference; the run that owned it has ended. */
3223
+ [RELEASE](): void;
3224
+ /** @internal Adoption: this object now belongs to another run's context on the same runtime. */
3225
+ [REBIND](context: RequestContext): void;
3226
+ }
3227
+
3228
+ /**
3229
+ * The base every presentation proxy extends.
3230
+ *
3231
+ * A released proxy still answers what it already knew: a property loaded before the run ended is
3232
+ * served from memory. Anything that would talk to the presentation (`load`, a write, a method)
3233
+ * refuses with `InvalidObjectPath`.
3234
+ *
3235
+ * @public
3236
+ */
3237
+ declare abstract class ClientObject implements RuntimeManagedObject {
3238
+ #private;
3239
+ /** @internal */
3240
+ protected constructor(context: RequestContext, path: ObjectPath, options?: {
3241
+ readonly nullable?: boolean;
3242
+ });
3243
+ /** The request context this object currently belongs to. */
3244
+ get context(): RequestContext;
3245
+ /**
3246
+ * Whether this object turned out not to exist. Only an answer, never a guess: an object from a
3247
+ * `getItemOrNullObject` has no verdict until the sync that looked for it, and reading one
3248
+ * before then is `PropertyNotLoaded`.
3249
+ */
3250
+ get isNullObject(): boolean;
3251
+ /**
3252
+ * Queue the reads that fill in the selected properties. Returns `this`; the values are
3253
+ * readable after the next `sync()`.
3254
+ */
3255
+ load(option?: LoadOption): this;
3256
+ /**
3257
+ * @internal Queue the reads of a resolved request: what `load(...)` does after it reads its
3258
+ * option, and what a navigation property or a collection item gets from the path above it.
3259
+ * All or nothing: a refusal drops what this call queued.
3260
+ */
3261
+ [LOAD_REQUEST](request: ResolvedLoadOptions): this;
3262
+ /**
3263
+ * @internal True while this object plans a load that a collection's items started: a text
3264
+ * read then answers null for a shape that cannot hold text, and fills nothing.
3265
+ */
3266
+ protected get loadingOrNull(): boolean;
3267
+ /**
3268
+ * @internal Say that this load handed its deeper paths on. A load whose planner does not call
3269
+ * this refuses any deeper path, so no path is dropped without a word.
3270
+ */
3271
+ protected takeNestedPaths(): void;
3272
+ /** The loaded properties as a plain object, as Office.js `toJSON()` gives them. */
3273
+ toJSON(): Record<string, unknown>;
3274
+ /** @internal What this kind of object does with a resolved load request. */
3275
+ protected abstract onLoad(request: ResolvedLoadOptions): void;
3276
+ /** @internal Whether `load(...)` accepts `items/<property>` paths. Only collections do. */
3277
+ protected get loadsItemPaths(): boolean;
3278
+ /** @internal This object's address, or the promise standing in until a sync resolves it. */
3279
+ protected get path(): ObjectPath;
3280
+ /** @internal The owning context's internal surface. */
3281
+ protected get internals(): ContextInternals;
3282
+ /** @internal Refuse a released or null object, and a finished context. */
3283
+ protected requireUsable(): void;
3284
+ /**
3285
+ * @internal Queue one action. `plan` gets the ref of this object (a handle, or the result
3286
+ * reference of the action that creates it in the same batch).
3287
+ */
3288
+ protected enqueue(sort: ActionSort, name: string, plan: (ref: (path: ObjectPath) => AutomationRef) => AutomationOperation, settle?: (value: AutomationValue) => void, produces?: ObjectPath, refable?: boolean, continues?: boolean): void;
3289
+ /** @internal Read a property a completed `load` filled in; refuses if none did. */
3290
+ protected loadedProperty<T>(name: string): T;
3291
+ /**
3292
+ * @internal A load through a collection skipped this object, for `reason` (a shape with no
3293
+ * text frame, a shape that is not a group): a read of what it did not load says why.
3294
+ */
3295
+ protected markSkipped(reason: PptxEditorDiagnostic | undefined): void;
3296
+ /** @internal Whether a completed `load` filled this property in. */
3297
+ protected hasLoadedProperty(name: string): boolean;
3298
+ /** @internal Record a value a completed load produced. */
3299
+ protected setLoadedProperty(name: string, value: unknown): void;
3300
+ /** @internal The values completed loads filled in, for `context.loadRecursive`. */
3301
+ [LOADED_VALUES](): readonly unknown[];
3302
+ /** @internal The path of this object, for the model objects that address another one. */
3303
+ get [PATH](): ObjectPath;
3304
+ /**
3305
+ * @internal Queue the refusal of a call whose argument this API does not accept, so the next
3306
+ * `sync()` refuses as a whole and applies nothing (`deferred-checks.ts`).
3307
+ */
3308
+ [DEFER_REFUSAL](error: PptxEditorError): void;
3309
+ /** @internal Drop this object's presentation reference; the run that owned it has ended. */
3310
+ [RELEASE](): void;
3311
+ /** @internal Adopt this object into another run's context. */
3312
+ [REBIND](context: RequestContext): void;
3313
+ }
3314
+
3315
+ /**
3316
+ * What a `run` callback is given, and what it may answer with.
3317
+ *
3318
+ * @public
3319
+ */
3320
+ type RunCallback<T> = (context: RequestContext) => Promise<T>;
3321
+ /**
3322
+ * Capabilities of a runtime, frozen for its lifetime.
3323
+ *
3324
+ * @public
3325
+ */
3326
+ interface PresentationCapabilities {
3327
+ /** There is a presentation to address at all. */
3328
+ readonly document: boolean;
3329
+ /** `save()` is offered: true for a server runtime, false for one borrowing an editor. */
3330
+ readonly save: boolean;
3331
+ /** The host raises change events. */
3332
+ readonly events: boolean;
3333
+ /** The host has a reader's selection to read or move. */
3334
+ readonly selection: boolean;
3335
+ /** Text writes re-fit text bodies by their autofit rules (ECMA-376 Part 1, 21.1.2.1). */
3336
+ readonly autofit: boolean;
3337
+ /**
3338
+ * `getImageAsBase64` draws pictures of slides and shapes: true for a runtime over a live editor
3339
+ * in a browser and for a server runtime created with a `rasterize` option, false otherwise.
3340
+ */
3341
+ readonly images: boolean;
3342
+ }
3343
+ /**
3344
+ * A runtime: one presentation host, many runs.
3345
+ *
3346
+ * Disposal is final: {@link PptxEditorRuntime.dispose} releases the host once and is safe to call
3347
+ * again, and every later `run` fails with `RuntimeDisposed`.
3348
+ *
3349
+ * @public
3350
+ */
3351
+ interface PptxEditorRuntime {
3352
+ /** What the presentation host behind this runtime can do. */
3353
+ readonly capabilities: PresentationCapabilities;
3354
+ /** Run one batch of work against the presentation. Answers with the callback's value. */
3355
+ run<T>(callback: RunCallback<T>): Promise<T>;
3356
+ /** Run one batch of work, adopting objects a previous run tracked. */
3357
+ run<T>(object: ClientObject | readonly ClientObject[], callback: RunCallback<T>): Promise<T>;
3358
+ /** Release the host. Idempotent. */
3359
+ dispose(): void;
3360
+ }
3361
+ /**
3362
+ * A runtime over PPTX bytes rather than a live editor: what `PptxEditor.createServer` answers.
3363
+ *
3364
+ * @public
3365
+ */
3366
+ interface PptxEditorServerRuntime extends PptxEditorRuntime {
3367
+ /** The current presentation as a fresh, caller-owned PPTX byte array. */
3368
+ save(): Promise<Uint8Array>;
3369
+ }
3370
+
3371
+ /**
3372
+ * How `PptxEditor.createServer` opens a presentation.
3373
+ *
3374
+ * Opening PPTX bytes is a bounded parse: zip entry, size, and ratio caps, part name checks, and
3375
+ * XML with no DTD. Malformed input refuses with `InvalidArgument`; a zip over a cap refuses with
3376
+ * `ResourceLimitExceeded`. No message carries file content.
3377
+ *
3378
+ * @public
3379
+ */
3380
+ interface CreateServerOptions {
3381
+ /**
3382
+ * Faces to measure text with, tried before the presentation's embedded fonts and the
3383
+ * metric-compatible substitutes.
3384
+ */
3385
+ readonly fonts?: FontSource | readonly FontSource[];
3386
+ /** Load the metric-compatible substitute fonts. Default `true`. */
3387
+ readonly substitutes?: boolean;
3388
+ /**
3389
+ * Turns the SVG of a slide or shape picture into PNG bytes, so `getImageAsBase64` works on a
3390
+ * server. The engine paints the picture with the editor's own renderer into a standalone SVG
3391
+ * document, with its pictures and fonts inline, and the rasterizer only draws that SVG, for
3392
+ * example with an SVG rasterizer library or a headless browser. It must answer a PNG of
3393
+ * exactly `width` by `height` pixels; any other answer refuses with `GeneralException`.
3394
+ * Without it, `capabilities.images` is false and `getImageAsBase64` refuses with
3395
+ * `NotSupported`.
3396
+ */
3397
+ readonly rasterize?: ImageRasterizer;
3398
+ }
3399
+
3400
+ export { Binding as B, DocumentProperties as D, GeometricShapeType as G, Hyperlink as H, InsertSlideFormatting as I, Margins as M, PageSetup as N, ParagraphFormat as O, ParagraphHorizontalAlignment as Q, PlaceholderFormat as R, PlaceholderType as S, PptxEditorError as U, Presentation as Y, RequestContext as _, Shape as a1, ShapeAutoSize as a3, ShapeCollection as a4, ShapeFill as a5, ShapeFillType as a6, ShapeFont as a7, ShapeFontUnderlineStyle as a8, ShapeGetImageFormatType as a9, SlideLayoutCollection as aA, SlideLayoutType as aB, SlideMaster as aC, SlideMasterBackground as aD, SlideMasterCollection as aE, SlideScopedCollection as aF, Table as aG, TableCell as aI, TableCellCollection as aK, TableColumn as aO, TableColumnCollection as aP, TableRow as aS, TableRowCollection as aT, TableStyle as aV, TableStyleSettings as aW, Tag as aX, TagCollection as aY, TextFrame as aZ, TextRange as a_, ShapeGroup as ab, ShapeLineDashStyle as ac, ShapeLineFormat as ad, ShapeLineStyle as ae, ShapeScopedCollection as af, ShapeType as ag, ShapeZOrder as ah, Slide as ai, SlideBackground as aj, SlideBackgroundFill as ak, SlideBackgroundFillType as al, SlideBackgroundGradientFill as am, SlideBackgroundGradientFillType as ao, SlideBackgroundPatternFill as ap, SlideBackgroundPatternFillType as ar, SlideBackgroundPictureOrTextureFill as as, SlideBackgroundSolidFill as au, SlideCollection as aw, SlideLayout as ay, SlideLayoutBackground as az, Adjustments as b, TextVerticalAlignment as b0, ThemeColor as b1, ThemeColorScheme as b2, TrackedObjects as b3, isPptxEditorError as b4, Application as c, BindingCollection as d, BindingType as e, Border as f, Borders as h, BulletFormat as i, BulletStyle as j, BulletType as k, ClientObject as l, ClientResult as n, ConnectorType as o, CustomProperty as p, CustomPropertyCollection as q, CustomXmlPart as r, CustomXmlPartCollection as s, CustomXmlPartScopedCollection as t, DocumentPropertyType as u, HyperlinkCollection as x, HyperlinkScopedCollection as y, HyperlinkType as z };
3401
+ export type { RequestContextDebugInfo as $, AddSlideOptions as A, CreateServerOptions as C, InsertSlideOptions as E, FillProperties as F, LoadPropertyOptions as J, LoadQueryOptions as K, LoadOption as L, PptxEditorRuntime as P, PptxEditorDebugInfo as T, PptxEditorErrorCode as V, PptxEditorErrorInit as W, PptxEditorInnerError as X, PresentationCapabilities as Z, PptxEditorServerRuntime as a, TextRun as a$, RunCallback as a0, ShapeAddOptions as a2, TableAddOptions as aH, TableCellBorders as aJ, TableCellMargins as aL, TableCellProperties as aM, TableClearOptions as aN, TableColumnProperties as aQ, TableMergedAreaProperties as aR, TableRowProperties as aU, ShapeGetImageOptions as aa, SlideBackgroundGradientFillOptions as an, SlideBackgroundPatternFillOptions as aq, SlideBackgroundPictureOrTextureFillOptions as at, SlideBackgroundSolidFillOptions as av, SlideGetImageOptions as ax, BorderProperties as g, ClientRequestContext as m, FontProperties as v, HyperlinkAddOptions as w };