ooxml-core 0.2.0 → 0.3.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 (115) hide show
  1. package/LICENSE +202 -202
  2. package/NOTICE +3 -3
  3. package/dist/pptx/cli/index.cjs +0 -0
  4. package/dist/pptx/cli/index.mjs +0 -0
  5. package/dist/visio/complex-geometry.d.ts +4 -0
  6. package/dist/visio/complex-geometry.d.ts.map +1 -0
  7. package/dist/visio/convert-metafile.d.ts +28 -0
  8. package/dist/visio/convert-metafile.d.ts.map +1 -0
  9. package/dist/visio/diagnostics.d.ts +8 -0
  10. package/dist/visio/diagnostics.d.ts.map +1 -0
  11. package/dist/visio/edit-package.d.ts +10 -0
  12. package/dist/visio/edit-package.d.ts.map +1 -0
  13. package/dist/visio/edit-text.d.ts +7 -0
  14. package/dist/visio/edit-text.d.ts.map +1 -0
  15. package/dist/visio/edit.d.ts +26 -0
  16. package/dist/visio/edit.d.ts.map +1 -0
  17. package/dist/visio/emf-admission-comment.d.ts +7 -0
  18. package/dist/visio/emf-admission-comment.d.ts.map +1 -0
  19. package/dist/visio/emf-admission-context.d.ts +59 -0
  20. package/dist/visio/emf-admission-context.d.ts.map +1 -0
  21. package/dist/visio/emf-admission-geometry.d.ts +3 -0
  22. package/dist/visio/emf-admission-geometry.d.ts.map +1 -0
  23. package/dist/visio/emf-admission-input.d.ts +8 -0
  24. package/dist/visio/emf-admission-input.d.ts.map +1 -0
  25. package/dist/visio/emf-admission-records.d.ts +6 -0
  26. package/dist/visio/emf-admission-records.d.ts.map +1 -0
  27. package/dist/visio/emf-admission-types.d.ts +80 -0
  28. package/dist/visio/emf-admission-types.d.ts.map +1 -0
  29. package/dist/visio/emf-admission.d.ts +9 -0
  30. package/dist/visio/emf-admission.d.ts.map +1 -0
  31. package/dist/visio/foreign-vector-graph.d.ts +4 -0
  32. package/dist/visio/foreign-vector-graph.d.ts.map +1 -0
  33. package/dist/visio/foreign-vector-path.d.ts +12 -0
  34. package/dist/visio/foreign-vector-path.d.ts.map +1 -0
  35. package/dist/visio/foreign-vector-types.d.ts +81 -0
  36. package/dist/visio/foreign-vector-types.d.ts.map +1 -0
  37. package/dist/visio/foreign-vector-validation.d.ts +4 -0
  38. package/dist/visio/foreign-vector-validation.d.ts.map +1 -0
  39. package/dist/visio/foreign-vector-values.d.ts +14 -0
  40. package/dist/visio/foreign-vector-values.d.ts.map +1 -0
  41. package/dist/visio/foreign-vector.d.ts +13 -0
  42. package/dist/visio/foreign-vector.d.ts.map +1 -0
  43. package/dist/visio/geometry.d.ts +8 -0
  44. package/dist/visio/geometry.d.ts.map +1 -0
  45. package/dist/visio/index.cjs +5462 -0
  46. package/dist/visio/index.d.ts +12 -0
  47. package/dist/visio/index.d.ts.map +1 -0
  48. package/dist/visio/index.mjs +5441 -0
  49. package/dist/visio/layers.d.ts +19 -0
  50. package/dist/visio/layers.d.ts.map +1 -0
  51. package/dist/visio/line-pattern.d.ts +5 -0
  52. package/dist/visio/line-pattern.d.ts.map +1 -0
  53. package/dist/visio/line-style.d.ts +12 -0
  54. package/dist/visio/line-style.d.ts.map +1 -0
  55. package/dist/visio/media.d.ts +36 -0
  56. package/dist/visio/media.d.ts.map +1 -0
  57. package/dist/visio/metadata.d.ts +4 -0
  58. package/dist/visio/metadata.d.ts.map +1 -0
  59. package/dist/visio/model.d.ts +203 -0
  60. package/dist/visio/model.d.ts.map +1 -0
  61. package/dist/visio/nurbs-flatten.d.ts +5 -0
  62. package/dist/visio/nurbs-flatten.d.ts.map +1 -0
  63. package/dist/visio/nurbs.d.ts +11 -0
  64. package/dist/visio/nurbs.d.ts.map +1 -0
  65. package/dist/visio/package-common.d.ts +39 -0
  66. package/dist/visio/package-common.d.ts.map +1 -0
  67. package/dist/visio/package.d.ts +30 -0
  68. package/dist/visio/package.d.ts.map +1 -0
  69. package/dist/visio/paragraphs.d.ts +10 -0
  70. package/dist/visio/paragraphs.d.ts.map +1 -0
  71. package/dist/visio/parser.d.ts +26 -0
  72. package/dist/visio/parser.d.ts.map +1 -0
  73. package/dist/visio/parts.d.ts +9 -0
  74. package/dist/visio/parts.d.ts.map +1 -0
  75. package/dist/visio/prepare-images.d.ts +7 -0
  76. package/dist/visio/prepare-images.d.ts.map +1 -0
  77. package/dist/visio/prepare-metafiles.d.ts +17 -0
  78. package/dist/visio/prepare-metafiles.d.ts.map +1 -0
  79. package/dist/visio/rounded-geometry.d.ts +8 -0
  80. package/dist/visio/rounded-geometry.d.ts.map +1 -0
  81. package/dist/visio/saved-fill-gradient.d.ts +13 -0
  82. package/dist/visio/saved-fill-gradient.d.ts.map +1 -0
  83. package/dist/visio/shape-metadata.d.ts +65 -0
  84. package/dist/visio/shape-metadata.d.ts.map +1 -0
  85. package/dist/visio/shapes.d.ts +24 -0
  86. package/dist/visio/shapes.d.ts.map +1 -0
  87. package/dist/visio/sheet.d.ts +57 -0
  88. package/dist/visio/sheet.d.ts.map +1 -0
  89. package/dist/visio/spline-geometry.d.ts +8 -0
  90. package/dist/visio/spline-geometry.d.ts.map +1 -0
  91. package/dist/visio/style-inheritance.d.ts +13 -0
  92. package/dist/visio/style-inheritance.d.ts.map +1 -0
  93. package/dist/visio/style.d.ts +11 -0
  94. package/dist/visio/style.d.ts.map +1 -0
  95. package/dist/visio/text-background.d.ts +10 -0
  96. package/dist/visio/text-background.d.ts.map +1 -0
  97. package/dist/visio/theme-color.d.ts +15 -0
  98. package/dist/visio/theme-color.d.ts.map +1 -0
  99. package/dist/visio/theme-gradient.d.ts +15 -0
  100. package/dist/visio/theme-gradient.d.ts.map +1 -0
  101. package/dist/visio/theme-line.d.ts +15 -0
  102. package/dist/visio/theme-line.d.ts.map +1 -0
  103. package/dist/visio/theme-resolve.d.ts +29 -0
  104. package/dist/visio/theme-resolve.d.ts.map +1 -0
  105. package/dist/visio/theme-root.d.ts +16 -0
  106. package/dist/visio/theme-root.d.ts.map +1 -0
  107. package/dist/visio/theme.d.ts +27 -0
  108. package/dist/visio/theme.d.ts.map +1 -0
  109. package/dist/visio/visibility.d.ts +42 -0
  110. package/dist/visio/visibility.d.ts.map +1 -0
  111. package/dist/visio/xml-validation.d.ts +5 -0
  112. package/dist/visio/xml-validation.d.ts.map +1 -0
  113. package/dist/visio/zip-validation.d.ts +4 -0
  114. package/dist/visio/zip-validation.d.ts.map +1 -0
  115. package/package.json +10 -4
@@ -0,0 +1,8 @@
1
+ import { type VisioEmfAdmissionOptions } from './emf-admission-types.js';
2
+ export declare function emfInputView(input: unknown): DataView<ArrayBuffer> | null;
3
+ /** Read only known own data properties, before inspecting the source byte buffer.
4
+ * Accessors/inherited configuration are rejected. Proxy traps can run as part of descriptor
5
+ * lookup, but their exceptions cannot escape and they cannot detach an already-inspected view.
6
+ */
7
+ export declare function emfInputOptions(options: unknown): VisioEmfAdmissionOptions | null;
8
+ //# sourceMappingURL=emf-admission-input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emf-admission-input.d.ts","sourceRoot":"","sources":["../../src/visio/emf-admission-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,wBAAwB,EAC7B,MAAM,0BAA0B,CAAC;AAWlC,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC,WAAW,CAAC,GAAG,IAAI,CAazE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,wBAAwB,GAAG,IAAI,CAqBjF"}
@@ -0,0 +1,6 @@
1
+ import { type EmfAdmissionContext as Context } from './emf-admission-context.js';
2
+ export declare const EMF_FIXED_SIZES: Map<number, number>;
3
+ export declare function inspectEmfStateRecord(c: Context): boolean;
4
+ export declare function inspectEmfColor(c: Context, color: number): void;
5
+ export declare function inspectEmfObjectRecord(c: Context): boolean;
6
+ //# sourceMappingURL=emf-admission-records.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emf-admission-records.d.ts","sourceRoot":"","sources":["../../src/visio/emf-admission-records.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,IAAI,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAEjF,eAAO,MAAM,eAAe,qBA0B1B,CAAC;AAGH,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAyGzD;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAO/D;AAED,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAmE1D"}
@@ -0,0 +1,80 @@
1
+ /** Hard ceilings for the DOM-free, vector-only admission checker, not converter memory quotas. */
2
+ export declare const VISIO_EMF_ADMISSION_LIMITS: Readonly<{
3
+ maxInputBytes: number;
4
+ maxRecords: 20000;
5
+ maxRecordTypes: 128;
6
+ maxHandles: 4096;
7
+ maxObjects: 4096;
8
+ maxPoints: 100000;
9
+ maxRegionRects: 4096;
10
+ maxClipOperations: 4096;
11
+ maxClipDepth: 64;
12
+ maxStateDepth: 64;
13
+ maxPaletteEntries: 256;
14
+ maxCommentBytes: number;
15
+ maxCoordinate: 1000000;
16
+ maxMappingScale: 4096;
17
+ maxPenWidth: 1024;
18
+ maxAllocationUnits: 500000;
19
+ maxDiagnostics: 64;
20
+ }>;
21
+ export type VisioEmfAdmissionLimits = typeof VISIO_EMF_ADMISSION_LIMITS;
22
+ export type VisioEmfAdmissionOptions = Partial<{
23
+ [K in keyof VisioEmfAdmissionLimits]: number;
24
+ }>;
25
+ export type VisioEmfAdmissionStatus = 'admitted' | 'unsupported' | 'invalid' | 'budget-exceeded';
26
+ export type VisioEmfDiagnosticCode = 'input' | 'limits' | 'header' | 'record-size' | 'record-count' | 'record-limit' | 'unsupported-record' | 'payload-size' | 'parameter' | 'coordinate-limit' | 'mapping-scale' | 'mapping-mode' | 'mapping-extents-fidelity' | 'mapping-transition-fidelity' | 'mapping-restore-fidelity' | 'mapping-incomplete' | 'arc-full-ellipse-fidelity' | 'state-depth' | 'restore-state' | 'unbalanced-state' | 'object-limit' | 'object-handle' | 'object-reference' | 'selected-object' | 'pen-style' | 'brush-style' | 'palette-color' | 'palette-limit' | 'palette' | 'point-limit' | 'region-limit' | 'region-data' | 'region-mode' | 'clip-limit' | 'allocation-limit' | 'comment-range' | 'comment-limit' | 'embedded-wmf' | 'emf-plus' | 'comment-subtype' | 'eof' | 'missing-eof' | 'trailing-data';
27
+ export interface VisioEmfAdmissionDiagnostic {
28
+ readonly kind: Exclude<VisioEmfAdmissionStatus, 'admitted'>;
29
+ readonly code: VisioEmfDiagnosticCode;
30
+ readonly offset: number;
31
+ readonly recordType: number | null;
32
+ readonly message: string;
33
+ readonly limit?: number;
34
+ }
35
+ export interface VisioEmfAdmissionMetrics {
36
+ records: number;
37
+ objectsCreated: number;
38
+ peakLiveObjects: number;
39
+ /** Conservative point-equivalent units, including fixed primitive expansion allowances. */
40
+ points: number;
41
+ regionRects: number;
42
+ clipOperations: number;
43
+ peakClipDepth: number;
44
+ peakStateDepth: number;
45
+ paletteEntries: number;
46
+ commentBytes: number;
47
+ /** Bounded abstract work ledger; not an estimate or guarantee of JS/native heap bytes. */
48
+ allocationUnits: number;
49
+ maxMappedCoordinate: number;
50
+ }
51
+ export interface VisioEmfAdmissionHeader {
52
+ readonly bounds: readonly [number, number, number, number];
53
+ /** EMF header bounds are inclusive-inclusive. */
54
+ readonly pixelWidth: number;
55
+ readonly pixelHeight: number;
56
+ readonly declaredRecords: number;
57
+ readonly declaredHandles: number;
58
+ }
59
+ interface VisioEmfAdmissionBase {
60
+ readonly header: VisioEmfAdmissionHeader | null;
61
+ readonly metrics: Readonly<VisioEmfAdmissionMetrics>;
62
+ readonly recordTypes: ReadonlyArray<{
63
+ readonly type: number;
64
+ readonly count: number;
65
+ }>;
66
+ readonly diagnostics: readonly VisioEmfAdmissionDiagnostic[];
67
+ readonly omittedDiagnostics: number;
68
+ /** True only when bounded framing reached the EOF; not a full conformance assertion. */
69
+ readonly scanComplete: boolean;
70
+ }
71
+ /** Inspection is not a reusable authorization token: mutable bytes must be checked again at use. */
72
+ export type VisioEmfAdmissionResult = VisioEmfAdmissionBase & ({
73
+ readonly status: 'admitted';
74
+ readonly renderingEnabled: false;
75
+ } | {
76
+ readonly status: 'unsupported' | 'invalid' | 'budget-exceeded';
77
+ readonly renderingEnabled: false;
78
+ });
79
+ export {};
80
+ //# sourceMappingURL=emf-admission-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emf-admission-types.d.ts","sourceRoot":"","sources":["../../src/visio/emf-admission-types.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;EAkBrC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,OAAO,0BAA0B,CAAC;AACxE,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAAC;KAAG,CAAC,IAAI,MAAM,uBAAuB,GAAG,MAAM;CAAE,CAAC,CAAC;AACjG,MAAM,MAAM,uBAAuB,GAAG,UAAU,GAAG,aAAa,GAAG,SAAS,GAAG,iBAAiB,CAAC;AACjG,MAAM,MAAM,sBAAsB,GAC/B,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,aAAa,GACb,cAAc,GACd,cAAc,GACd,oBAAoB,GACpB,cAAc,GACd,WAAW,GACX,kBAAkB,GAClB,eAAe,GACf,cAAc,GACd,0BAA0B,GAC1B,6BAA6B,GAC7B,0BAA0B,GAC1B,oBAAoB,GACpB,2BAA2B,GAC3B,aAAa,GACb,eAAe,GACf,kBAAkB,GAClB,cAAc,GACd,eAAe,GACf,kBAAkB,GAClB,iBAAiB,GACjB,WAAW,GACX,aAAa,GACb,eAAe,GACf,eAAe,GACf,SAAS,GACT,aAAa,GACb,cAAc,GACd,aAAa,GACb,aAAa,GACb,YAAY,GACZ,kBAAkB,GAClB,eAAe,GACf,eAAe,GACf,cAAc,GACd,UAAU,GACV,iBAAiB,GACjB,KAAK,GACL,aAAa,GACb,eAAe,CA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C,CAAC;IACrD,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvF,QAAQ,CAAC,WAAW,EAAE,SAAS,2BAA2B,EAAE,CAAC;IAC7D,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,wFAAwF;IACxF,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;CAC/B;AACD,oGAAoG;AACpG,MAAM,MAAM,uBAAuB,GAAG,qBAAqB,GAC1D,CACG;IAAE,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,gBAAgB,EAAE,KAAK,CAAA;CAAE,GACjE;IACA,QAAQ,CAAC,MAAM,EAAE,aAAa,GAAG,SAAS,GAAG,iBAAiB,CAAC;IAC/D,QAAQ,CAAC,gBAAgB,EAAE,KAAK,CAAC;CAChC,CACH,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { type VisioEmfAdmissionOptions, type VisioEmfAdmissionResult } from './emf-admission-types.js';
2
+ export * from './emf-admission-types.js';
3
+ /** Bounded, DOM-free classic EMF inspection. Never invokes a converter or enables rendering.
4
+ * Unknown or unresolved semantics reject the entire asset; no partial drawing is returned.
5
+ * Caller owns package/document-wide limits and must recheck bytes at the conversion boundary.
6
+ * MS-EMF records: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-emf/67fd513f-e633-419c-93c2-8368779ac15a
7
+ */
8
+ export declare function inspectVisioEmfAdmission(input: Uint8Array, options?: VisioEmfAdmissionOptions): VisioEmfAdmissionResult;
9
+ //# sourceMappingURL=emf-admission.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emf-admission.d.ts","sourceRoot":"","sources":["../../src/visio/emf-admission.ts"],"names":[],"mappings":"AASA,OAAO,EACN,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,MAAM,0BAA0B,CAAC;AAClC,cAAc,0BAA0B,CAAC;AAEzC;;;;GAIG;AACH,wBAAgB,wBAAwB,CACvC,KAAK,EAAE,UAAU,EACjB,OAAO,GAAE,wBAA6B,GACpC,uBAAuB,CAyGzB"}
@@ -0,0 +1,4 @@
1
+ import { type VisioForeignVector, type VisioForeignVectorLimits } from './foreign-vector-types.js';
2
+ /** Validate ALL definitions, including unused clips, before charging their use-site expansions. */
3
+ export declare function checkVectorGraph(scene: VisioForeignVector, limits: VisioForeignVectorLimits): void;
4
+ //# sourceMappingURL=foreign-vector-graph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"foreign-vector-graph.d.ts","sourceRoot":"","sources":["../../src/visio/foreign-vector-graph.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,KAAK,kBAAkB,EAGvB,KAAK,wBAAwB,EAG7B,MAAM,2BAA2B,CAAC;AAInC,mGAAmG;AACnG,wBAAgB,gBAAgB,CAC/B,KAAK,EAAE,kBAAkB,EACzB,MAAM,EAAE,wBAAwB,GAC9B,IAAI,CA8EN"}
@@ -0,0 +1,12 @@
1
+ import { type VisioForeignVectorCommand, type VisioForeignVectorLimits, type VisioForeignVectorMatrix } from './foreign-vector-types.js';
2
+ export interface PathBudget {
3
+ operands: number;
4
+ commands: number;
5
+ }
6
+ /** Deliberately strict SVG grammar: malformed paths reject the whole drawing, never partial playback.
7
+ * https://www.w3.org/TR/SVG11/paths.html#PathDataBNF
8
+ */
9
+ export declare function pathCommands(value: unknown, limits: VisioForeignVectorLimits, budget: PathBudget): readonly VisioForeignVectorCommand[];
10
+ /** Conservative transformed bounds, including accumulated relative coordinates and corrected arc radii. */
11
+ export declare function checkPathBounds(commands: readonly VisioForeignVectorCommand[], matrix: VisioForeignVectorMatrix, max: number): void;
12
+ //# sourceMappingURL=foreign-vector-path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"foreign-vector-path.d.ts","sourceRoot":"","sources":["../../src/visio/foreign-vector-path.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,MAAM,2BAA2B,CAAC;AAiBnC,MAAM,WAAW,UAAU;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CACjB;AACD;;GAEG;AACH,wBAAgB,YAAY,CAC3B,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,wBAAwB,EAChC,MAAM,EAAE,UAAU,GAChB,SAAS,yBAAyB,EAAE,CAgItC;AAED,2GAA2G;AAC3G,wBAAgB,eAAe,CAC9B,QAAQ,EAAE,SAAS,yBAAyB,EAAE,EAC9C,MAAM,EAAE,wBAAwB,EAChC,GAAG,EAAE,MAAM,GACT,IAAI,CAmDN"}
@@ -0,0 +1,81 @@
1
+ /** Inert converter-output scene. Never contains markup, document IDs, URLs, fonts or images. */
2
+ export type VisioForeignVectorMatrix = readonly [number, number, number, number, number, number];
3
+ export type VisioForeignVectorRule = 'nonzero' | 'evenodd';
4
+ /** Commands are normalized to absolute coordinates; each values array has the command's SVG arity. */
5
+ export interface VisioForeignVectorCommand {
6
+ readonly command: 'M' | 'L' | 'C' | 'Q' | 'A' | 'Z';
7
+ readonly values: readonly number[];
8
+ }
9
+ export interface VisioForeignVectorPaint {
10
+ readonly fill: string;
11
+ readonly stroke: string;
12
+ readonly fillRule: VisioForeignVectorRule;
13
+ readonly strokeWidth: number;
14
+ readonly strokeMiterlimit: number;
15
+ readonly strokeLinecap: 'butt' | 'round' | 'square';
16
+ readonly strokeLinejoin: 'miter' | 'round' | 'bevel';
17
+ readonly opacity: number;
18
+ readonly fillOpacity: number;
19
+ readonly strokeOpacity: number;
20
+ }
21
+ export interface VisioForeignVectorPath {
22
+ readonly kind: 'path';
23
+ readonly matrix: VisioForeignVectorMatrix;
24
+ readonly commands: readonly VisioForeignVectorCommand[];
25
+ readonly paint: VisioForeignVectorPaint;
26
+ /** Exact index into this scene's clips. No cross-scene or DOM identity. */
27
+ readonly clipIndex?: number;
28
+ }
29
+ export interface VisioForeignVectorGroup {
30
+ readonly kind: 'group';
31
+ readonly matrix: VisioForeignVectorMatrix;
32
+ readonly items: readonly VisioForeignVectorNode[];
33
+ readonly clipIndex?: number;
34
+ }
35
+ export type VisioForeignVectorNode = VisioForeignVectorPath | VisioForeignVectorGroup;
36
+ export interface VisioForeignVectorClipPath {
37
+ readonly matrix: VisioForeignVectorMatrix;
38
+ readonly commands: readonly VisioForeignVectorCommand[];
39
+ /** SVG clip-rule, independently defaulted to nonzero, never inferred from fill-rule. */
40
+ readonly clipRule: VisioForeignVectorRule;
41
+ readonly clipIndex?: number;
42
+ }
43
+ export interface VisioForeignVectorClip {
44
+ readonly matrix: VisioForeignVectorMatrix;
45
+ /** Union of path silhouettes. An empty array clips away everything.
46
+ * https://www.w3.org/TR/SVG11/masking.html#EstablishingANewClippingPath
47
+ */
48
+ readonly items: readonly VisioForeignVectorClipPath[];
49
+ /** Intersection with another validated clip, in userSpaceOnUse coordinates. */
50
+ readonly clipIndex?: number;
51
+ }
52
+ export interface VisioForeignVector {
53
+ readonly kind: 'vector';
54
+ readonly width: number;
55
+ readonly height: number;
56
+ readonly items: readonly VisioForeignVectorNode[];
57
+ readonly clips: readonly VisioForeignVectorClip[];
58
+ }
59
+ export interface VisioForeignVectorLimits {
60
+ maxNodes: number;
61
+ /** Aggregate UTF-16 code units of source SVG strings and, separately, retained scene values. */
62
+ maxCharacters: number;
63
+ maxPathOperands: number;
64
+ maxPathCommands: number;
65
+ maxDepth: number;
66
+ maxDimension: number;
67
+ maxCoordinate: number;
68
+ /** Includes every clip reference expansion, even repeated uses. */
69
+ maxExpandedNodes: number;
70
+ maxExpandedOperands: number;
71
+ maxExpandedCommands: number;
72
+ }
73
+ export declare const VISIO_FOREIGN_VECTOR_LIMITS: Readonly<VisioForeignVectorLimits>;
74
+ export declare class VisioForeignVectorError extends Error {
75
+ readonly code: 'unsafe-vector' | 'vector-limit';
76
+ readonly name = "VisioForeignVectorError";
77
+ constructor(code: 'unsafe-vector' | 'vector-limit', message: string);
78
+ }
79
+ export declare function unsafe(message: string): never;
80
+ export declare function limit(message: string): never;
81
+ //# sourceMappingURL=foreign-vector-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"foreign-vector-types.d.ts","sourceRoot":"","sources":["../../src/visio/foreign-vector-types.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,MAAM,MAAM,wBAAwB,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AACjG,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,SAAS,CAAC;AAC3D,sGAAsG;AACtG,MAAM,WAAW,yBAAyB;IACzC,QAAQ,CAAC,OAAO,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IACpD,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AACD,MAAM,WAAW,uBAAuB;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,sBAAsB,CAAC;IAC1C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;IACpD,QAAQ,CAAC,cAAc,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;IACrD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAC/B;AACD,MAAM,WAAW,sBAAsB;IACtC,QAAQ,CAAC,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CAAC,KAAK,EAAE,SAAS,sBAAsB,EAAE,CAAC;CAClD;AACD,MAAM,WAAW,wBAAwB;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,gGAAgG;IAChG,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,mEAAmE;IACnE,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mBAAmB,EAAE,MAAM,CAAC;CAC5B;AACD,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,wBAAwB,CAWzE,CAAC;AACH,qBAAa,uBAAwB,SAAQ,KAAK;IAGhD,QAAQ,CAAC,IAAI,EAAE,eAAe,GAAG,cAAc;IAFhD,SAAkB,IAAI,6BAA6B;gBAEzC,IAAI,EAAE,eAAe,GAAG,cAAc,EAC/C,OAAO,EAAE,MAAM;CAIhB;AACD,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAE7C;AACD,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAE5C"}
@@ -0,0 +1,4 @@
1
+ import { type VisioForeignVector, type VisioForeignVectorLimits } from './foreign-vector-types.js';
2
+ /** Validate untrusted worker/host scenes, returning an independent deeply frozen canonical copy. */
3
+ export declare function validateVisioForeignVector(value: unknown, options?: Partial<VisioForeignVectorLimits>): VisioForeignVector;
4
+ //# sourceMappingURL=foreign-vector-validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"foreign-vector-validation.d.ts","sourceRoot":"","sources":["../../src/visio/foreign-vector-validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,KAAK,kBAAkB,EAIvB,KAAK,wBAAwB,EAI7B,MAAM,2BAA2B,CAAC;AAiBnC,oGAAoG;AACpG,wBAAgB,0BAA0B,CACzC,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,OAAO,CAAC,wBAAwB,CAAM,GAC7C,kBAAkB,CAOpB"}
@@ -0,0 +1,14 @@
1
+ import { type VisioForeignVectorLimits, type VisioForeignVectorMatrix, type VisioForeignVectorPaint, type VisioForeignVectorRule } from './foreign-vector-types.js';
2
+ export declare const IDENTITY: VisioForeignVectorMatrix;
3
+ export type RecordValue = Record<string, unknown>;
4
+ /** Reject accessors/exotic prototypes rather than invoking document-owned getters or coercions. */
5
+ export declare function record(value: unknown, allowed: readonly string[]): RecordValue;
6
+ export declare function limitsFor(options: Partial<VisioForeignVectorLimits>): VisioForeignVectorLimits;
7
+ export declare function finite(value: unknown, maximum: number): number;
8
+ export declare function scalar(value: unknown, maximum: number, minimum?: number): number;
9
+ export declare function numberList(value: unknown, length: number, maximum: number): number[];
10
+ export declare function matrix(value: unknown, maximum: number): VisioForeignVectorMatrix;
11
+ export declare function compose(a: VisioForeignVectorMatrix, b: VisioForeignVectorMatrix, max: number): VisioForeignVectorMatrix;
12
+ export declare function rule(value: unknown): VisioForeignVectorRule;
13
+ export declare function paint(attrs: RecordValue): VisioForeignVectorPaint;
14
+ //# sourceMappingURL=foreign-vector-values.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"foreign-vector-values.d.ts","sourceRoot":"","sources":["../../src/visio/foreign-vector-values.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,MAAM,2BAA2B,CAAC;AAEnC,eAAO,MAAM,QAAQ,EAAE,wBAA4D,CAAC;AAIpF,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAClD,mGAAmG;AACnG,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,WAAW,CAgB9E;AACD,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,wBAAwB,CAAC,GAAG,wBAAwB,CAe9F;AACD,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAI9D;AACD,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,SAAI,GAAG,MAAM,CAQ3E;AACD,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAcpF;AACD,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,wBAAwB,CAOhF;AACD,wBAAgB,OAAO,CACtB,CAAC,EAAE,wBAAwB,EAC3B,CAAC,EAAE,wBAAwB,EAC3B,GAAG,EAAE,MAAM,GACT,wBAAwB,CAW1B;AACD,wBAAgB,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,sBAAsB,CAI3D;AAaD,wBAAgB,KAAK,CAAC,KAAK,EAAE,WAAW,GAAG,uBAAuB,CAiBjE"}
@@ -0,0 +1,13 @@
1
+ import { type VisioForeignVector, type VisioForeignVectorLimits } from './foreign-vector-types.js';
2
+ export { VISIO_FOREIGN_VECTOR_LIMITS, VisioForeignVectorError } from './foreign-vector-types.js';
3
+ export type { VisioForeignVector, VisioForeignVectorClip, VisioForeignVectorClipPath, VisioForeignVectorCommand, VisioForeignVectorGroup, VisioForeignVectorLimits, VisioForeignVectorMatrix, VisioForeignVectorNode, VisioForeignVectorPaint, VisioForeignVectorPath, VisioForeignVectorRule, } from './foreign-vector-types.js';
4
+ /**
5
+ * Converts a narrowly supported converter-owned SVG tree into a copied, deeply frozen scene.
6
+ * This is an output boundary, not permission to run a converter or evidence of EMF fidelity.
7
+ * Unknown content rejects the entire scene. The only admitted style is the exact inert root
8
+ * marker "isolation:isolate"; it is not retained. No caller-owned object is mutated or frozen.
9
+ * Revalidate data after crossing an untrusted transport; a TypeScript type is not validation.
10
+ */
11
+ export declare function sanitizeVisioForeignVectorTree(root: unknown, options?: Partial<VisioForeignVectorLimits>): VisioForeignVector;
12
+ export { validateVisioForeignVector } from './foreign-vector-validation.js';
13
+ //# sourceMappingURL=foreign-vector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"foreign-vector.d.ts","sourceRoot":"","sources":["../../src/visio/foreign-vector.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,KAAK,kBAAkB,EAGvB,KAAK,wBAAwB,EAG7B,MAAM,2BAA2B,CAAC;AAanC,OAAO,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACjG,YAAY,EACX,kBAAkB,EAClB,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,EACzB,uBAAuB,EACvB,wBAAwB,EACxB,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,GACtB,MAAM,2BAA2B,CAAC;AAwBnC;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC7C,IAAI,EAAE,OAAO,EACb,OAAO,GAAE,OAAO,CAAC,wBAAwB,CAAM,GAC7C,kBAAkB,CAQpB;AAgKD,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { VisioGeometry, VisioMatrix } from './model.js';
2
+ import { type Cells, type Report, type Sheet } from './sheet.js';
3
+ /** Visio Pin/LocPin, angle and flips, mapping shape coordinates to its parent's coordinates. */
4
+ export declare function shapeTransform(cells: Cells, width: number, height: number, report?: Report): VisioMatrix;
5
+ export declare function transform(x: number, y: number, localX: number, localY: number, angle: number, flipX?: boolean, flipY?: boolean): VisioMatrix;
6
+ /** Converts the supported cached Geometry rows into inert SVG path data. */
7
+ export declare function geometryPaths(sheet: Sheet, width: number, height: number, report: Report, consume: () => void, consumeWork?: (units: number) => void): VisioGeometry[];
8
+ //# sourceMappingURL=geometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../src/visio/geometry.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAU,KAAK,KAAK,EAAE,KAAK,MAAM,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAIzE,gGAAgG;AAChG,wBAAgB,cAAc,CAC7B,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,GACb,WAAW,CAUb;AACD,wBAAgB,SAAS,CACxB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,KAAK,UAAQ,EACb,KAAK,UAAQ,GACX,WAAW,CAQb;AAsCD,4EAA4E;AAC5E,wBAAgB,aAAa,CAC5B,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,IAAI,EACnB,WAAW,GAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAe,GAC7C,aAAa,EAAE,CAwNjB"}