@jsfkit/types 1.3.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1275 -131
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -236,6 +236,1241 @@ type Note = {
|
|
|
236
236
|
text: string;
|
|
237
237
|
};
|
|
238
238
|
|
|
239
|
+
/**
|
|
240
|
+
* Base type for text runs that annotate ranges within threaded comment text.
|
|
241
|
+
*
|
|
242
|
+
* A text run identifies a contiguous range of characters in the comment text, specified by
|
|
243
|
+
* zero-indexed start and end positions. Text runs allow metadata to be attached to specific
|
|
244
|
+
* portions of text, enabling features such as hyperlinks, mentions, and formatting.
|
|
245
|
+
*
|
|
246
|
+
* ## How text runs work
|
|
247
|
+
*
|
|
248
|
+
* Each text run specifies a range within the comment text using `start` (inclusive) and `end`
|
|
249
|
+
* (exclusive) character positions. For example, in the text "Hello @foo", a mention text run
|
|
250
|
+
* for "@foo" would have `start: 6` and `end: 10`.
|
|
251
|
+
*
|
|
252
|
+
* Multiple text runs can exist within a single comment, allowing different types of annotations
|
|
253
|
+
* to coexist (a mention and a hyperlink in the same text, for example).
|
|
254
|
+
*
|
|
255
|
+
* @see {@link MentionTextRun} for mentions of people
|
|
256
|
+
* @see {@link HyperlinkTextRun} for hyperlinks
|
|
257
|
+
*/
|
|
258
|
+
type TextRun = {
|
|
259
|
+
/** Starting character position of the run in the text (zero-indexed). */
|
|
260
|
+
start: integer;
|
|
261
|
+
/** Ending character position of the run in the text (zero-indexed, exclusive). */
|
|
262
|
+
end: integer;
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* A {@link TextRun | text run} representing a hyperlink within a threaded comment's text.
|
|
267
|
+
*/
|
|
268
|
+
type HyperlinkTextRun = TextRun & {
|
|
269
|
+
/** Discriminator to identify this as a hyperlink text run. */
|
|
270
|
+
type: 'hyperlink';
|
|
271
|
+
/** The URL that the hyperlink points to. */
|
|
272
|
+
url: string;
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* A {@link TextRun | text run} representing a mention of a person within a threaded comment's text.
|
|
277
|
+
*/
|
|
278
|
+
type MentionTextRun = TextRun & {
|
|
279
|
+
/** Discriminator to identify this as a mention text run. */
|
|
280
|
+
type: 'mention';
|
|
281
|
+
/**
|
|
282
|
+
* Unique identifier of the person being mentioned. Use this to find the person's details in a
|
|
283
|
+
* {@link Workbook.people | workbook's list of people}.
|
|
284
|
+
*
|
|
285
|
+
* Excel always uses a UUID in the format `{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}`, but JSF makes
|
|
286
|
+
* no strict requirement.
|
|
287
|
+
*/
|
|
288
|
+
personId: string;
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* An author of a threaded comment, or a person mentioned in a threaded comment.
|
|
293
|
+
*/
|
|
294
|
+
type Person = {
|
|
295
|
+
/**
|
|
296
|
+
* A unique id for the person.
|
|
297
|
+
*
|
|
298
|
+
* Excel always uses a UUID in the format `{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}`, but JSF makes
|
|
299
|
+
* no strict requirement.
|
|
300
|
+
*/
|
|
301
|
+
id: string;
|
|
302
|
+
/** The person's name as it should be shown to other users. */
|
|
303
|
+
displayName: string;
|
|
304
|
+
/**
|
|
305
|
+
* Optional provider-issued user identifier that varies in format depending on the provider. See
|
|
306
|
+
* {@link Person.providerId} for details on possible values.
|
|
307
|
+
*/
|
|
308
|
+
userId?: string;
|
|
309
|
+
/**
|
|
310
|
+
* Specifies where the person's information came from. Excel supports the following values:
|
|
311
|
+
*
|
|
312
|
+
* - `None`: no specific provider; {@link Person.userId} is expected to be the person's name.
|
|
313
|
+
* - `AD`: Active Directory; {@link Person.userId} will be Active Directory id.
|
|
314
|
+
* - `Windows Live`: Microsoft account; {@link Person.userId} will be a 64-bit signed decimal.
|
|
315
|
+
* - `PeoplePicker`: SharePoint People Picker; {@link Person.userId} will be an email address.
|
|
316
|
+
*/
|
|
317
|
+
providerId?: string;
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* A threaded comment that is attached to an individual cell.
|
|
322
|
+
*/
|
|
323
|
+
type ThreadedComment = {
|
|
324
|
+
/**
|
|
325
|
+
* Unique identifier for the comment.
|
|
326
|
+
*
|
|
327
|
+
* Excel always uses a UUID in the format `{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}`, but JSF makes
|
|
328
|
+
* no strict requirement.
|
|
329
|
+
*/
|
|
330
|
+
id: string;
|
|
331
|
+
/**
|
|
332
|
+
* Unique identifier of the parent comment, if this is a reply in a thread.
|
|
333
|
+
*
|
|
334
|
+
* Excel always uses a UUID in the format `{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}`, but JSF makes
|
|
335
|
+
* no strict requirement.
|
|
336
|
+
*/
|
|
337
|
+
parentId?: string;
|
|
338
|
+
/** A1-style reference to the cell this comment is attached to. */
|
|
339
|
+
ref: CellId;
|
|
340
|
+
/** Date and time the comment was written, as an ISO formatted string. */
|
|
341
|
+
datetime?: string;
|
|
342
|
+
/**
|
|
343
|
+
* Unique identifier of the person who authored this comment. Use this to find the person's
|
|
344
|
+
* details in a {@link Workbook.people | workbook's list of people}.
|
|
345
|
+
*
|
|
346
|
+
* Excel always uses a UUID in the format `{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}`, but JSF makes
|
|
347
|
+
* no strict requirement.
|
|
348
|
+
*/
|
|
349
|
+
personId: string;
|
|
350
|
+
/** The comment text content. */
|
|
351
|
+
text: string;
|
|
352
|
+
/** Whether the comment has been marked as resolved. */
|
|
353
|
+
resolved?: boolean;
|
|
354
|
+
/** {@link TextRun | Text runs} that annotate ranges within the comment text. */
|
|
355
|
+
runs?: (MentionTextRun | HyperlinkTextRun)[];
|
|
356
|
+
};
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* Represents a one dimensional position or length in EMUs.
|
|
360
|
+
* Same as {@link Coordinate} but value must be 0 or higher.
|
|
361
|
+
*
|
|
362
|
+
* @min 0
|
|
363
|
+
* @max 27273042316900
|
|
364
|
+
*/
|
|
365
|
+
type PositiveCoordinate = number;
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* Describes the length and width properties for how far drawing element should extend, in EMUs.
|
|
369
|
+
*/
|
|
370
|
+
type Extent = {
|
|
371
|
+
/** Horizontal size (X-axis). */
|
|
372
|
+
cx: PositiveCoordinate;
|
|
373
|
+
/** Vertical size (Y-axis). */
|
|
374
|
+
cy: PositiveCoordinate;
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Represents a one dimensional value (usually position or length) in EMUs.
|
|
379
|
+
*
|
|
380
|
+
* EMUs (English Metric Units) are a high precision coordinate space originating from Microsoft
|
|
381
|
+
* Windows / Office graphics and printing. The unit bridges bridges English (inches) and metric (cm)
|
|
382
|
+
* units for layout.
|
|
383
|
+
*
|
|
384
|
+
* EMU is defined as: 91440 EMUs per 1 inch and 360000 EMUs per 1 cm. Thus EMUs can:
|
|
385
|
+
*
|
|
386
|
+
* - Stay integer-based (avoids floating-point rounding errors).
|
|
387
|
+
* - Convert cleanly to both inches and metric units.
|
|
388
|
+
* - Work well for screen/display and printer coordinate systems.
|
|
389
|
+
*
|
|
390
|
+
* EMUs can be converted to pixels or points by calculating EMUs * DPI / 914400.
|
|
391
|
+
* For example: At 96 DPI, 49600 EMUs correspond to 49600 * 96 / 914400 = 5.2 points.
|
|
392
|
+
*
|
|
393
|
+
* Excel files seem to be saved at 72 DPI, which means 12700 per pixel:
|
|
394
|
+
*
|
|
395
|
+
* - EMU to PX: `emu => emu / 12700;`
|
|
396
|
+
* - PX to PX: `emu => Math.round(emu * 12700);`
|
|
397
|
+
*
|
|
398
|
+
* @min -27273042329600
|
|
399
|
+
* @max 27273042316900
|
|
400
|
+
*/
|
|
401
|
+
type EmuValue = number;
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* 2D position in EMUs.
|
|
405
|
+
*
|
|
406
|
+
z * Represents a point in 2D space using absolute coordinates measured in EMUs.
|
|
407
|
+
*/
|
|
408
|
+
type Point = {
|
|
409
|
+
/** Horizontal position (X-axis). */
|
|
410
|
+
x: EmuValue;
|
|
411
|
+
/** Vertical position (Y-axis). */
|
|
412
|
+
y: EmuValue;
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* Specifies an absolute anchor placeholder for a group, a shape, or a drawing element.
|
|
417
|
+
*/
|
|
418
|
+
type GraphicAnchorAbsolute = {
|
|
419
|
+
/** Type discriminator for an absolute anchor. */
|
|
420
|
+
type: 'absolute';
|
|
421
|
+
/** The absolute position of the graphic in EMUs. */
|
|
422
|
+
pos: Point;
|
|
423
|
+
/** The size of the graphic in EMUs. */
|
|
424
|
+
ext: Extent;
|
|
425
|
+
};
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* Specifies a point in the cell grid.
|
|
429
|
+
*/
|
|
430
|
+
type CellOffset = {
|
|
431
|
+
/** The row in which the point occurs, 1 indexed. */
|
|
432
|
+
row: number;
|
|
433
|
+
/** The offset within the row in which the point occurs, in EMUs. */
|
|
434
|
+
rowOff: EmuValue;
|
|
435
|
+
/** The column in which the point occurs, 1 indexed. */
|
|
436
|
+
col: number;
|
|
437
|
+
/** The position within the column in which the point occurs, in EMUs. */
|
|
438
|
+
colOff: EmuValue;
|
|
439
|
+
};
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Specifies a one cell anchor placeholder for a group, a shape, or a drawing element.
|
|
443
|
+
*/
|
|
444
|
+
type GraphicAnchorOneCell = {
|
|
445
|
+
/** Type discriminator for a one-cell anchor. */
|
|
446
|
+
type: 'oneCell';
|
|
447
|
+
/** The top/left position of the graphic in cell coordinates. */
|
|
448
|
+
from: CellOffset;
|
|
449
|
+
/** The size of the graphic in EMUs. */
|
|
450
|
+
ext: Extent;
|
|
451
|
+
};
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* Specifies a two-cell anchor placeholder for a group, a shape, or a drawing element.
|
|
455
|
+
*/
|
|
456
|
+
type GraphicAnchorTwoCell = {
|
|
457
|
+
/** Type discriminator for a two-cell anchor. */
|
|
458
|
+
type: 'twoCell';
|
|
459
|
+
/** The top/left position of the graphic in cell coordinates. */
|
|
460
|
+
from: CellOffset;
|
|
461
|
+
/** The bottom/right position of the graphic in cell coordinates. */
|
|
462
|
+
to: CellOffset;
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* Specifies an anchor placeholder for a group, a shape, or a drawing element.
|
|
467
|
+
*/
|
|
468
|
+
type GraphicAnchor = GraphicAnchorAbsolute | GraphicAnchorOneCell | GraphicAnchorTwoCell;
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* Represents a percentage of a whole, usually [0-100].
|
|
472
|
+
*/
|
|
473
|
+
type Percentage = number;
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* Relative rectangle with percentage-based insets.
|
|
477
|
+
*
|
|
478
|
+
* Defines a rectangle using relative offsets from each edge, expressed as percentages
|
|
479
|
+
* of the parent rectangle's dimensions.
|
|
480
|
+
*/
|
|
481
|
+
type RelativeRect = {
|
|
482
|
+
/** Top edge offset as percentage from top. */
|
|
483
|
+
t: Percentage;
|
|
484
|
+
/** Left edge offset as percentage from left. */
|
|
485
|
+
l: Percentage;
|
|
486
|
+
/** Bottom edge offset as percentage from bottom. */
|
|
487
|
+
b: Percentage;
|
|
488
|
+
/** Right edge offset as percentage from right. */
|
|
489
|
+
r: Percentage;
|
|
490
|
+
};
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* Specifies the direction(s) in which to flip a source image while tiling.
|
|
494
|
+
*/
|
|
495
|
+
type FlipAxis = 'none' | 'x' | 'xy' | 'y';
|
|
496
|
+
|
|
497
|
+
/**
|
|
498
|
+
* Rectangle alignment position.
|
|
499
|
+
*
|
|
500
|
+
* Defines the alignment point within a rectangle, using a 3x3 grid:
|
|
501
|
+
*
|
|
502
|
+
* | Value | Position |
|
|
503
|
+
* |-------|----------------|
|
|
504
|
+
* | `b` | Bottom center |
|
|
505
|
+
* | `bl` | Bottom left |
|
|
506
|
+
* | `br` | Bottom right |
|
|
507
|
+
* | `ctr` | Center |
|
|
508
|
+
* | `l` | Middle left |
|
|
509
|
+
* | `r` | Middle right |
|
|
510
|
+
* | `t` | Top center |
|
|
511
|
+
* | `tl` | Top left |
|
|
512
|
+
* | `tr` | Top right |
|
|
513
|
+
*/
|
|
514
|
+
type RectAlignment = 'b' | 'bl' | 'br' | 'ctr' | 'l' | 'r' | 't' | 'tl' | 'tr';
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Tile settings for image fills.
|
|
518
|
+
*
|
|
519
|
+
* Defines how an image should be repeated (tiled) when used as a fill,
|
|
520
|
+
* including scaling, alignment, offset, and flip transformations.
|
|
521
|
+
*/
|
|
522
|
+
type Tile = {
|
|
523
|
+
/** Additional horizontal offset after alignment, in EMUs. */
|
|
524
|
+
tx?: EmuValue;
|
|
525
|
+
/** Additional vertical offset after alignment, in EMUs. */
|
|
526
|
+
ty?: EmuValue;
|
|
527
|
+
/** Horizontal scale factor to apply to the source image. */
|
|
528
|
+
sx?: Percentage;
|
|
529
|
+
/** Vertical scale factor to apply to the source image. */
|
|
530
|
+
sy?: Percentage;
|
|
531
|
+
/** Direction(s) in which to flip the source image while tiling. */
|
|
532
|
+
flip?: FlipAxis;
|
|
533
|
+
/**
|
|
534
|
+
* Alignment position for the first tile relative to the shape bounds (applied after
|
|
535
|
+
* sx/sy scaling, before tx/ty offset).
|
|
536
|
+
*/
|
|
537
|
+
align?: RectAlignment;
|
|
538
|
+
};
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* Image/bitmap fill (blip fill).
|
|
542
|
+
*
|
|
543
|
+
* Defines a fill using an embedded or linked image, with options for
|
|
544
|
+
* tiling, stretching, cropping, and transparency.
|
|
545
|
+
*/
|
|
546
|
+
type BlipFill = {
|
|
547
|
+
/** Type discriminator for blip (image) fills. */
|
|
548
|
+
type: 'blip';
|
|
549
|
+
/**
|
|
550
|
+
* Reference to the media/image resource to use for this fill.
|
|
551
|
+
* @see {@link Workbook.images}.
|
|
552
|
+
*/
|
|
553
|
+
mediaId: string;
|
|
554
|
+
/**
|
|
555
|
+
* Opacity value (0-100, where 100 is fully opaque).
|
|
556
|
+
* @min 0
|
|
557
|
+
* @max 100
|
|
558
|
+
* @defaultValue 0
|
|
559
|
+
*/
|
|
560
|
+
alpha?: Percentage;
|
|
561
|
+
/**
|
|
562
|
+
* The DPI used to calculate the size of the blip.
|
|
563
|
+
* When this value is not present the DPI in the blip is used.
|
|
564
|
+
*/
|
|
565
|
+
dpi?: integer;
|
|
566
|
+
/** Whether the blip should rotate when the shape is rotated. */
|
|
567
|
+
rotWithShape?: boolean;
|
|
568
|
+
/**
|
|
569
|
+
* Rectangle defining the source crop area of the image (relative coordinates).
|
|
570
|
+
*/
|
|
571
|
+
srcRect?: RelativeRect;
|
|
572
|
+
/**
|
|
573
|
+
* Rectangle defining how the image should be stretched to fill the shape (relative coordinates).
|
|
574
|
+
*/
|
|
575
|
+
stretchRect?: RelativeRect;
|
|
576
|
+
/** Tiling properties for repeating the image pattern across the fill area. */
|
|
577
|
+
tile?: Tile;
|
|
578
|
+
};
|
|
579
|
+
|
|
580
|
+
/**
|
|
581
|
+
* Represents an angle in 60,000ths of a degree (e.g., 5400000 = 90 degrees).
|
|
582
|
+
*
|
|
583
|
+
* Positive angles are clockwise (i.e., towards the positive y axis);
|
|
584
|
+
* negative angles are counter-clockwise (i.e., towards the negative y axis).
|
|
585
|
+
*/
|
|
586
|
+
type DmlAngle = number;
|
|
587
|
+
|
|
588
|
+
/**
|
|
589
|
+
* A hex-encoded RGB or RGBA value that conforms to the CSS4 color specification (e.g. `"#3cb371"`).
|
|
590
|
+
*
|
|
591
|
+
* @see {@link https://www.w3.org/TR/css-color-4/#hex-notation | CSS hexadecimal notation spec}
|
|
592
|
+
* @pattern ^#([a-fA-F0-9]{3,4}|([a-fA-F0-9][a-fA-F0-9]){3,4})$
|
|
593
|
+
*/
|
|
594
|
+
type Color = `#${string}`;
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* Gradient color stop.
|
|
598
|
+
*
|
|
599
|
+
* Defines a color transition point within a gradient fill,
|
|
600
|
+
* specifying both the position and color at that point.
|
|
601
|
+
*/
|
|
602
|
+
type GradientColorStop = {
|
|
603
|
+
/**
|
|
604
|
+
* Position of this color stop within the gradient (0-100, where 0 is start and 100 is end).
|
|
605
|
+
* @min 0
|
|
606
|
+
* @max 100
|
|
607
|
+
*/
|
|
608
|
+
offset: Percentage;
|
|
609
|
+
/**
|
|
610
|
+
* Color value at this gradient stop position.
|
|
611
|
+
*/
|
|
612
|
+
color: Color;
|
|
613
|
+
};
|
|
614
|
+
|
|
615
|
+
/**
|
|
616
|
+
* Linear gradient fill.
|
|
617
|
+
*
|
|
618
|
+
* Defines a gradient fill that transitions between colors along a straight line,
|
|
619
|
+
* with configurable angle, flip behavior, and color stops.
|
|
620
|
+
*/
|
|
621
|
+
type GradientLinearFill = {
|
|
622
|
+
/** Type discriminator for linear gradient fills. */
|
|
623
|
+
type: 'linearGradient';
|
|
624
|
+
/** Direction(s) in which to flip the gradient pattern. */
|
|
625
|
+
flip?: FlipAxis;
|
|
626
|
+
/** Whether the gradient should rotate when the shape is rotated. */
|
|
627
|
+
rotWithShape?: boolean;
|
|
628
|
+
/** Array of color stops defining the gradient color transitions. */
|
|
629
|
+
colorStops: GradientColorStop[];
|
|
630
|
+
/** Angle of the gradient direction in 60,000ths of a degree. */
|
|
631
|
+
angle?: DmlAngle;
|
|
632
|
+
/** Whether the gradient should scale with the shape dimensions. */
|
|
633
|
+
scaled?: boolean;
|
|
634
|
+
};
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* Path gradient fill type.
|
|
638
|
+
*
|
|
639
|
+
* Defines the shape pattern used for path gradient fills:
|
|
640
|
+
* - 'circle': Radial gradient emanating from center in a circular pattern.
|
|
641
|
+
* - 'rect': Gradient following rectangular boundaries from center outward.
|
|
642
|
+
* - 'shape': Gradient following the actual contour/outline of the shape.
|
|
643
|
+
*/
|
|
644
|
+
type PathFillType = 'circle' | 'rect' | 'shape';
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* Path gradient fill (radial/shape gradient).
|
|
648
|
+
*
|
|
649
|
+
* Defines a gradient fill that radiates from a center point or follows
|
|
650
|
+
* the shape's contour, creating circular, rectangular, or shape-based gradients.
|
|
651
|
+
*/
|
|
652
|
+
type GradientPathFill = {
|
|
653
|
+
/** Type discriminator for path gradient fills. */
|
|
654
|
+
type: 'pathGradient';
|
|
655
|
+
/** Array of color stops defining the gradient color transitions. */
|
|
656
|
+
colorStops: GradientColorStop[];
|
|
657
|
+
/** Path type determining the gradient shape (circle, rectangle, or shape contour). */
|
|
658
|
+
path: PathFillType;
|
|
659
|
+
/** Rectangle defining the gradient's focus area (relative coordinates). */
|
|
660
|
+
fillToRect?: RelativeRect;
|
|
661
|
+
/** Direction(s) in which to flip the gradient pattern. */
|
|
662
|
+
flip?: FlipAxis;
|
|
663
|
+
/** Whether the gradient should rotate when the shape is rotated. */
|
|
664
|
+
rotWithShape?: boolean;
|
|
665
|
+
};
|
|
666
|
+
|
|
667
|
+
/**
|
|
668
|
+
* Group fill.
|
|
669
|
+
*
|
|
670
|
+
* Declares that the element is part of a group and should inherit the fill properties of the group.
|
|
671
|
+
*/
|
|
672
|
+
type GroupFill = {
|
|
673
|
+
/** Type discriminator for group fills. */
|
|
674
|
+
type: 'group';
|
|
675
|
+
};
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* No fill.
|
|
679
|
+
*
|
|
680
|
+
* Declares that the element should not be filled.
|
|
681
|
+
*/
|
|
682
|
+
type NoFill = {
|
|
683
|
+
/** Type discriminator for none-fills. */
|
|
684
|
+
type: 'none';
|
|
685
|
+
};
|
|
686
|
+
|
|
687
|
+
/**
|
|
688
|
+
* Pattern fill style presets.
|
|
689
|
+
*/
|
|
690
|
+
type FillPatternStyle = 'pct5' | 'pct10' | 'pct20' | 'pct25' | 'pct30' | 'pct40' | 'pct50' | 'pct60' | 'pct70' | 'pct75' | 'pct80' | 'pct90' | 'ltHorz' | 'ltVert' | 'dkHorz' | 'dkVert' | 'narHorz' | 'narVert' | 'dashHorz' | 'dashVert' | 'ltDnDiag' | 'ltUpDiag' | 'dkDnDiag' | 'dkUpDiag' | 'wdDnDiag' | 'wdUpDiag' | 'dashDnDiag' | 'dashUpDiag' | 'smCheck' | 'lgCheck' | 'smGrid' | 'lgGrid' | 'dotGrid' | 'smConfetti' | 'lgConfetti' | 'horzBrick' | 'diagBrick' | 'solidDmnd' | 'openDmnd' | 'dotDmnd' | 'plaid' | 'sphere' | 'weave' | 'divot' | 'shingle' | 'wave' | 'trellis' | 'zigZag' | 'cross' | 'horz' | 'vert' | 'dnDiag' | 'upDiag' | 'diagCross';
|
|
691
|
+
|
|
692
|
+
/**
|
|
693
|
+
* Pattern fill.
|
|
694
|
+
*
|
|
695
|
+
* Defines a fill using a repeating pattern (dots, stripes, crosshatch, etc.)
|
|
696
|
+
* with configurable foreground and background colors.
|
|
697
|
+
*/
|
|
698
|
+
type PatternFill = {
|
|
699
|
+
/** Type discriminator for pattern fills. */
|
|
700
|
+
type: 'pattern';
|
|
701
|
+
/** Foreground color of the pattern. */
|
|
702
|
+
fg?: Color;
|
|
703
|
+
/** Background color of the pattern. */
|
|
704
|
+
bg?: Color;
|
|
705
|
+
/** Pattern style defining the visual design (horizontal, vertical, diagonal, dots, etc.). */
|
|
706
|
+
style?: FillPatternStyle;
|
|
707
|
+
};
|
|
708
|
+
|
|
709
|
+
/**
|
|
710
|
+
* Solid color fill.
|
|
711
|
+
*
|
|
712
|
+
* Defines a fill using a single uniform color with no gradients, patterns, or images.
|
|
713
|
+
*/
|
|
714
|
+
type SolidFill = {
|
|
715
|
+
/** Type discriminator for solid fills. */
|
|
716
|
+
type: 'solid';
|
|
717
|
+
/** Background color for the solid fill. */
|
|
718
|
+
bg?: Color;
|
|
719
|
+
};
|
|
720
|
+
|
|
721
|
+
type Fill = PatternFill | SolidFill | GradientLinearFill | GradientPathFill | GroupFill | NoFill | BlipFill;
|
|
722
|
+
|
|
723
|
+
/**
|
|
724
|
+
* A dash stop primitive consisting of a dash and a space.
|
|
725
|
+
*/
|
|
726
|
+
type DashStop = {
|
|
727
|
+
/**
|
|
728
|
+
* Length of the dash (relative to line width)
|
|
729
|
+
* @min 0
|
|
730
|
+
*/
|
|
731
|
+
d: Percentage;
|
|
732
|
+
/**
|
|
733
|
+
* Length of the space (relative to line width)
|
|
734
|
+
* @min 0
|
|
735
|
+
*/
|
|
736
|
+
sp: Percentage;
|
|
737
|
+
};
|
|
738
|
+
|
|
739
|
+
/**
|
|
740
|
+
* Determines the alignment of a line stroke against its shape path.
|
|
741
|
+
*
|
|
742
|
+
* | Value | Presentation
|
|
743
|
+
* |----------|-------
|
|
744
|
+
* | `center` | Stroke is centered on the path.
|
|
745
|
+
* | `inside` | Stroke is drawn inside the path.
|
|
746
|
+
*
|
|
747
|
+
* These have been altered from DrawingML which used "ctr" for `center`, and "in" for `inside`.
|
|
748
|
+
*/
|
|
749
|
+
type LineAlignment = 'center' | 'inside';
|
|
750
|
+
|
|
751
|
+
/**
|
|
752
|
+
* Determines how line endpoints are rendered. This is the same as SVG's `stroke-linecap` property.
|
|
753
|
+
*
|
|
754
|
+
* | Value | Presentation
|
|
755
|
+
* |----------|------------------------------------------------
|
|
756
|
+
* | `butt` | Stroke does not extend beyond its endpoints. Zero length line will not be rendered.
|
|
757
|
+
* | `round` | Stroke is extended by a half circle with a diameter equal to the line width.
|
|
758
|
+
* | `square` | Ends of the stroke will be extended by a rectangle half the width of the stroke.
|
|
759
|
+
*
|
|
760
|
+
* These have been altered from DrawingML which used "flat" for `butt`, "rnd" for `round`,
|
|
761
|
+
* and "sq" for `square`.
|
|
762
|
+
*/
|
|
763
|
+
type LineCapType = 'butt' | 'rnd' | 'sq';
|
|
764
|
+
|
|
765
|
+
/**
|
|
766
|
+
* Specifies the compound type that is to be used for lines.
|
|
767
|
+
*
|
|
768
|
+
* | Value | Rendered as
|
|
769
|
+
* |-------------|---------------------------
|
|
770
|
+
* | `dbl` | Double lines of equal width
|
|
771
|
+
* | `sng` | Single line
|
|
772
|
+
* | `thickThin` | Double lines: one thick, one thin
|
|
773
|
+
* | `thinThick` | Double lines: one thin, one thick
|
|
774
|
+
* | `tri` | Three lines: thin, thick, thin
|
|
775
|
+
*/
|
|
776
|
+
type LineCompoundType = 'dbl' | 'sng' | 'thickThin' | 'thinThick' | 'tri';
|
|
777
|
+
|
|
778
|
+
/**
|
|
779
|
+
* Line ending decoration size: Large, medium, small.
|
|
780
|
+
*/
|
|
781
|
+
type LineEndSize = 'lg' | 'med' | 'sm';
|
|
782
|
+
|
|
783
|
+
/** Line ending shape type. */
|
|
784
|
+
type LineEndType = 'arrow' | 'diamond' | 'none' | 'oval' | 'stealth' | 'triangle';
|
|
785
|
+
|
|
786
|
+
/**
|
|
787
|
+
* Defines a line ending decoration.
|
|
788
|
+
*/
|
|
789
|
+
type LineEnd = {
|
|
790
|
+
/**
|
|
791
|
+
* The type of decoration to render.
|
|
792
|
+
* @defaultValue "none"
|
|
793
|
+
*/
|
|
794
|
+
type: LineEndType;
|
|
795
|
+
/**
|
|
796
|
+
* Width size of the ending decoration.
|
|
797
|
+
* @defaultValue "med"
|
|
798
|
+
*/
|
|
799
|
+
width?: LineEndSize;
|
|
800
|
+
/**
|
|
801
|
+
* Length size of the ending decoration.
|
|
802
|
+
* @defaultValue "med"
|
|
803
|
+
*/
|
|
804
|
+
len?: LineEndSize;
|
|
805
|
+
};
|
|
806
|
+
|
|
807
|
+
/**
|
|
808
|
+
* Defines the shape to be used at the corners of a stroked path.
|
|
809
|
+
* These are equivalent to their CSS/SVG linejoin value counterparts.
|
|
810
|
+
*/
|
|
811
|
+
type LineJoinType = 'bevel' | 'round' | 'miter';
|
|
812
|
+
|
|
813
|
+
/**
|
|
814
|
+
* Line dash style.
|
|
815
|
+
*
|
|
816
|
+
* | Value | Appearance
|
|
817
|
+
* |-----------------|---------------------------------------------
|
|
818
|
+
* | `dash` | Equivalent to SVG dashArray of `[4,4]`
|
|
819
|
+
* | `dashDot` | Equivalent to SVG dashArray of `[4,3,1,3]`
|
|
820
|
+
* | `dot` | Equivalent to SVG dashArray of `[1,3]`
|
|
821
|
+
* | `lgDash` | Equivalent to SVG dashArray of `[8,3]`
|
|
822
|
+
* | `lgDashDot` | Equivalent to SVG dashArray of `[8,3,1,3]`
|
|
823
|
+
* | `lgDashDotDot` | Equivalent to SVG dashArray of `[8,3,1,3,1,3]`
|
|
824
|
+
* | `solid` | Equivalent to SVG dashArray of `null`
|
|
825
|
+
* | `sysDash` | Equivalent to SVG dashArray of `[3,1]`
|
|
826
|
+
* | `sysDashDot` | Equivalent to SVG dashArray of `[3,1,1,1]`
|
|
827
|
+
* | `sysDashDotDot` | Equivalent to SVG dashArray of `[3,1,1,1,1,1,1]`
|
|
828
|
+
* | `sysDot` | Equivalent to SVG dashArray of `[1,1]`
|
|
829
|
+
*/
|
|
830
|
+
type LineStyle = 'dash' | 'dashDot' | 'dot' | 'lgDash' | 'lgDashDot' | 'lgDashDotDot' | 'solid' | 'sysDash' | 'sysDashDot' | 'sysDashDotDot' | 'sysDot';
|
|
831
|
+
|
|
832
|
+
/**
|
|
833
|
+
* Line styling properties.
|
|
834
|
+
*
|
|
835
|
+
* Defines the visual appearance of lines and shape outlines, including
|
|
836
|
+
* stroke style, width, caps, joins, and decorative line ends (arrows).
|
|
837
|
+
*/
|
|
838
|
+
type Line = {
|
|
839
|
+
/** Compound line type for creating multi-stroke effects. */
|
|
840
|
+
cmpd?: LineCompoundType;
|
|
841
|
+
/**
|
|
842
|
+
* Line cap style determining how line endpoints are rendered.
|
|
843
|
+
* @defaultValue "flat"
|
|
844
|
+
*/
|
|
845
|
+
cap?: LineCapType;
|
|
846
|
+
/**
|
|
847
|
+
* Line join style determining how line segment connections are rendered.
|
|
848
|
+
* @defaultValue "miter"
|
|
849
|
+
*/
|
|
850
|
+
join?: LineJoinType;
|
|
851
|
+
/**
|
|
852
|
+
* Line alignment relative to the shape path (centered on path or inset)
|
|
853
|
+
* @defaultValue "ctr"
|
|
854
|
+
*/
|
|
855
|
+
align?: LineAlignment;
|
|
856
|
+
/**
|
|
857
|
+
* Fill style applied to the line stroke.
|
|
858
|
+
*/
|
|
859
|
+
fill?: PatternFill | SolidFill | GradientLinearFill | GradientPathFill | NoFill;
|
|
860
|
+
/**
|
|
861
|
+
* Line width in EMUs.
|
|
862
|
+
* @min 0
|
|
863
|
+
* @max 20116800
|
|
864
|
+
*/
|
|
865
|
+
width?: PositiveCoordinate;
|
|
866
|
+
/**
|
|
867
|
+
* Line dash/dot pattern style.
|
|
868
|
+
*/
|
|
869
|
+
style?: LineStyle | DashStop[];
|
|
870
|
+
/** Arrow or decoration at the start of the line. */
|
|
871
|
+
head?: LineEnd;
|
|
872
|
+
/** Arrow or decoration type at the end of the line. */
|
|
873
|
+
tail?: LineEnd;
|
|
874
|
+
};
|
|
875
|
+
|
|
876
|
+
/** An identifier for a geometry guide */
|
|
877
|
+
type GeomGuideName = string;
|
|
878
|
+
|
|
879
|
+
type AdjustCoordinate = EmuValue | GeomGuideName;
|
|
880
|
+
|
|
881
|
+
/**
|
|
882
|
+
* A path command to draw an elliptical arc to an endpoint.
|
|
883
|
+
*/
|
|
884
|
+
type ArcToCommand = ['A', AdjustCoordinate, AdjustCoordinate, AdjustCoordinate, AdjustCoordinate];
|
|
885
|
+
|
|
886
|
+
/**
|
|
887
|
+
* A path command to close the current subpath by drawing a line to the starting point.
|
|
888
|
+
*/
|
|
889
|
+
type CloseCommand = ['Z'];
|
|
890
|
+
|
|
891
|
+
/**
|
|
892
|
+
* A path command to draw a cubic Bézier curve to an endpoint.
|
|
893
|
+
*/
|
|
894
|
+
type CubicBezierToCommand = ['C', AdjustCoordinate, AdjustCoordinate, AdjustCoordinate, AdjustCoordinate, AdjustCoordinate, AdjustCoordinate];
|
|
895
|
+
|
|
896
|
+
/**
|
|
897
|
+
* A path command to draw a line from the current position to a new one.
|
|
898
|
+
*/
|
|
899
|
+
type LineToCommand = ['L', AdjustCoordinate, AdjustCoordinate];
|
|
900
|
+
|
|
901
|
+
/**
|
|
902
|
+
* A path command to move pen to a new position without drawing.
|
|
903
|
+
*/
|
|
904
|
+
type MoveToCommand = ['M', AdjustCoordinate, AdjustCoordinate];
|
|
905
|
+
|
|
906
|
+
/**
|
|
907
|
+
* A path command to draw a quadratic Bézier curve to an endpoint.
|
|
908
|
+
*/
|
|
909
|
+
type QuadraticBezierToCommand = ['Q', AdjustCoordinate, AdjustCoordinate, AdjustCoordinate, AdjustCoordinate];
|
|
910
|
+
|
|
911
|
+
/**
|
|
912
|
+
* Path command for shape geometry.
|
|
913
|
+
*
|
|
914
|
+
* Defines a single drawing command in a shape path, using a subset of SVG path commands.
|
|
915
|
+
*/
|
|
916
|
+
type PathCommand = ArcToCommand | CloseCommand | CubicBezierToCommand | LineToCommand | MoveToCommand | QuadraticBezierToCommand;
|
|
917
|
+
|
|
918
|
+
/**
|
|
919
|
+
* Specifies the manner in which a path should be filled.
|
|
920
|
+
*
|
|
921
|
+
* | Value | Effect on path fill
|
|
922
|
+
* |---------------|--------------------------------
|
|
923
|
+
* | `darken` | darker shaded color applied to its fill.
|
|
924
|
+
* | `darkenLess` | slightly darker shaded color applied to its fill.
|
|
925
|
+
* | `lighten` | lightly shaded color applied to its fill.
|
|
926
|
+
* | `lightenLess` | slightly lighter shaded color applied to its fill.
|
|
927
|
+
* | `none` | should have no fill.
|
|
928
|
+
* | `norm` | should have a normally shaded color applied to its fill.
|
|
929
|
+
*/
|
|
930
|
+
type PathFillMode = 'none' | 'norm' | 'lighten' | 'lightenLess' | 'darken' | 'darkenLess';
|
|
931
|
+
|
|
932
|
+
/**
|
|
933
|
+
* Shape geometry path definition.
|
|
934
|
+
*
|
|
935
|
+
* Defines a single path within a custom shape's geometry, including
|
|
936
|
+
* the path commands and rendering properties for that path.
|
|
937
|
+
*/
|
|
938
|
+
type Path = {
|
|
939
|
+
/** Whether this path should be stroked (outlined). */
|
|
940
|
+
stroke: boolean;
|
|
941
|
+
/** Fill mode for the path. */
|
|
942
|
+
fill: PathFillMode;
|
|
943
|
+
/**
|
|
944
|
+
* Specifies the height, or maximum y coordinate that should be used for within the path
|
|
945
|
+
* coordinate system. This value determines the vertical placement of all points within the
|
|
946
|
+
* corresponding path as they will all be calculated using this height attribute as the max y
|
|
947
|
+
* coordinate.
|
|
948
|
+
*/
|
|
949
|
+
height: PositiveCoordinate;
|
|
950
|
+
/**
|
|
951
|
+
* Specifies the width, or maximum x coordinate that should be used for within the path
|
|
952
|
+
* coordinate system. This value determines the horizontal placement of all points within
|
|
953
|
+
* the corresponding path as they will all be calculated using this width attribute as the max
|
|
954
|
+
* x coordinate.
|
|
955
|
+
*/
|
|
956
|
+
width: PositiveCoordinate;
|
|
957
|
+
/** Array of path commands (moveTo, lineTo, etc.) defining the path geometry. */
|
|
958
|
+
d: PathCommand[];
|
|
959
|
+
};
|
|
960
|
+
|
|
961
|
+
/**
|
|
962
|
+
* Defines an inset or internal margins for a text box within a shape.
|
|
963
|
+
*/
|
|
964
|
+
type InsetRect = {
|
|
965
|
+
/**
|
|
966
|
+
* Top edge inset from shape bounds in EMUs.
|
|
967
|
+
* @defaultValue 45720
|
|
968
|
+
*/
|
|
969
|
+
t?: EmuValue;
|
|
970
|
+
/**
|
|
971
|
+
* Left edge inset from shape bounds in EMUs.
|
|
972
|
+
* @defaultValue 91440
|
|
973
|
+
*/
|
|
974
|
+
l?: EmuValue;
|
|
975
|
+
/**
|
|
976
|
+
* Bottom edge inset from shape bounds in EMUs.
|
|
977
|
+
* @defaultValue 45720
|
|
978
|
+
*/
|
|
979
|
+
b?: EmuValue;
|
|
980
|
+
/**
|
|
981
|
+
* Right edge inset from shape bounds in EMUs.
|
|
982
|
+
* @defaultValue 91440
|
|
983
|
+
*/
|
|
984
|
+
r?: EmuValue;
|
|
985
|
+
};
|
|
986
|
+
|
|
987
|
+
/** A paragraph of text. */
|
|
988
|
+
type Paragraph = {
|
|
989
|
+
/** Text content. */
|
|
990
|
+
text: string;
|
|
991
|
+
};
|
|
992
|
+
|
|
993
|
+
/**
|
|
994
|
+
* Text vertical anchoring/alignment.
|
|
995
|
+
*
|
|
996
|
+
* Defines how text is vertically positioned within its container:
|
|
997
|
+
*
|
|
998
|
+
* | Value | Position |
|
|
999
|
+
* |--------|-----------------------------------------|
|
|
1000
|
+
* | `t` | Top aligned |
|
|
1001
|
+
* | `ctr` | Center aligned |
|
|
1002
|
+
* | `b` | Bottom aligned |
|
|
1003
|
+
* | `dist` | Distributed (evenly spaced lines) |
|
|
1004
|
+
* | `just` | Justified (stretched to fill container) |
|
|
1005
|
+
*/
|
|
1006
|
+
type TextAnchoring = 't' | 'b' | 'ctr' | 'dist' | 'just';
|
|
1007
|
+
|
|
1008
|
+
/**
|
|
1009
|
+
* Text horizontal overflow behavior.
|
|
1010
|
+
*
|
|
1011
|
+
* Defines how text is handled when it exceeds the horizontal bounds of its container:
|
|
1012
|
+
*
|
|
1013
|
+
* | Value | Behavior |
|
|
1014
|
+
* |------------|-----------------------------------------------|
|
|
1015
|
+
* | `overflow` | Text extends beyond container bounds |
|
|
1016
|
+
* | `clip` | Text is clipped at container edge |
|
|
1017
|
+
*/
|
|
1018
|
+
type TextHorzOverflow = 'overflow' | 'clip';
|
|
1019
|
+
|
|
1020
|
+
/**
|
|
1021
|
+
* If there is vertical text, determines what type of vertical text is going to be used.
|
|
1022
|
+
*
|
|
1023
|
+
* | Value | Behavior
|
|
1024
|
+
* |------------------|------------------------------
|
|
1025
|
+
* | `horz` | Horizontal text (default).
|
|
1026
|
+
* | `vert` | Line are rotated 90° clockwise, ordered from top to bottom.
|
|
1027
|
+
* | `vert270` | Lines are rotated 270° clockwise, ordered from bottom to top.
|
|
1028
|
+
* | `wordArtVert` | One letter on top of another.
|
|
1029
|
+
* | `wordArtVertRtl` | Vertical WordArt should be shown from right to left.
|
|
1030
|
+
* | `eaVert` | Some fonts are rotated by 90° while some (East Asian) are shown vertically.
|
|
1031
|
+
* | `mongolianVert` | `eaVert` but the text flows top down then LEFT RIGHT, instead of RIGHT LEFT.
|
|
1032
|
+
*/
|
|
1033
|
+
type TextVerticalType = 'horz' | 'vert' | 'vert270' | 'wordArtVert' | 'eaVert' | 'mongolianVert' | 'wordArtVertRtl';
|
|
1034
|
+
|
|
1035
|
+
/**
|
|
1036
|
+
* Text vertical overflow behavior.
|
|
1037
|
+
*
|
|
1038
|
+
* Defines how text is handled when it exceeds the vertical bounds of its container:
|
|
1039
|
+
*
|
|
1040
|
+
* | Value | Behavior |
|
|
1041
|
+
* |------------|-----------------------------------------------|
|
|
1042
|
+
* | `overflow` | Text extends beyond container bounds |
|
|
1043
|
+
* | `ellipsis` | Text is truncated with ellipsis indicator |
|
|
1044
|
+
* | `clip` | Text is clipped at container edge |
|
|
1045
|
+
*/
|
|
1046
|
+
type TextVertOverflow = 'overflow' | 'ellipsis' | 'clip';
|
|
1047
|
+
|
|
1048
|
+
/**
|
|
1049
|
+
* Text wrapping behavior.
|
|
1050
|
+
*
|
|
1051
|
+
* Defines how text wraps within its container:
|
|
1052
|
+
*
|
|
1053
|
+
* | Value | Behavior |
|
|
1054
|
+
* |----------|---------------------------------------------|
|
|
1055
|
+
* | `none` | No wrapping (text runs on a single line) |
|
|
1056
|
+
* | `square` | Wrap text at container boundaries |
|
|
1057
|
+
*/
|
|
1058
|
+
type TextWrapping = 'none' | 'square';
|
|
1059
|
+
|
|
1060
|
+
/**
|
|
1061
|
+
* Text body container.
|
|
1062
|
+
*
|
|
1063
|
+
* Defines the text content within a shape, including paragraphs and formatting properties
|
|
1064
|
+
* such as alignment, overflow behavior, columns, rotation, and insets.
|
|
1065
|
+
*/
|
|
1066
|
+
type TextBody = {
|
|
1067
|
+
/**
|
|
1068
|
+
* Vertical anchoring/alignment of text within the shape.
|
|
1069
|
+
* @defaultValue "t"
|
|
1070
|
+
*/
|
|
1071
|
+
anchor?: TextAnchoring;
|
|
1072
|
+
/**
|
|
1073
|
+
* Whether text is centered at the anchor point.
|
|
1074
|
+
* @defaultValue false
|
|
1075
|
+
*/
|
|
1076
|
+
anchorCtr?: boolean;
|
|
1077
|
+
/**
|
|
1078
|
+
* Number of text columns.
|
|
1079
|
+
* @defaultValue 1
|
|
1080
|
+
*/
|
|
1081
|
+
numCol?: number;
|
|
1082
|
+
/**
|
|
1083
|
+
* Text rotation in 60,000ths of a degree (e.g., 5400000 = 90 degrees).
|
|
1084
|
+
* @defaultValue 0
|
|
1085
|
+
*/
|
|
1086
|
+
rot?: DmlAngle;
|
|
1087
|
+
/**
|
|
1088
|
+
* Whether columns flow right-to-left.
|
|
1089
|
+
* @defaultValue false
|
|
1090
|
+
*/
|
|
1091
|
+
rtlCol?: boolean;
|
|
1092
|
+
/**
|
|
1093
|
+
* Spacing between columns in EMUs.
|
|
1094
|
+
* @defaultValue 0
|
|
1095
|
+
*/
|
|
1096
|
+
spcCol?: PositiveCoordinate;
|
|
1097
|
+
/**
|
|
1098
|
+
* Whether to apply spacing before first and after last paragraph.
|
|
1099
|
+
* @defaultValue false
|
|
1100
|
+
*/
|
|
1101
|
+
spcFirstLastPara?: boolean;
|
|
1102
|
+
/**
|
|
1103
|
+
* Keep text upright regardless of shape rotation.
|
|
1104
|
+
* @defaultValue false
|
|
1105
|
+
*/
|
|
1106
|
+
upright?: boolean;
|
|
1107
|
+
/**
|
|
1108
|
+
* Text orientation is vertical (top-to-bottom).
|
|
1109
|
+
* @defaultValue "horz"
|
|
1110
|
+
*/
|
|
1111
|
+
vert?: TextVerticalType;
|
|
1112
|
+
/**
|
|
1113
|
+
* Horizontal overflow behavior.
|
|
1114
|
+
* @defaultValue "overflow"
|
|
1115
|
+
*/
|
|
1116
|
+
horzOverflow?: TextHorzOverflow;
|
|
1117
|
+
/**
|
|
1118
|
+
* Vertical overflow behavior.
|
|
1119
|
+
* @defaultValue "overflow"
|
|
1120
|
+
*/
|
|
1121
|
+
vertOverflow?: TextVertOverflow;
|
|
1122
|
+
/**
|
|
1123
|
+
* Text wrapping behavior.
|
|
1124
|
+
* @defaultValue "square"
|
|
1125
|
+
*/
|
|
1126
|
+
wrap?: TextWrapping;
|
|
1127
|
+
/**
|
|
1128
|
+
* Defines an inset or internal margins for a text box within a shape.
|
|
1129
|
+
*/
|
|
1130
|
+
inset?: InsetRect;
|
|
1131
|
+
/** Array of paragraphs containing the text content. */
|
|
1132
|
+
p: Paragraph[];
|
|
1133
|
+
};
|
|
1134
|
+
|
|
1135
|
+
type AdjustPoint = {
|
|
1136
|
+
x: AdjustCoordinate;
|
|
1137
|
+
y: AdjustCoordinate;
|
|
1138
|
+
};
|
|
1139
|
+
|
|
1140
|
+
/**
|
|
1141
|
+
* Polar adjustment handle for custom shapes.
|
|
1142
|
+
*
|
|
1143
|
+
* Defines an interactive handle that can be dragged to adjust shape geometry
|
|
1144
|
+
* using polar coordinates (angle and radius from a center point).
|
|
1145
|
+
*/
|
|
1146
|
+
type AdjustValueHandlePolar = {
|
|
1147
|
+
/** Type discriminator for polar adjustment handles. */
|
|
1148
|
+
type: 'polar';
|
|
1149
|
+
/** Name of the guide that this handle adjusts for angle. */
|
|
1150
|
+
gdRefAng?: GeomGuideName;
|
|
1151
|
+
/** Maximum angle value allowed for this handle (in degrees or reference to guide). */
|
|
1152
|
+
maxAng?: GeomGuideName | DmlAngle;
|
|
1153
|
+
/** Minimum angle value allowed for this handle (in degrees or reference to guide). */
|
|
1154
|
+
minAng?: GeomGuideName | DmlAngle;
|
|
1155
|
+
/** Name of the guide that this handle adjusts for radius. */
|
|
1156
|
+
gdRefR?: GeomGuideName;
|
|
1157
|
+
/** Maximum radius value allowed for this handle (in shape coordinates or reference to guide). */
|
|
1158
|
+
maxR?: GeomGuideName | EmuValue;
|
|
1159
|
+
/** Minimum radius value allowed for this handle (in shape coordinates or reference to guide). */
|
|
1160
|
+
minR?: GeomGuideName | EmuValue;
|
|
1161
|
+
/** Position of the adjustment handle in the shape's coordinate system. */
|
|
1162
|
+
pos: AdjustPoint;
|
|
1163
|
+
};
|
|
1164
|
+
|
|
1165
|
+
/**
|
|
1166
|
+
* XY adjustment handle for custom shapes.
|
|
1167
|
+
*
|
|
1168
|
+
* Defines an interactive handle that can be dragged to adjust shape geometry
|
|
1169
|
+
* using Cartesian coordinates (X and Y positions).
|
|
1170
|
+
*/
|
|
1171
|
+
type AdjustValueHandleXY = {
|
|
1172
|
+
/** Type discriminator for XY adjustment handles. */
|
|
1173
|
+
type: 'xy';
|
|
1174
|
+
/** Name of the guide that this handle adjusts for the X axis. */
|
|
1175
|
+
gdRefX?: GeomGuideName;
|
|
1176
|
+
/** Maximum X coordinate value allowed for this handle (as coordinate or reference to guide). */
|
|
1177
|
+
maxX?: GeomGuideName | EmuValue;
|
|
1178
|
+
/** Minimum X coordinate value allowed for this handle (as coordinate or reference to guide). */
|
|
1179
|
+
minX?: GeomGuideName | EmuValue;
|
|
1180
|
+
/** Name of the guide that this handle adjusts for the Y axis. */
|
|
1181
|
+
gdRefY?: GeomGuideName;
|
|
1182
|
+
/** Maximum Y coordinate value allowed for this handle (as coordinate or reference to guide). */
|
|
1183
|
+
maxY?: GeomGuideName | EmuValue;
|
|
1184
|
+
/** Minimum Y coordinate value allowed for this handle (as coordinate or reference to guide). */
|
|
1185
|
+
minY?: GeomGuideName | EmuValue;
|
|
1186
|
+
/** Position of the adjustment handle in the shape's coordinate system. */
|
|
1187
|
+
pos: AdjustPoint;
|
|
1188
|
+
};
|
|
1189
|
+
|
|
1190
|
+
/**
|
|
1191
|
+
* Specifies how an object should be rendered when specified to be in black and white mode
|
|
1192
|
+
*
|
|
1193
|
+
* | Value | Color rendering
|
|
1194
|
+
* |--------------------------------|--------------------------------
|
|
1195
|
+
* | `auto` (Automatic) | Rendered with automatic coloring
|
|
1196
|
+
* | `black` (Black) | Rendered with black-only coloring
|
|
1197
|
+
* | `blackGray` (Black and Gray) | Rendered with black and gray coloring
|
|
1198
|
+
* | `blackWhite` (Black and White) | Rendered within black and white coloring
|
|
1199
|
+
* | `clr` (Color) | Rendered with normal coloring
|
|
1200
|
+
* | `gray` (Gray) | Rendered with gray coloring
|
|
1201
|
+
* | `grayWhite` (Gray and White) | Rendered within gray and white coloring
|
|
1202
|
+
* | `hidden` (Hidden) | Rendered with hidden coloring
|
|
1203
|
+
* | `invGray` (Inverse Gray) | Rendered with inverse gray coloring
|
|
1204
|
+
* | `ltGray` (Light Gray) | Rendered with light gray coloring
|
|
1205
|
+
* | `white` (White) | Rendered within white coloring
|
|
1206
|
+
*/
|
|
1207
|
+
type BlackWhiteMode = 'clr' | 'auto' | 'gray' | 'ltGray' | 'invGray' | 'grayWhite' | 'blackGray' | 'blackWhite' | 'black' | 'white' | 'hidden';
|
|
1208
|
+
|
|
1209
|
+
/**
|
|
1210
|
+
* Defines a connection point on a shape where other shapes can connect.
|
|
1211
|
+
* Connection points are used for connecting shapes with connectors/lines in diagrams.
|
|
1212
|
+
*/
|
|
1213
|
+
type ConnectionPoint = {
|
|
1214
|
+
/** The position of the connection point on the shape */
|
|
1215
|
+
pos: AdjustPoint;
|
|
1216
|
+
/**
|
|
1217
|
+
* The angle of the connection point, either as a specific angle or a reference
|
|
1218
|
+
* to a geometry guide
|
|
1219
|
+
*/
|
|
1220
|
+
ang?: DmlAngle | GeomGuideName;
|
|
1221
|
+
};
|
|
1222
|
+
|
|
1223
|
+
type FontStyleIndex = 'major' | 'minor' | 'none';
|
|
1224
|
+
|
|
1225
|
+
/**
|
|
1226
|
+
* Guide point for custom shape geometry.
|
|
1227
|
+
*
|
|
1228
|
+
* Defines a named calculation point that can be referenced in shape paths
|
|
1229
|
+
* and used to create parameterized, adjustable geometry.
|
|
1230
|
+
*/
|
|
1231
|
+
type GuidePoint = {
|
|
1232
|
+
/**
|
|
1233
|
+
* Name identifier for this guide point, used to reference it in formulas and paths.
|
|
1234
|
+
*/
|
|
1235
|
+
name: string;
|
|
1236
|
+
/**
|
|
1237
|
+
* Formula expression defining the guide point's value (e.g., "val 50000" for a constant value).
|
|
1238
|
+
*/
|
|
1239
|
+
fmla: string;
|
|
1240
|
+
};
|
|
1241
|
+
|
|
1242
|
+
/**
|
|
1243
|
+
* Shape text margin rectangle.
|
|
1244
|
+
*
|
|
1245
|
+
* Defines the inset rectangle within a shape where text should be positioned,
|
|
1246
|
+
* specified using adjustable coordinates relative to the shape's geometry.
|
|
1247
|
+
*/
|
|
1248
|
+
type ShapeRect = {
|
|
1249
|
+
/** Top edge inset from shape bounds. */
|
|
1250
|
+
t: AdjustCoordinate;
|
|
1251
|
+
/** Left edge inset from shape bounds. */
|
|
1252
|
+
l: AdjustCoordinate;
|
|
1253
|
+
/** Bottom edge inset from shape bounds. */
|
|
1254
|
+
b: AdjustCoordinate;
|
|
1255
|
+
/** Right edge inset from shape bounds. */
|
|
1256
|
+
r: AdjustCoordinate;
|
|
1257
|
+
};
|
|
1258
|
+
|
|
1259
|
+
/**
|
|
1260
|
+
* Transform directions to be applied to drawn graphic objects.
|
|
1261
|
+
*/
|
|
1262
|
+
type Xfrm = {
|
|
1263
|
+
/**
|
|
1264
|
+
* Which axes the shape should be flipped about.
|
|
1265
|
+
* @defaultValue "none"
|
|
1266
|
+
*/
|
|
1267
|
+
flip?: FlipAxis;
|
|
1268
|
+
/**
|
|
1269
|
+
* Rotation angle in 60,000ths of a degree.
|
|
1270
|
+
* @defaultValue 0
|
|
1271
|
+
*/
|
|
1272
|
+
rot?: DmlAngle;
|
|
1273
|
+
/**
|
|
1274
|
+
* Offset/position of the graphic object.
|
|
1275
|
+
*/
|
|
1276
|
+
off?: Point;
|
|
1277
|
+
/** Extents/size of the graphic object. */
|
|
1278
|
+
ext?: Extent;
|
|
1279
|
+
};
|
|
1280
|
+
|
|
1281
|
+
type ShapeStyle = {
|
|
1282
|
+
line?: {
|
|
1283
|
+
color: Color;
|
|
1284
|
+
index: number;
|
|
1285
|
+
};
|
|
1286
|
+
fill?: {
|
|
1287
|
+
color: Color;
|
|
1288
|
+
index: number;
|
|
1289
|
+
};
|
|
1290
|
+
effect?: {
|
|
1291
|
+
color: Color;
|
|
1292
|
+
index: number;
|
|
1293
|
+
};
|
|
1294
|
+
font?: {
|
|
1295
|
+
color: Color;
|
|
1296
|
+
index: FontStyleIndex;
|
|
1297
|
+
};
|
|
1298
|
+
};
|
|
1299
|
+
|
|
1300
|
+
/**
|
|
1301
|
+
* Shape visual and geometric properties.
|
|
1302
|
+
*
|
|
1303
|
+
* Defines the complete visual styling and custom geometry for a shape,
|
|
1304
|
+
* including fill, line, transformation, custom paths, and interactive handles.
|
|
1305
|
+
*/
|
|
1306
|
+
type Shape = {
|
|
1307
|
+
/** 2D transformation (position, rotation, scale). */
|
|
1308
|
+
xfrm?: Xfrm;
|
|
1309
|
+
/** Black-and-white rendering mode for grayscale or duotone display. */
|
|
1310
|
+
bwMode?: BlackWhiteMode;
|
|
1311
|
+
/** Preset shape type identifier (e.g., "rect", "ellipse", "roundRect"). */
|
|
1312
|
+
preset?: string;
|
|
1313
|
+
/** Visual style references (fill, line, effect styles from theme). */
|
|
1314
|
+
style?: ShapeStyle;
|
|
1315
|
+
/** Custom geometry paths defining the shape outline. */
|
|
1316
|
+
paths?: Path[];
|
|
1317
|
+
/** Text margin rectangle (inset from shape bounds for text positioning). */
|
|
1318
|
+
rect?: ShapeRect;
|
|
1319
|
+
/** Adjustment handles, allowing interactive shape geometry modification. */
|
|
1320
|
+
ah?: (AdjustValueHandleXY | AdjustValueHandlePolar)[];
|
|
1321
|
+
/** Adjustment values (guide points that store user-adjustable parameters). */
|
|
1322
|
+
av?: GuidePoint[];
|
|
1323
|
+
/** Shape guides (calculated points used in geometry formulas). */
|
|
1324
|
+
gd?: GuidePoint[];
|
|
1325
|
+
/** Connection points for attaching connectors to the shape. */
|
|
1326
|
+
cxn?: ConnectionPoint[];
|
|
1327
|
+
/** Line/outline styling properties. */
|
|
1328
|
+
line?: Line;
|
|
1329
|
+
/** Fill styling (solid, gradient, pattern, image, or none). */
|
|
1330
|
+
fill?: Fill;
|
|
1331
|
+
};
|
|
1332
|
+
|
|
1333
|
+
/**
|
|
1334
|
+
* Bitmap graphic / Picture.
|
|
1335
|
+
*/
|
|
1336
|
+
type GraphicBitmap = {
|
|
1337
|
+
/** Type discriminator for bitmap graphics. */
|
|
1338
|
+
type: 'bitmap';
|
|
1339
|
+
/** Unique identifier for this bitmap object. */
|
|
1340
|
+
id: string;
|
|
1341
|
+
/** Display name of the bitmap. */
|
|
1342
|
+
name: string;
|
|
1343
|
+
/**
|
|
1344
|
+
* Reference to the media/image resource to use.
|
|
1345
|
+
* @see {@link Workbook.images}.
|
|
1346
|
+
*/
|
|
1347
|
+
mediaId: string;
|
|
1348
|
+
/** Optional description or alt text for the bitmap. */
|
|
1349
|
+
desc?: string;
|
|
1350
|
+
/** Visual styling properties (fill, line, effects, etc.). */
|
|
1351
|
+
shape?: Shape;
|
|
1352
|
+
/** Whether to lock the aspect ratio when resizing. */
|
|
1353
|
+
noChangeAspect?: boolean;
|
|
1354
|
+
/** 2D transformation (position, rotation, scale). */
|
|
1355
|
+
xfrm?: Xfrm;
|
|
1356
|
+
/** Optional text content overlaid on the bitmap. */
|
|
1357
|
+
text?: TextBody;
|
|
1358
|
+
/**
|
|
1359
|
+
* Opacity value (0-100, where 100 is fully opaque).
|
|
1360
|
+
* @min 0
|
|
1361
|
+
* @max 100
|
|
1362
|
+
* @defaultValue 0
|
|
1363
|
+
*/
|
|
1364
|
+
alpha?: Percentage;
|
|
1365
|
+
/** Rectangle defining how the image should be stretched (relative coordinates). */
|
|
1366
|
+
stretchRect?: RelativeRect;
|
|
1367
|
+
/** Rectangle defining the source crop area of the image (relative coordinates). */
|
|
1368
|
+
srcRect?: RelativeRect;
|
|
1369
|
+
};
|
|
1370
|
+
|
|
1371
|
+
/**
|
|
1372
|
+
* A chart or plot.
|
|
1373
|
+
*/
|
|
1374
|
+
type GraphicChart = {
|
|
1375
|
+
/** Type discriminator for a chart. */
|
|
1376
|
+
type: 'chart';
|
|
1377
|
+
/** Unique identifier for this chart. */
|
|
1378
|
+
id: string;
|
|
1379
|
+
/** Display name of the chart. */
|
|
1380
|
+
name: string;
|
|
1381
|
+
/** ID */
|
|
1382
|
+
chartId: string;
|
|
1383
|
+
/** 2D transformation (position, rotation, scale). */
|
|
1384
|
+
xfrm?: Xfrm;
|
|
1385
|
+
};
|
|
1386
|
+
|
|
1387
|
+
/**
|
|
1388
|
+
* Connection shape (connector).
|
|
1389
|
+
*
|
|
1390
|
+
* Represents a connector or line shape that connects two other shapes,
|
|
1391
|
+
* typically used for creating diagrams, flowcharts, and organizational charts.
|
|
1392
|
+
*/
|
|
1393
|
+
type GraphicConnectionShape = {
|
|
1394
|
+
/** Type discriminator for connection shapes. */
|
|
1395
|
+
type: 'connectionShape';
|
|
1396
|
+
/** Unique identifier for this connection shape. */
|
|
1397
|
+
id: string;
|
|
1398
|
+
/** Display name of the connection shape. */
|
|
1399
|
+
name: string;
|
|
1400
|
+
/** Visual styling properties (line style, color, effects, etc.). */
|
|
1401
|
+
shape?: Shape;
|
|
1402
|
+
/** 2D transformation (position, rotation, scale). */
|
|
1403
|
+
xfrm?: Xfrm;
|
|
1404
|
+
/** Optional text content displayed on or near the connector. */
|
|
1405
|
+
text?: TextBody;
|
|
1406
|
+
};
|
|
1407
|
+
|
|
1408
|
+
/**
|
|
1409
|
+
* Transform directions to be applied to group objects.
|
|
1410
|
+
*/
|
|
1411
|
+
type XfrmGroup = Xfrm & {
|
|
1412
|
+
/** Child offset - position of child elements within a group. */
|
|
1413
|
+
chOff?: Point;
|
|
1414
|
+
/** Child extents - size of the child coordinate system within a group. */
|
|
1415
|
+
chExt?: Extent;
|
|
1416
|
+
};
|
|
1417
|
+
|
|
1418
|
+
/**
|
|
1419
|
+
* Group shape container.
|
|
1420
|
+
*
|
|
1421
|
+
* Represents a collection of graphic objects grouped together as a single unit,
|
|
1422
|
+
* allowing them to be transformed, moved, and manipulated collectively.
|
|
1423
|
+
*/
|
|
1424
|
+
type GraphicGroup = {
|
|
1425
|
+
/** Type discriminator for group shapes. */
|
|
1426
|
+
type: 'group';
|
|
1427
|
+
/** Unique identifier for this group. */
|
|
1428
|
+
id: string;
|
|
1429
|
+
/** Display name of the group. */
|
|
1430
|
+
name: string;
|
|
1431
|
+
/** Array of graphic objects contained within this group. */
|
|
1432
|
+
content: Graphic[];
|
|
1433
|
+
/** 2D transformation applied to the group (position, rotation, scale). */
|
|
1434
|
+
xfrm?: XfrmGroup;
|
|
1435
|
+
};
|
|
1436
|
+
|
|
1437
|
+
/**
|
|
1438
|
+
* Basic shape object.
|
|
1439
|
+
*
|
|
1440
|
+
* Represents a standard geometric shape (rectangle, circle, arrow, etc.)
|
|
1441
|
+
* with customizable geometry, styling, and text content.
|
|
1442
|
+
*/
|
|
1443
|
+
type GraphicShape = {
|
|
1444
|
+
/** Type discriminator for basic shapes. */
|
|
1445
|
+
type: 'shape';
|
|
1446
|
+
/** Unique identifier for this shape. */
|
|
1447
|
+
id: string;
|
|
1448
|
+
/** Display name of the shape. */
|
|
1449
|
+
name: string;
|
|
1450
|
+
/** 2D transformation (position, rotation, scale). */
|
|
1451
|
+
xfrm?: Xfrm;
|
|
1452
|
+
/** Visual styling properties (fill, line, effects, geometry preset, etc.). */
|
|
1453
|
+
shape?: Shape;
|
|
1454
|
+
/** Optional text content displayed within the shape. */
|
|
1455
|
+
text?: TextBody;
|
|
1456
|
+
};
|
|
1457
|
+
|
|
1458
|
+
/** A graphic element. */
|
|
1459
|
+
type Graphic = GraphicChart | GraphicBitmap | GraphicShape | GraphicConnectionShape | GraphicGroup;
|
|
1460
|
+
|
|
1461
|
+
/**
|
|
1462
|
+
* A drawing.
|
|
1463
|
+
*
|
|
1464
|
+
* A drawing is a collection of any graphic objects that should be displayed in a worksheet as
|
|
1465
|
+
* well as information on how they are positioned within the cell-grid.
|
|
1466
|
+
*/
|
|
1467
|
+
type Drawing = {
|
|
1468
|
+
/** Defines how the drawing is placed onto a worksheet's cell-grid. */
|
|
1469
|
+
anchor: GraphicAnchor;
|
|
1470
|
+
/** The graphical elements that make up the drawing. */
|
|
1471
|
+
content: Graphic[];
|
|
1472
|
+
};
|
|
1473
|
+
|
|
239
1474
|
/**
|
|
240
1475
|
* The style to use when drawing a cell border. If the worksheet's zoom factor is changed the width
|
|
241
1476
|
* of the border is expected to stay the same.
|
|
@@ -273,14 +1508,6 @@ type BorderStyle =
|
|
|
273
1508
|
/** Draw a 1px wide pixel continuous line.*/
|
|
274
1509
|
'thin';
|
|
275
1510
|
|
|
276
|
-
/**
|
|
277
|
-
* A hex-encoded RGB or RGBA value that conforms to the CSS4 color specification (e.g. `"#3cb371"`).
|
|
278
|
-
*
|
|
279
|
-
* @see {@link https://www.w3.org/TR/css-color-4/#hex-notation | CSS hexadecimal notation spec}
|
|
280
|
-
* @pattern ^#([a-fA-F0-9]{3,4}|([a-fA-F0-9][a-fA-F0-9]){3,4})$
|
|
281
|
-
*/
|
|
282
|
-
type Color = `#${string}`;
|
|
283
|
-
|
|
284
1511
|
/**
|
|
285
1512
|
* Specifies the horizontal alignment of content (text) within a container (cell).
|
|
286
1513
|
*/
|
|
@@ -578,125 +1805,6 @@ type Table = {
|
|
|
578
1805
|
style?: TableStyle;
|
|
579
1806
|
};
|
|
580
1807
|
|
|
581
|
-
/**
|
|
582
|
-
* Base type for text runs that annotate ranges within threaded comment text.
|
|
583
|
-
*
|
|
584
|
-
* A text run identifies a contiguous range of characters in the comment text, specified by
|
|
585
|
-
* zero-indexed start and end positions. Text runs allow metadata to be attached to specific
|
|
586
|
-
* portions of text, enabling features such as hyperlinks, mentions, and formatting.
|
|
587
|
-
*
|
|
588
|
-
* ## How text runs work
|
|
589
|
-
*
|
|
590
|
-
* Each text run specifies a range within the comment text using `start` (inclusive) and `end`
|
|
591
|
-
* (exclusive) character positions. For example, in the text "Hello @foo", a mention text run
|
|
592
|
-
* for "@foo" would have `start: 6` and `end: 10`.
|
|
593
|
-
*
|
|
594
|
-
* Multiple text runs can exist within a single comment, allowing different types of annotations
|
|
595
|
-
* to coexist (a mention and a hyperlink in the same text, for example).
|
|
596
|
-
*
|
|
597
|
-
* @see {@link MentionTextRun} for mentions of people
|
|
598
|
-
* @see {@link HyperlinkTextRun} for hyperlinks
|
|
599
|
-
*/
|
|
600
|
-
type TextRun = {
|
|
601
|
-
/** Starting character position of the run in the text (zero-indexed). */
|
|
602
|
-
start: integer;
|
|
603
|
-
/** Ending character position of the run in the text (zero-indexed, exclusive). */
|
|
604
|
-
end: integer;
|
|
605
|
-
};
|
|
606
|
-
|
|
607
|
-
/**
|
|
608
|
-
* A {@link TextRun | text run} representing a hyperlink within a threaded comment's text.
|
|
609
|
-
*/
|
|
610
|
-
type HyperlinkTextRun = TextRun & {
|
|
611
|
-
/** Discriminator to identify this as a hyperlink text run. */
|
|
612
|
-
type: 'hyperlink';
|
|
613
|
-
/** The URL that the hyperlink points to. */
|
|
614
|
-
url: string;
|
|
615
|
-
};
|
|
616
|
-
|
|
617
|
-
/**
|
|
618
|
-
* A {@link TextRun | text run} representing a mention of a person within a threaded comment's text.
|
|
619
|
-
*/
|
|
620
|
-
type MentionTextRun = TextRun & {
|
|
621
|
-
/** Discriminator to identify this as a mention text run. */
|
|
622
|
-
type: 'mention';
|
|
623
|
-
/**
|
|
624
|
-
* Unique identifier of the person being mentioned. Use this to find the person's details in a
|
|
625
|
-
* {@link Workbook.people | workbook's list of people}.
|
|
626
|
-
*
|
|
627
|
-
* Excel always uses a UUID in the format `{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}`, but JSF makes
|
|
628
|
-
* no strict requirement.
|
|
629
|
-
*/
|
|
630
|
-
personId: string;
|
|
631
|
-
};
|
|
632
|
-
|
|
633
|
-
/**
|
|
634
|
-
* An author of a threaded comment, or a person mentioned in a threaded comment.
|
|
635
|
-
*/
|
|
636
|
-
type Person = {
|
|
637
|
-
/**
|
|
638
|
-
* A unique id for the person.
|
|
639
|
-
*
|
|
640
|
-
* Excel always uses a UUID in the format `{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}`, but JSF makes
|
|
641
|
-
* no strict requirement.
|
|
642
|
-
*/
|
|
643
|
-
id: string;
|
|
644
|
-
/** The person's name as it should be shown to other users. */
|
|
645
|
-
displayName: string;
|
|
646
|
-
/**
|
|
647
|
-
* Optional provider-issued user identifier that varies in format depending on the provider. See
|
|
648
|
-
* {@link Person.providerId} for details on possible values.
|
|
649
|
-
*/
|
|
650
|
-
userId?: string;
|
|
651
|
-
/**
|
|
652
|
-
* Specifies where the person's information came from. Excel supports the following values:
|
|
653
|
-
*
|
|
654
|
-
* - `None`: no specific provider; {@link Person.userId} is expected to be the person's name.
|
|
655
|
-
* - `AD`: Active Directory; {@link Person.userId} will be Active Directory id.
|
|
656
|
-
* - `Windows Live`: Microsoft account; {@link Person.userId} will be a 64-bit signed decimal.
|
|
657
|
-
* - `PeoplePicker`: SharePoint People Picker; {@link Person.userId} will be an email address.
|
|
658
|
-
*/
|
|
659
|
-
providerId?: string;
|
|
660
|
-
};
|
|
661
|
-
|
|
662
|
-
/**
|
|
663
|
-
* A threaded comment that is attached to an individual cell.
|
|
664
|
-
*/
|
|
665
|
-
type ThreadedComment = {
|
|
666
|
-
/**
|
|
667
|
-
* Unique identifier for the comment.
|
|
668
|
-
*
|
|
669
|
-
* Excel always uses a UUID in the format `{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}`, but JSF makes
|
|
670
|
-
* no strict requirement.
|
|
671
|
-
*/
|
|
672
|
-
id: string;
|
|
673
|
-
/**
|
|
674
|
-
* Unique identifier of the parent comment, if this is a reply in a thread.
|
|
675
|
-
*
|
|
676
|
-
* Excel always uses a UUID in the format `{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}`, but JSF makes
|
|
677
|
-
* no strict requirement.
|
|
678
|
-
*/
|
|
679
|
-
parentId?: string;
|
|
680
|
-
/** A1-style reference to the cell this comment is attached to. */
|
|
681
|
-
ref: CellId;
|
|
682
|
-
/** Date and time the comment was written, as an ISO formatted string. */
|
|
683
|
-
datetime?: string;
|
|
684
|
-
/**
|
|
685
|
-
* Unique identifier of the person who authored this comment. Use this to find the person's
|
|
686
|
-
* details in a {@link Workbook.people | workbook's list of people}.
|
|
687
|
-
*
|
|
688
|
-
* Excel always uses a UUID in the format `{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}`, but JSF makes
|
|
689
|
-
* no strict requirement.
|
|
690
|
-
*/
|
|
691
|
-
personId: string;
|
|
692
|
-
/** The comment text content. */
|
|
693
|
-
text: string;
|
|
694
|
-
/** Whether the comment has been marked as resolved. */
|
|
695
|
-
resolved?: boolean;
|
|
696
|
-
/** {@link TextRun | Text runs} that annotate ranges within the comment text. */
|
|
697
|
-
runs?: (MentionTextRun | HyperlinkTextRun)[];
|
|
698
|
-
};
|
|
699
|
-
|
|
700
1808
|
/**
|
|
701
1809
|
* Directions on how formulas should be recalculated in the workbook.
|
|
702
1810
|
*/
|
|
@@ -705,23 +1813,33 @@ type CalcProps = {
|
|
|
705
1813
|
* Specifies whether an attempt should be made to calculate formulas that contain circular
|
|
706
1814
|
* references. Defaults to `false` in Excel.
|
|
707
1815
|
*/
|
|
708
|
-
iterate
|
|
1816
|
+
iterate?: boolean;
|
|
709
1817
|
/**
|
|
710
1818
|
* The maximum number of calculation iterations, when {@link CalcProps.iterate} is `true`.
|
|
711
1819
|
* Defaults to `100` in Excel.
|
|
712
1820
|
*/
|
|
713
|
-
iterateCount
|
|
1821
|
+
iterateCount?: integer;
|
|
714
1822
|
/**
|
|
715
1823
|
* When a calculation iteration results in an absolute change that is less than iterateDelta,
|
|
716
1824
|
* then no further iterations should be attempted. Defaults to `0.001` in Excel.
|
|
717
1825
|
*/
|
|
718
|
-
iterateDelta
|
|
1826
|
+
iterateDelta?: number;
|
|
719
1827
|
/**
|
|
720
1828
|
* Which of the two date systems the workbook uses. 1900 is the default.
|
|
721
1829
|
*
|
|
722
1830
|
* @see {@link https://support.microsoft.com/office/e7fe7167-48a9-4b96-bb53-5612a800b487 | Date systems in Excel}
|
|
723
1831
|
*/
|
|
724
1832
|
epoch?: 1900 | 1904;
|
|
1833
|
+
/**
|
|
1834
|
+
* The calculation mode for the workbook.
|
|
1835
|
+
*
|
|
1836
|
+
* - `"auto"` (default when absent): recalculate all formulas automatically.
|
|
1837
|
+
* - `"autoNoTable"`: recalculate automatically but exclude data tables.
|
|
1838
|
+
* - `"manual"`: formulas are only recalculated when explicitly triggered.
|
|
1839
|
+
*
|
|
1840
|
+
* @defaultValue "auto"
|
|
1841
|
+
*/
|
|
1842
|
+
calcMode?: 'auto' | 'autoNoTable' | 'manual';
|
|
725
1843
|
};
|
|
726
1844
|
|
|
727
1845
|
/**
|
|
@@ -840,6 +1958,8 @@ type Worksheet = {
|
|
|
840
1958
|
showGridLines?: boolean;
|
|
841
1959
|
/** The different display configurations saved for the worksheet. */
|
|
842
1960
|
views?: WorksheetView[];
|
|
1961
|
+
/** A list of drawings that appear in this worksheet. */
|
|
1962
|
+
drawing?: Drawing[];
|
|
843
1963
|
};
|
|
844
1964
|
|
|
845
1965
|
/**
|
|
@@ -898,6 +2018,30 @@ type Workbook = {
|
|
|
898
2018
|
* @see {@link ThreadedComment}
|
|
899
2019
|
*/
|
|
900
2020
|
people?: Person[];
|
|
2021
|
+
/**
|
|
2022
|
+
* A simple dictionary of binary images used by this workbook.
|
|
2023
|
+
*
|
|
2024
|
+
* The keys should be the file paths of the images used to refer to them, commonly these will be
|
|
2025
|
+
* the `mediaId` properties on drawing objects. The values should be data URI encoded binaries.
|
|
2026
|
+
*
|
|
2027
|
+
* The following is a table of formats you may be expected to encounter:
|
|
2028
|
+
*
|
|
2029
|
+
* | Extension | MIME type | Common name
|
|
2030
|
+
* |-------------------------|------------------------|-------------
|
|
2031
|
+
* | `.png` | `image/png` | Portable Network Graphics
|
|
2032
|
+
* | `.jpg`, `.jpeg` | `image/jpeg` | JPEG
|
|
2033
|
+
* | `.gif` | `image/gif` | Graphics Interchange Format
|
|
2034
|
+
* | `.emf` | `image/emf` | Enhanced Metafile
|
|
2035
|
+
* | `.wmf` | `image/wmf` | Windows Metafile
|
|
2036
|
+
* | `.wdp`, `.jxr`, `.hdp` | `image/vnd.ms-photo` | Windows Media Photo / JPEG XR
|
|
2037
|
+
* | `.bmp` | `image/bmp` | Bitmap
|
|
2038
|
+
* | `.tif`, `.tiff` | `image/tiff` | Tagged Image File Format
|
|
2039
|
+
* | `.svg` | `image/svg+xml` | Scalable Vector Graphics
|
|
2040
|
+
*
|
|
2041
|
+
* @see {@link https://en.wikipedia.org/wiki/Data_URI_scheme}
|
|
2042
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc2397}
|
|
2043
|
+
*/
|
|
2044
|
+
images?: Record<string, string>;
|
|
901
2045
|
};
|
|
902
2046
|
|
|
903
|
-
export type { BorderStyle, CalcProps, Cell, CellId, CellRange, CellValueType, Color, Comment, DataTable, DefinedName, External, ExternalWorksheet, GridSize, HAlign, HyperlinkTextRun, MentionTextRun, Note, PatternStyle, Person, PixelValue, Style, Table, TableColumn, TableColumnDataType, TableStyle, TableStyleName, TextRun, ThreadedComment, Underline, VAlign, Workbook, WorkbookView, Worksheet, WorksheetDefaults, WorksheetLayoutScales, WorksheetView };
|
|
2047
|
+
export type { AdjustCoordinate, AdjustPoint, AdjustValueHandlePolar, AdjustValueHandleXY, ArcToCommand, BlackWhiteMode, BlipFill, BorderStyle, CalcProps, Cell, CellId, CellOffset, CellRange, CellValueType, CloseCommand, Color, Comment, ConnectionPoint, CubicBezierToCommand, DashStop, DataTable, DefinedName, DmlAngle, Drawing, EmuValue, Extent, External, ExternalWorksheet, Fill, FillPatternStyle, FlipAxis, FontStyleIndex, GeomGuideName, GradientColorStop, GradientLinearFill, GradientPathFill, Graphic, GraphicAnchor, GraphicAnchorAbsolute, GraphicAnchorOneCell, GraphicAnchorTwoCell, GraphicBitmap, GraphicChart, GraphicConnectionShape, GraphicGroup, GraphicShape, GridSize, GroupFill, GuidePoint, HAlign, HyperlinkTextRun, InsetRect, Line, LineAlignment, LineCapType, LineCompoundType, LineEnd, LineEndSize, LineEndType, LineJoinType, LineStyle, LineToCommand, MentionTextRun, MoveToCommand, NoFill, Note, Paragraph, Path, PathCommand, PathFillMode, PathFillType, PatternFill, PatternStyle, Percentage, Person, PixelValue, Point, PositiveCoordinate, QuadraticBezierToCommand, RectAlignment, RelativeRect, Shape, ShapeRect, ShapeStyle, SolidFill, Style, Table, TableColumn, TableColumnDataType, TableStyle, TableStyleName, TextAnchoring, TextBody, TextHorzOverflow, TextRun, TextVertOverflow, TextVerticalType, TextWrapping, ThreadedComment, Tile, Underline, VAlign, Workbook, WorkbookView, Worksheet, WorksheetDefaults, WorksheetLayoutScales, WorksheetView, Xfrm, XfrmGroup };
|