ooxml-core 1.22.0 → 1.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/README.md +7 -2
  2. package/dist/automation/index.cjs +559 -339
  3. package/dist/automation/index.d.ts +1 -0
  4. package/dist/automation/index.d.ts.map +1 -1
  5. package/dist/automation/index.mjs +558 -340
  6. package/dist/automation/live.d.ts +89 -0
  7. package/dist/automation/live.d.ts.map +1 -0
  8. package/dist/collab/embedding.d.ts +7 -0
  9. package/dist/collab/embedding.d.ts.map +1 -1
  10. package/dist/collab/index.cjs +189 -0
  11. package/dist/collab/index.d.ts +2 -0
  12. package/dist/collab/index.d.ts.map +1 -1
  13. package/dist/collab/index.mjs +186 -1
  14. package/dist/collab/write-back-lifecycle.d.ts +33 -0
  15. package/dist/collab/write-back-lifecycle.d.ts.map +1 -0
  16. package/dist/collab/write-back.d.ts +75 -0
  17. package/dist/collab/write-back.d.ts.map +1 -0
  18. package/dist/docx/ui/customization.d.ts +30 -0
  19. package/dist/docx/ui/customization.d.ts.map +1 -0
  20. package/dist/docx/ui/index.cjs +51 -0
  21. package/dist/docx/ui/index.d.ts +1 -0
  22. package/dist/docx/ui/index.d.ts.map +1 -1
  23. package/dist/docx/ui/index.mjs +46 -1
  24. package/dist/embedding/backstage.d.ts +48 -0
  25. package/dist/embedding/backstage.d.ts.map +1 -0
  26. package/dist/embedding/capabilities.d.ts +60 -0
  27. package/dist/embedding/capabilities.d.ts.map +1 -0
  28. package/dist/embedding/customization.d.ts +32 -0
  29. package/dist/embedding/customization.d.ts.map +1 -0
  30. package/dist/embedding/index.cjs +229 -0
  31. package/dist/embedding/index.d.ts +7 -0
  32. package/dist/embedding/index.d.ts.map +1 -0
  33. package/dist/embedding/index.mjs +204 -0
  34. package/dist/embedding/menu-commands.d.ts +66 -0
  35. package/dist/embedding/menu-commands.d.ts.map +1 -0
  36. package/dist/embedding/regions.d.ts +58 -0
  37. package/dist/embedding/regions.d.ts.map +1 -0
  38. package/dist/embedding/storage.d.ts +111 -0
  39. package/dist/embedding/storage.d.ts.map +1 -0
  40. package/dist/index.cjs +233 -0
  41. package/dist/index.d.ts +1 -0
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.mjs +233 -1
  44. package/dist/visio/collab/baseline.d.ts +36 -0
  45. package/dist/visio/collab/baseline.d.ts.map +1 -0
  46. package/dist/visio/collab/bind.d.ts +20 -2
  47. package/dist/visio/collab/bind.d.ts.map +1 -1
  48. package/dist/visio/collab/compose-lists.d.ts +27 -0
  49. package/dist/visio/collab/compose-lists.d.ts.map +1 -0
  50. package/dist/visio/collab/compose.d.ts +6 -2
  51. package/dist/visio/collab/compose.d.ts.map +1 -1
  52. package/dist/visio/collab/fixups.d.ts +5 -0
  53. package/dist/visio/collab/fixups.d.ts.map +1 -0
  54. package/dist/visio/collab/index.cjs +1603 -361
  55. package/dist/visio/collab/index.d.ts +3 -2
  56. package/dist/visio/collab/index.d.ts.map +1 -1
  57. package/dist/visio/collab/index.mjs +1596 -362
  58. package/dist/visio/collab/keys.d.ts +32 -1
  59. package/dist/visio/collab/keys.d.ts.map +1 -1
  60. package/dist/visio/collab/package.d.ts +22 -1
  61. package/dist/visio/collab/package.d.ts.map +1 -1
  62. package/dist/visio/collab/pieces.d.ts +41 -0
  63. package/dist/visio/collab/pieces.d.ts.map +1 -0
  64. package/dist/visio/collab/read-ids.d.ts +35 -0
  65. package/dist/visio/collab/read-ids.d.ts.map +1 -0
  66. package/dist/visio/collab/read-parts.d.ts +34 -0
  67. package/dist/visio/collab/read-parts.d.ts.map +1 -0
  68. package/dist/visio/collab/read-shapes.d.ts +34 -0
  69. package/dist/visio/collab/read-shapes.d.ts.map +1 -0
  70. package/dist/visio/collab/read-util.d.ts +20 -0
  71. package/dist/visio/collab/read-util.d.ts.map +1 -0
  72. package/dist/visio/collab/read.d.ts +40 -19
  73. package/dist/visio/collab/read.d.ts.map +1 -1
  74. package/dist/visio/collab/schema.d.ts +55 -1
  75. package/dist/visio/collab/schema.d.ts.map +1 -1
  76. package/dist/visio/collab/snapshot-contents.d.ts +9 -0
  77. package/dist/visio/collab/snapshot-contents.d.ts.map +1 -0
  78. package/dist/visio/collab/snapshot-io.d.ts +26 -0
  79. package/dist/visio/collab/snapshot-io.d.ts.map +1 -0
  80. package/dist/visio/collab/snapshot-parts.d.ts +14 -0
  81. package/dist/visio/collab/snapshot-parts.d.ts.map +1 -0
  82. package/dist/visio/collab/snapshot.d.ts +31 -24
  83. package/dist/visio/collab/snapshot.d.ts.map +1 -1
  84. package/dist/visio/collab/write-parts.d.ts +8 -0
  85. package/dist/visio/collab/write-parts.d.ts.map +1 -0
  86. package/dist/visio/collab/write-shapes.d.ts +30 -0
  87. package/dist/visio/collab/write-shapes.d.ts.map +1 -0
  88. package/dist/visio/collab/write.d.ts +4 -16
  89. package/dist/visio/collab/write.d.ts.map +1 -1
  90. package/dist/visio/collab/zip-store.d.ts +4 -0
  91. package/dist/visio/collab/zip-store.d.ts.map +1 -0
  92. package/dist/visio/document-level.d.ts +57 -0
  93. package/dist/visio/document-level.d.ts.map +1 -0
  94. package/dist/visio/index.cjs +485 -333
  95. package/dist/visio/index.d.ts +2 -0
  96. package/dist/visio/index.d.ts.map +1 -1
  97. package/dist/visio/index.mjs +484 -334
  98. package/dist/visio/layers.d.ts +3 -0
  99. package/dist/visio/layers.d.ts.map +1 -1
  100. package/dist/visio/package.d.ts +9 -0
  101. package/dist/visio/package.d.ts.map +1 -1
  102. package/dist/visio/parse-incremental.d.ts +16 -0
  103. package/dist/visio/parse-incremental.d.ts.map +1 -0
  104. package/dist/visio/parser.d.ts +14 -0
  105. package/dist/visio/parser.d.ts.map +1 -1
  106. package/dist/visio/shape-metadata.d.ts +3 -0
  107. package/dist/visio/shape-metadata.d.ts.map +1 -1
  108. package/dist/visio/ui/collab-options.d.ts +10 -5
  109. package/dist/visio/ui/collab-options.d.ts.map +1 -1
  110. package/dist/visio/ui/contract.d.ts +27 -2
  111. package/dist/visio/ui/contract.d.ts.map +1 -1
  112. package/dist/visio/ui/customization.d.ts +46 -0
  113. package/dist/visio/ui/customization.d.ts.map +1 -0
  114. package/dist/visio/ui/index.cjs +460 -320
  115. package/dist/visio/ui/index.d.ts +1 -0
  116. package/dist/visio/ui/index.d.ts.map +1 -1
  117. package/dist/visio/ui/index.mjs +458 -321
  118. package/dist/xlsx/ui/commands.d.ts +2 -0
  119. package/dist/xlsx/ui/commands.d.ts.map +1 -1
  120. package/dist/xlsx/ui/customization.d.ts +49 -0
  121. package/dist/xlsx/ui/customization.d.ts.map +1 -0
  122. package/dist/xlsx/ui/index.cjs +39 -1
  123. package/dist/xlsx/ui/index.d.ts +1 -0
  124. package/dist/xlsx/ui/index.d.ts.map +1 -1
  125. package/dist/xlsx/ui/index.mjs +37 -2
  126. package/package.json +6 -1
@@ -9,14 +9,45 @@ export declare class DrawingKeys {
9
9
  readonly partPrints: Map<string, string>;
10
10
  /** The part path of each page key in the local package. */
11
11
  readonly pagePaths: Map<string, string>;
12
+ /** The part path of each master key in the local package. */
13
+ readonly masterPaths: Map<string, string>;
14
+ /** The room key of each media path in the local package. */
15
+ readonly mediaKeys: Map<string, string>;
16
+ /** Serialised page parts and decoded shared parts of the last rebuild, to skip unchanged work. */
17
+ readonly cache: {
18
+ pageParts: Map<string, {
19
+ sig: string;
20
+ bytes: Uint8Array;
21
+ }>;
22
+ parts: Map<string, {
23
+ b64: string;
24
+ data: Uint8Array;
25
+ }>;
26
+ /** CRC-32 of the bytes of each stored part, by identity (see zip-store.ts). */
27
+ crcs: WeakMap<Uint8Array<ArrayBufferLike>, number>;
28
+ };
29
+ /**
30
+ * What was last applied to the editor: the drawing signature, the editor version it produced,
31
+ * the signature of everything but page content and the content signature of each page.
32
+ */
33
+ applied: {
34
+ signature: string;
35
+ version: number;
36
+ base: string;
37
+ pages: ReadonlyMap<string, string>;
38
+ } | undefined;
12
39
  constructor(tag: string);
13
40
  mint(): string;
41
+ /** A fresh id for one write batch: entries written together share it. */
42
+ batch(): string;
14
43
  pageKey(id: string): string;
15
44
  shapeKey(pageKey: string, id: string): string;
45
+ masterKey(id: string): string;
16
46
  findPage(id: string): string | undefined;
17
47
  forgetPage(key: string): void;
18
48
  forgetShape(pageKey: string, key: string): void;
49
+ forgetMaster(key: string): void;
19
50
  /** Replaces the id-to-key tables with those of a freshly composed package. */
20
- reset(pages: Map<string, string>, shapes: Map<string, Map<string, string>>): void;
51
+ reset(pages: Map<string, string>, shapes: Map<string, Map<string, string>>, masters?: Map<string, string>): void;
21
52
  }
22
53
  //# sourceMappingURL=keys.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../../visio/collab/keys.ts"],"names":[],"mappings":"AAIA,qBAAa,WAAW;;IAaX,OAAO,CAAC,QAAQ,CAAC,GAAG;IAXhC,gEAAgE;IAChE,OAAO,UAAS;IAGhB,oIAAoI;IACpI,KAAK,sBAA6B;IAClC,iEAAiE;IACjE,QAAQ,CAAC,UAAU,sBAA6B;IAChD,2DAA2D;IAC3D,QAAQ,CAAC,SAAS,sBAA6B;IAE/C,YAA6B,GAAG,EAAE,MAAM,EAAI;IAE5C,IAAI,IAAI,MAAM,CAEb;IACD,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAO1B;IACD,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAS5C;IACD,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEvC;IACD,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAG5B;IACD,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAG9C;IACD,8EAA8E;IAC9E,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC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I,CAG5B;IACD,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAG9C;IACD,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAI9B;IACD,8EAA8E;IAC9E,KAAK,CACJ,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAC1B,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EACxC,OAAO,GAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAa,GACtC,IAAI,CAON;CACD"}
@@ -21,7 +21,26 @@ export declare const CONTENT_TYPES = "[Content_Types].xml";
21
21
  /** The content types part without the page overrides, which depend on each peer's part names. */
22
22
  export declare function stripPageOverrides(xml: string): string;
23
23
  /** Adds an override for each page part, replacing any it already declares. */
24
- export declare function withPageOverrides(xml: string, pagePaths: readonly string[]): string;
24
+ export declare const withPageOverrides: (xml: string, pagePaths: readonly string[]) => string;
25
+ export declare const MASTER_TYPE = "http://schemas.microsoft.com/visio/2010/relationships/master";
26
+ export declare const MASTER_CONTENT_TYPE = "application/vnd.ms-visio.master+xml";
27
+ /** Appends an override of `contentType` for each of `paths`. */
28
+ export declare function withOverrides(xml: string, contentType: string, paths: readonly string[]): string;
29
+ /** Removes the overrides of `types` and of the given part names. */
30
+ export declare function stripOverrides(xml: string, types: readonly string[], parts?: ReadonlySet<string>): string;
31
+ export interface DeclaredType {
32
+ type: string;
33
+ /** True when it comes from a `Default` extension entry rather than an `Override`. */
34
+ byDefault: boolean;
35
+ }
36
+ /** The content type the types part declares for `path`. */
37
+ export declare function declaredType(xml: string, path: string): DeclaredType | undefined;
38
+ /** Declares `declared` for `path` unless the types part already covers it. */
39
+ export declare function ensureType(xml: string, path: string, declared: DeclaredType): string;
40
+ /** True for a package part directly inside a `media` folder. */
41
+ export declare const isMediaPart: (path: string) => boolean;
42
+ /** Relative target from the directory `dir` to the part `path`. */
43
+ export declare function relativeTarget(dir: string, path: string): string;
25
44
  export declare function toBase64(bytes: Uint8Array): string;
26
45
  export declare function fromBase64(text: string): Uint8Array;
27
46
  /** Length plus an FNV-1a hash: enough to skip re-encoding an unchanged part. */
@@ -34,4 +53,6 @@ export declare const decoder: TextDecoder;
34
53
  * does not mistake the rewrite for an edit. Falls back to the text when it does not parse alone.
35
54
  */
36
55
  export declare function canon(xml: string): string;
56
+ /** SHA-256 of `bytes` as lower-case hex: the identity of a media part. */
57
+ export declare function contentHash(bytes: Uint8Array): string;
37
58
  //# sourceMappingURL=package.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"package.d.ts","sourceRoot":"","sources":["../../../visio/collab/package.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,YAAY;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,OAAO,SAAU,MAAM,KAAG,MAGtC,CAAC;AACF,eAAO,MAAM,QAAQ,SAAU,MAAM,KAAG,MAA+C,CAAC;AACxF,eAAO,MAAM,UAAU,SAAU,MAAM,KAAG,MAGzC,CAAC;AAEF,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAQjE;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,YAAY,EAAE,CAY1E;AAED,eAAO,MAAM,SAAS,+DAA+D,CAAC;AACtF,eAAO,MAAM,iBAAiB,sCAAsC,CAAC;AACrE,eAAO,MAAM,MAAM,wEAAwE,CAAC;AAE5F,kEAAkE;AAClE,eAAO,MAAM,eAAe,SAAU,MAAM,KAAG,OAC2B,CAAC;AAE3E,eAAO,MAAM,aAAa,wBAAwB,CAAC;AAEnD,iG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B,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAKlD;AACD,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAKnD;AAED,gFAAgF;AAChF,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAIrD;AAED,eAAO,MAAM,OAAO,aAAoB,CAAC;AACzC,eAAO,MAAM,OAAO,aAAoB,CAAC;AAGzC;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAYzC;AAED,0EAA0E;AAC1E,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAIrD"}
@@ -0,0 +1,41 @@
1
+ import { type ElementSpan } from './scan.js';
2
+ export interface Piece {
3
+ path: string;
4
+ /** Path of the container holding it: '' for the shape itself. */
5
+ parent: string;
6
+ /** A container (section, row) keeps its opening tag; a leaf its whole element. */
7
+ kind: 'open' | 'leaf';
8
+ text: string;
9
+ /** See {@link PieceEntry.r}; set by the snapshot, which knows the page's ids and keys. */
10
+ refs?: string[];
11
+ }
12
+ export interface SplitShape {
13
+ /** The opening tag, never self-closing. */
14
+ open: string;
15
+ pieces: Piece[];
16
+ /** The nested `Shape` elements, in order. */
17
+ nested: string[];
18
+ }
19
+ /** An opening tag as text, made non-self-closing. */
20
+ export declare const openTagOf: (text: string, span: ElementSpan) => string;
21
+ export declare const closeTagOf: (open: string) => string;
22
+ /** Splits the element `xml` (a `Shape`) into its opening tag, pieces and nested shapes. */
23
+ export declare function splitShape(xml: string): SplitShape | undefined;
24
+ export interface PieceEntry {
25
+ pos: number;
26
+ /** Whole element of a leaf. */
27
+ xml?: string;
28
+ /** Opening tag of a container. */
29
+ open?: string;
30
+ /**
31
+ * For a cell whose formula names shapes (`Sheet.<id>`): pairs of referenced id and the key of the
32
+ * shape that id meant to the author, flattened (`[id, key, id, key]`). Not part of the content.
33
+ */
34
+ r?: string[];
35
+ }
36
+ /** Builds the element: `open`, the pieces under `parent` in position order, then `tail`. */
37
+ export declare function buildShape(open: string, entries: ReadonlyMap<string, PieceEntry>, tail: string): string;
38
+ /** The container path of a piece: its path without the last `<kind>/<name>` pair. */
39
+ export declare function parentOf(path: string): string;
40
+ export declare function pieceContent(kind: 'open' | 'leaf', text: string): string;
41
+ //# sourceMappingURL=pieces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pieces.d.ts","sourceRoot":"","sources":["../../../visio/collab/pieces.ts"],"names":[],"mappings":"AAaA,OAAO,EAAyB,KAAK,WAAW,EAAE,MAAM,QAAQ,CAAC;AAEjE,MAAM,WAAW,KAAK;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAC;IACf,kFAAkF;IAClF,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,0FAA0F;IAC1F,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,MAAM,WAAW,UAAU;IAC1B,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,6CAA6C;IAC7C,MAAM,EAAE,MAAM,EAAE,CAAC;CACjB;AAKD,qDAAqD;AACrD,eAAO,MAAM,SAAS,SAAU,MAAM,QAAQ,WAAW,KAAG,MAG3D,CAAC;AACF,eAAO,MAAM,UAAU,SAAU,MAAM,KAAG,MAA+B,CAAC;AAE1E,2FAA2F;AAC3F,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAqE9D;AAED,MAAM,WAAW,UAAU;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,+BAA+B;IAC/B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC;CACb;AAED,4FAA4F;AAC5F,wBAAgB,UAAU,CACzB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,EACxC,IAAI,EAAE,MAAM,GACV,MAAM,CAkBR;AAED,qFAAqF;AACrF,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG7C;AAMD,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAOxE"}
@@ -0,0 +1,35 @@
1
+ import type { RenumEntry, SharedDrawing } from './schema.js';
2
+ export interface IdItem {
3
+ key: string;
4
+ /** The id the author gave the item. */
5
+ id: string;
6
+ /** The persisted id, when a renumbering was persisted for exactly this author id. */
7
+ fixed?: string | undefined;
8
+ }
9
+ export interface Renumbered {
10
+ from: string;
11
+ to: string;
12
+ }
13
+ export declare const compare: (a: string, b: string) => number;
14
+ export declare const numeric: (id: string) => number;
15
+ export declare function assignIds(items: readonly IdItem[]): {
16
+ ids: Map<string, string>;
17
+ fresh: Map<string, Renumbered>;
18
+ /** Items that keep an id another item had to leave and that is not persisted yet. */
19
+ claims: Set<string>;
20
+ };
21
+ /** The persisted renumbering of `key`, when it applies to an item the author numbered `id`. */
22
+ export declare const fixedId: (renum: ReadonlyMap<string, RenumEntry>, key: string, id: string) => string | undefined;
23
+ /** Every renumbering record in the room by key. */
24
+ export declare function readRenum(shared: SharedDrawing): Map<string, RenumEntry>;
25
+ /** The renumbering record of `key` with the change or claim of this read applied. */
26
+ export declare function renumRecord(renum: ReadonlyMap<string, RenumEntry>, recordKey: string, item: {
27
+ id: string;
28
+ }, change: Renumbered | undefined, claimed: boolean): RenumEntry | undefined;
29
+ /** A write a peer that can write makes to persist what every peer computes on read. */
30
+ export interface Fixup {
31
+ map: 'renum';
32
+ key: string;
33
+ value: unknown;
34
+ }
35
+ //# sourceMappingURL=read-ids.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3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EAAE,OAAO,GACd,UAAU,GAAG,SAAS,CAIxB;AAED,uFAAuF;AACvF,MAAM,WAAW,KAAK;IACrB,GAAG,EAAE,OAAO,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,OAAO,CAAC;CACf"}
@@ -0,0 +1,34 @@
1
+ import { type DeclaredType } from './package.js';
2
+ import { type Fixup } from './read-ids.js';
3
+ import { type RenumEntry, type SharedDrawing } from './schema.js';
4
+ export interface MasterBase {
5
+ key: string;
6
+ /** Final id. */
7
+ id: string;
8
+ /** The `Master` element with `Rel` as a marker and `ID` final. */
9
+ xml: string;
10
+ /** Base64 of the master part with its shapes and connects replaced by markers. */
11
+ part: string;
12
+ rels?: string;
13
+ }
14
+ export interface ResolvedMedia {
15
+ /** Key of its entry in the room. */
16
+ key: string;
17
+ path: string;
18
+ hash: string;
19
+ declared: DeclaredType;
20
+ /** Base64 of the bytes. */
21
+ data: string;
22
+ }
23
+ export declare function resolveMasters(shared: SharedDrawing, renum: ReadonlyMap<string, RenumEntry>): {
24
+ masters: MasterBase[];
25
+ remap: Map<string, Map<string, string>>;
26
+ fixups: Fixup[];
27
+ };
28
+ export declare function resolveMedia(shared: SharedDrawing): {
29
+ media: ResolvedMedia[];
30
+ renames: Map<string, Map<string, string>>;
31
+ };
32
+ /** Rewrites relationship targets that resolve to a renamed part. */
33
+ export declare function renameTargets(rels: string, baseDir: string, renames: ReadonlyMap<string, string>): string;
34
+ //# sourceMappingURL=read-parts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-parts.d.ts","sourceRoot":"","sources":["../../../visio/collab/read-parts.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,YAAY,EAAiC,MAAM,WAAW,CAAC;AAE7E,OAAO,EAAE,KAAK,KAAK,EAAmC,MAAM,YAAY,CAAC;AAGzE,OAAO,EAEN,KAAK,UAAU,EACf,KAAK,aAAa,EAIlB,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,UAAU;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,kEAAkE;IAClE,GAAG,EAAE,MAAM,CAAC;IACZ,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACd;AACD,MAAM,WAAW,aAAa;IAC7B,oCAAoC;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,YAAY,CAAC;IACvB,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;CACb;AAID,wBAAgB,cAAc,CAC7B,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,GACpC;IAAE,OAAO,EAAE,UAAU,EAAE,CAAC;IAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAAC,MAAM,EAAE,KAAK,EAAE,CAAA;CAAE,CA2CrF;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG;IACpD,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAC1C,CAsCA;AAED,oEAAoE;AACpE,wBAAgB,aAAa,CAC5B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAClC,MAAM,CAYR"}
@@ -0,0 +1,34 @@
1
+ import { type PieceEntry } from './pieces.js';
2
+ import { type Fixup } from './read-ids.js';
3
+ import { type RenumEntry, type ShapeEntry } from './schema.js';
4
+ export interface ResolvedShape {
5
+ key: string;
6
+ /** Final id, after renumbering. */
7
+ id: string;
8
+ parent?: string;
9
+ open: string;
10
+ entries: Map<string, PieceEntry>;
11
+ }
12
+ export declare function setAttr(open: string, name: string, value: string): string;
13
+ /** Rewrites `Sheet.<n>` for the ids in `remap` inside the F attributes of one cell element. */
14
+ export declare function renumberFormulas(xml: string, remap: ReadonlyMap<string, string>): string;
15
+ export declare function renumberShape(xml: string, remap: ReadonlyMap<string, string>): string;
16
+ export interface ShapeInput {
17
+ /** The page key, or the master scope, the shapes belong to (the prefix of their room keys). */
18
+ scope: string;
19
+ /** `shapeKey` -> entry, for one page. */
20
+ shapes: Map<string, ShapeEntry>;
21
+ /** `shapeKey` -> `path` -> entry. */
22
+ cells: Map<string, Map<string, PieceEntry>>;
23
+ /** Persisted renumberings by shape key. */
24
+ renum: ReadonlyMap<string, RenumEntry>;
25
+ /** Masters renumbered in a batch: batch -> old id -> new id. */
26
+ masterRemap: ReadonlyMap<string, ReadonlyMap<string, string>>;
27
+ }
28
+ /** The shapes of a page in document order (parents first), the XML of the top-level list and the fix-ups. */
29
+ export declare function resolveShapes(input: ShapeInput): {
30
+ shapes: ResolvedShape[];
31
+ xml: string;
32
+ fixups: Fixup[];
33
+ };
34
+ //# sourceMappingURL=read-shapes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-shapes.d.ts","sourceRoot":"","sources":["../../../visio/collab/read-shapes.ts"],"names":[],"mappings":"AAaA,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,KAAK,KAAK,EAA4C,MAAM,YAAY,CAAC;AAElF,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAE5D,MAAM,WAAW,aAAa;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,mCAAmC;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CACjC;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAKzE;AAED,+FAA+F;AAC/F,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CASxF;AAgBD,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAarF;AAED,MAAM,WAAW,UAAU;IAC1B,+FAA+F;IAC/F,KAAK,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAChC,qCAAqC;IACrC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;IAC5C,2CAA2C;IAC3C,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACvC,gEAAgE;IAChE,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAC9D;AAED,6GAA6G;AAC7G,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG;IACjD,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,KAAK,EAAE,CAAC;CAChB,CAqFA"}
@@ -0,0 +1,20 @@
1
+ import type { ResolvedShape } from './read-shapes.js';
2
+ import type { ConnectEntry } from './schema.js';
3
+ export interface ResolvedConnect {
4
+ key: string;
5
+ entry: ConnectEntry;
6
+ /** Final ids the connect refers to. */
7
+ from: string;
8
+ to: string;
9
+ }
10
+ /** A 64-bit FNV-style hash of the strings, as hex: a change detector, not a security measure. */
11
+ export declare function hashTexts(texts: Iterable<string>): string;
12
+ /** Splits `key` at its first `depth` slashes; the last part keeps any further slashes. */
13
+ export declare const split: (key: string, depth: number) => string[] | undefined;
14
+ export declare const connectSignature: (connects: readonly ResolvedConnect[]) => string[];
15
+ /** The connects of one page or master whose ends are alive, with their final shape ids. */
16
+ export declare function resolveConnects(list: {
17
+ key: string;
18
+ entry: ConnectEntry;
19
+ }[] | undefined, shapes: readonly ResolvedShape[]): ResolvedConnect[];
20
+ //# sourceMappingURL=read-util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-util.d.ts","sourceRoot":"","sources":["../../../visio/collab/read-util.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,MAAM,WAAW,eAAe;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,YAAY,CAAC;IACpB,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACX;AACD,iGAAiG;AACjG,wBAAgB,SAAS,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,CAazD;AAED,0FAA0F;AAC1F,eAAO,MAAM,KAAK,QAAS,MAAM,SAAS,MAAM,KAAG,MAAM,EAAE,GAAG,SAW7D,CAAC;AAEF,eAAO,MAAM,gBAAgB,aAAc,SAAS,eAAe,EAAE,KAAG,MAAM,EACU,CAAC;AAEzF,2FAA2F;AAC3F,wBAAgB,eAAe,CAC9B,IAAI,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,YAAY,CAAA;CAAE,EAAE,GAAG,SAAS,EACxD,MAAM,EAAE,SAAS,aAAa,EAAE,GAC9B,eAAe,EAAE,CAWnB"}
@@ -1,20 +1,17 @@
1
- import { type BodyEntry, type ConnectEntry, type SharedDrawing } from './schema.js';
2
- export interface ResolvedShape {
3
- key: string;
4
- /** Id of the outermost shape, after renumbering. */
5
- id: string;
6
- xml: string;
7
- /** Original id -> final id, only for renumbered shapes. */
8
- remap: Map<string, string>;
9
- /** Final ids of this shape and everything nested in it. */
10
- ids: string[];
11
- }
12
- export interface ResolvedConnect {
13
- key: string;
14
- entry: ConnectEntry;
15
- /** Final ids the connect refers to. */
16
- from: string;
17
- to: string;
1
+ import { type Fixup } from './read-ids.js';
2
+ import { type ResolvedConnect } from './read-util.js';
3
+ import { type MasterBase, type ResolvedMedia } from './read-parts.js';
4
+ import { type ResolvedShape } from './read-shapes.js';
5
+ import { type BodyEntry, type SharedDrawing } from './schema.js';
6
+ export { renumberShape } from './read-shapes.js';
7
+ export type { ResolvedMedia, ResolvedShape };
8
+ export type { Fixup, ResolvedConnect };
9
+ export interface ResolvedMaster extends MasterBase {
10
+ /** The shapes inside the master's content, parents before the shapes nested in them. */
11
+ shapes: ResolvedShape[];
12
+ /** The XML of the top-level shape list. */
13
+ shapesXml: string;
14
+ connects: ResolvedConnect[];
18
15
  }
19
16
  export interface ResolvedPage {
20
17
  key: string;
@@ -24,18 +21,42 @@ export interface ResolvedPage {
24
21
  /** The `Page` element with `Rel` as a marker and `ID`/`BackPage` final. */
25
22
  xml: string;
26
23
  body: BodyEntry;
24
+ /** Every shape of the page, parents before the shapes nested in them. */
27
25
  shapes: ResolvedShape[];
26
+ /** The XML of the top-level shape list. */
27
+ shapesXml: string;
28
28
  connects: ResolvedConnect[];
29
+ /** Changes whenever the page part would. */
30
+ signature: string;
31
+ /** Changes whenever the page's shapes, connects or part shell do (not its entry in the page list). */
32
+ contentSignature: string;
29
33
  }
30
34
  export interface ResolvedDrawing {
31
35
  pagesPath: string;
32
36
  pagesOpen: string;
33
37
  pagesClose: string;
34
38
  pages: ResolvedPage[];
39
+ mastersPath?: string;
40
+ mastersOpen?: string;
41
+ mastersClose?: string;
42
+ masters: ResolvedMaster[];
43
+ media: ResolvedMedia[];
35
44
  /** Shared parts as base64, by path. */
36
45
  parts: Map<string, string>;
46
+ /** Changes whenever the rebuilt package would. */
47
+ signature: string;
48
+ /**
49
+ * Changes whenever anything but the content of the pages does: the page list (keys, ids, order,
50
+ * entries), masters, media and the shared parts. While it stays the same, only the pages whose
51
+ * `contentSignature` changed differ.
52
+ */
53
+ baseSignature: string;
54
+ /** Writes that persist the renumberings above, see fixups.ts. Empty once ids are stable. */
55
+ fixups: Fixup[];
37
56
  }
38
- /** Rewrites the ids in `remap` on `Shape` tags and in `Sheet.<n>` references of one shape. */
39
- export declare function renumberShape(xml: string, remap: ReadonlyMap<string, string>): string;
57
+ /**
58
+ * The drawing the room holds, or undefined while it is empty. Throws a SchemaVersionError when
59
+ * the room was written with another schema version.
60
+ */
40
61
  export declare function readSharedDrawing(shared: SharedDrawing): ResolvedDrawing | undefined;
41
62
  //# sourceMappingURL=read.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../../visio/collab/read.ts"],"names":[],"mappings":"AAUA,OAAO,EACN,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,aAAa,EAOlB,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,aAAa;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,oDAAoD;IACpD,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,2DAA2D;IAC3D,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3B,2DAA2D;IAC3D,GAAG,EAAE,MAAM,EAAE,CAAC;CACd;AACD,MAAM,WAAW,eAAe;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,YAAY,CAAC;IACpB,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACX;AACD,MAAM,WAAW,YAAY;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;I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@
1
1
  import * as Y from 'yjs';
2
- export declare const SCHEMA_VERSION = 1;
2
+ import type { PieceEntry } from './pieces.js';
3
+ export declare const SCHEMA_VERSION = 4;
4
+ /** The room was written by a peer with another schema version. */
5
+ export declare class SchemaVersionError extends Error {
6
+ readonly found: unknown;
7
+ constructor(found: unknown);
8
+ }
3
9
  export declare const META = "visio:meta";
4
10
  export declare const PAGES = "visio:pages";
5
11
  export declare const BODIES = "visio:bodies";
6
12
  export declare const SHAPES = "visio:shapes";
13
+ export declare const CELLS = "visio:cells";
7
14
  export declare const CONNECTS = "visio:connects";
8
15
  export declare const DEAD = "visio:dead";
16
+ export declare const MASTERS = "visio:masters";
17
+ export declare const RENUM = "visio:renum";
18
+ export declare const MEDIA = "visio:media";
19
+ export declare const BLOBS = "visio:blobs";
9
20
  export declare const PARTS = "visio:parts";
10
21
  export interface PageEntry {
11
22
  pos: number;
@@ -21,10 +32,42 @@ export interface BodyEntry {
21
32
  shell: string;
22
33
  /** The page part's relationships part, verbatim. */
23
34
  rels?: string;
35
+ b?: string;
24
36
  }
25
37
  export interface ShapeEntry {
26
38
  pos: number;
39
+ /** Key of the shape this one is nested in. */
40
+ parent?: string;
41
+ /** The opening tag of the `Shape` element (its attributes), never self-closing. */
42
+ open: string;
43
+ b?: string;
44
+ }
45
+ export type CellEntry = PieceEntry;
46
+ export interface MasterEntry {
47
+ pos: number;
48
+ /** The master id (`Master/@ID`) the author gave it; renumbered on read if two collide. */
49
+ id: string;
50
+ /** The `Master` element with its `Rel` child replaced by {@link REL_MARK}. */
27
51
  xml: string;
52
+ /** The master part, base64. */
53
+ part: string;
54
+ /** The master part's relationships part, verbatim. */
55
+ rels?: string;
56
+ b?: string;
57
+ }
58
+ /** A persisted renumbering: the id (`i`) or `Master` reference (`m`) moves from the first to the second. */
59
+ export interface RenumEntry {
60
+ i?: [string, string];
61
+ m?: [string, string];
62
+ }
63
+ export interface MediaEntry {
64
+ path: string;
65
+ hash: string;
66
+ /** Content type declared for the part. */
67
+ ct: string;
68
+ /** Whether that declaration was an extension default rather than an override. */
69
+ d: boolean;
70
+ b?: string;
28
71
  }
29
72
  export interface ConnectEntry {
30
73
  /** Keys of the connecting and connected shapes ('' keeps the literal id). */
@@ -45,8 +88,13 @@ export interface SharedDrawing {
45
88
  pages: Y.Map<unknown>;
46
89
  bodies: Y.Map<unknown>;
47
90
  shapes: Y.Map<unknown>;
91
+ cells: Y.Map<unknown>;
48
92
  connects: Y.Map<unknown>;
49
93
  dead: Y.Map<unknown>;
94
+ masters: Y.Map<unknown>;
95
+ renum: Y.Map<unknown>;
96
+ media: Y.Map<unknown>;
97
+ blobs: Y.Map<unknown>;
50
98
  parts: Y.Map<unknown>;
51
99
  }
52
100
  /** The drawing's top-level maps in `doc`. */
@@ -55,6 +103,8 @@ export declare function sharedDrawing(doc: Y.Doc): SharedDrawing;
55
103
  export declare const sharedTypes: (shared: SharedDrawing) => Y.Map<unknown>[];
56
104
  /** True when no peer has written a drawing to the room yet. */
57
105
  export declare const isSharedDrawingEmpty: (shared: SharedDrawing) => boolean;
106
+ /** Throws a {@link SchemaVersionError} when the room holds another schema version. */
107
+ export declare function assertSchemaVersion(shared: SharedDrawing): void;
58
108
  export declare const isRecord: (value: unknown) => value is Record<string, unknown>;
59
109
  /** Whether two flat records hold the same fields. */
60
110
  export declare function sameRecord(a: unknown, b: unknown): boolean;
@@ -66,5 +116,9 @@ export declare const num: (value: unknown) => number | undefined;
66
116
  export declare function pageEntry(value: unknown): PageEntry | undefined;
67
117
  export declare function bodyEntry(value: unknown): BodyEntry | undefined;
68
118
  export declare function shapeEntry(value: unknown): ShapeEntry | undefined;
119
+ export declare function cellEntry(value: unknown): CellEntry | undefined;
120
+ export declare function masterEntry(value: unknown): MasterEntry | undefined;
121
+ export declare function mediaEntry(value: unknown): MediaEntry | undefined;
69
122
  export declare function connectEntry(value: unknown): ConnectEntry | undefined;
123
+ export declare function renumEntry(value: unknown): RenumEntry | undefined;
70
124
  //# sourceMappingURL=schema.d.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AG,SAAS,CASjE"}
@@ -0,0 +1,9 @@
1
+ import type { DrawingKeys } from './keys.js';
2
+ import type { ConnectSnapshot, ShapeSnapshot } from './snapshot.js';
3
+ /** The shell, shapes and connects of one content part, with keys minted for `scope`. */
4
+ export declare function splitContents(content: string, scope: string, keys: DrawingKeys): {
5
+ shell: string;
6
+ shapes: ShapeSnapshot[];
7
+ connects: ConnectSnapshot[];
8
+ };
9
+ //# sourceMappingURL=snapshot-contents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot-contents.d.ts","sourceRoot":"","sources":["../../../visio/collab/snapshot-contents.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAI1C,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAyDjE,wFAAwF;AACxF,wBAAgB,aAAa,CAC5B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,WAAW,GACf;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,aAAa,EAAE,CAAC;IAAC,QAAQ,EAAE,eAAe,EAAE,CAAA;CAAE,CA+BzE"}
@@ -0,0 +1,26 @@
1
+ import JSZip from 'jszip';
2
+ export declare const readZip: (bytes: Uint8Array) => Promise<JSZip>;
3
+ export declare const zipText: (zip: JSZip, path: string) => Promise<string | undefined>;
4
+ export interface Layout {
5
+ documentPath: string;
6
+ pagesPath: string;
7
+ mastersPath?: string;
8
+ }
9
+ /** The document, pages and masters parts of a package, through its relationships. */
10
+ export declare function readLayout(zip: JSZip): Promise<Layout | undefined>;
11
+ export interface LocalItem {
12
+ id: string;
13
+ text: string;
14
+ path: string;
15
+ rel: {
16
+ start: number;
17
+ end: number;
18
+ };
19
+ }
20
+ /** The `child` elements of the `container` of a list part (`Pages`, `Masters`) with their parts. */
21
+ export declare function readLocalItems(zip: JSZip, listPath: string, xml: string, container: string, child: string): Promise<{
22
+ box: import("./scan.js").Container;
23
+ items: LocalItem[];
24
+ } | undefined>;
25
+ export declare const withMark: (item: LocalItem) => string;
26
+ //# sourceMappingURL=snapshot-io.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot-io.d.ts","sourceRoot":"","sources":["../../../visio/collab/snapshot-io.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,eAAO,MAAM,OAAO,UAAW,UAAU,KAAG,OAAO,CAAC,KAAK,CAA2B,CAAC;AACrF,eAAO,MAAM,OAAO,QAAe,KAAK,QAAQ,MAAM,KAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CACnD,CAAC;AAEjC,MAAM,WAAW,MAAM;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,qFAAqF;AACrF,wBAAsB,UAAU,CAAC,GAAG,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAiBxE;AAED,MAAM,WAAW,SAAS;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;CACpC;AAED,oGAAoG;AACpG,wBAAsB,cAAc,CACnC,GAAG,EAAE,KAAK,EACV,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM;;;eA2Bb;AAED,eAAO,MAAM,QAAQ,SAAU,SAAS,KAAG,MACmC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type JSZip from 'jszip';
2
+ import type { DrawingKeys } from './keys.js';
3
+ import type { Layout } from './snapshot-io.js';
4
+ import type { MasterSnapshot, MediaSnapshot } from './snapshot.js';
5
+ export declare function snapshotMasters(zip: JSZip, layout: Layout, keys: DrawingKeys, derived: Set<string>): Promise<{
6
+ masters: MasterSnapshot[];
7
+ mastersOpen: string | undefined;
8
+ mastersClose: string | undefined;
9
+ }>;
10
+ export declare function snapshotRest(zip: JSZip, derived: ReadonlySet<string>, limit: number): Promise<{
11
+ parts: Map<string, Uint8Array<ArrayBufferLike>>;
12
+ media: MediaSnapshot[];
13
+ }>;
14
+ //# sourceMappingURL=snapshot-parts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot-parts.d.ts","sourceRoot":"","sources":["../../../visio/collab/snapshot-parts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAe1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhE,wBAAsB,eAAe,CACpC,GAAG,EAAE,KAAK,EACV,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC;;;;GAmCpB;AAED,wBAAsB,YAAY,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM;;;GAiCzF"}