@syncfusion/ej2-office-common 35.1.37

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 (147) hide show
  1. package/.eslintrc.json +263 -0
  2. package/.prettierrc.json +5 -0
  3. package/README.md +167 -0
  4. package/api-extractor.json +35 -0
  5. package/core.js +4 -0
  6. package/dist/ej2-office-common.umd.min.js +11 -0
  7. package/dist/ej2-office-common.umd.min.js.map +1 -0
  8. package/dist/es6/ej2-office-common.es2015.js +6585 -0
  9. package/dist/es6/ej2-office-common.es2015.js.map +1 -0
  10. package/dist/es6/ej2-office-common.es5.js +7955 -0
  11. package/dist/es6/ej2-office-common.es5.js.map +1 -0
  12. package/dist/global/ej2-office-common.min.js +11 -0
  13. package/dist/global/ej2-office-common.min.js.map +1 -0
  14. package/dist/global/index.d.ts +14 -0
  15. package/encryption.js +4 -0
  16. package/features.js +4 -0
  17. package/global.json +6 -0
  18. package/index.js +4 -0
  19. package/license +10 -0
  20. package/nuget.config +7 -0
  21. package/package.json +23 -0
  22. package/src/all.d.ts +41 -0
  23. package/src/all.js +38 -0
  24. package/src/core/index.d.ts +6 -0
  25. package/src/core/index.js +6 -0
  26. package/src/core/xml/index.d.ts +7 -0
  27. package/src/core/xml/index.js +6 -0
  28. package/src/core/xml/model.d.ts +71 -0
  29. package/src/core/xml/model.js +20 -0
  30. package/src/encryption/agile-constants.d.ts +61 -0
  31. package/src/encryption/agile-constants.js +71 -0
  32. package/src/encryption/agile-encryption-info.d.ts +46 -0
  33. package/src/encryption/agile-encryption-info.js +333 -0
  34. package/src/encryption/agile-password.d.ts +8 -0
  35. package/src/encryption/agile-password.js +58 -0
  36. package/src/encryption/cfb-reader.d.ts +11 -0
  37. package/src/encryption/cfb-reader.js +345 -0
  38. package/src/encryption/crypto-primitives.d.ts +74 -0
  39. package/src/encryption/crypto-primitives.js +302 -0
  40. package/src/encryption/decrypt-encrypted-package.d.ts +16 -0
  41. package/src/encryption/decrypt-encrypted-package.js +138 -0
  42. package/src/encryption/encryption-info-xml.d.ts +21 -0
  43. package/src/encryption/encryption-info-xml.js +282 -0
  44. package/src/encryption/errors.d.ts +66 -0
  45. package/src/encryption/errors.js +124 -0
  46. package/src/encryption/index.d.ts +35 -0
  47. package/src/encryption/index.js +100 -0
  48. package/src/features/diagrams/constants.d.ts +83 -0
  49. package/src/features/diagrams/constants.js +101 -0
  50. package/src/features/diagrams/diagram-data-model.d.ts +148 -0
  51. package/src/features/diagrams/diagram-data-model.js +446 -0
  52. package/src/features/diagrams/diagram-parsers.d.ts +28 -0
  53. package/src/features/diagrams/diagram-parsers.js +182 -0
  54. package/src/features/diagrams/diagram-serializers.d.ts +20 -0
  55. package/src/features/diagrams/diagram-serializers.js +110 -0
  56. package/src/features/diagrams/diagram-views.d.ts +60 -0
  57. package/src/features/diagrams/diagram-views.js +213 -0
  58. package/src/features/diagrams/element-tree.d.ts +55 -0
  59. package/src/features/diagrams/element-tree.js +197 -0
  60. package/src/features/diagrams/errors.d.ts +17 -0
  61. package/src/features/diagrams/errors.js +59 -0
  62. package/src/features/diagrams/index.d.ts +17 -0
  63. package/src/features/diagrams/index.js +17 -0
  64. package/src/features/diagrams/smart-art-catalog.d.ts +107 -0
  65. package/src/features/diagrams/smart-art-catalog.js +422 -0
  66. package/src/features/diagrams/smart-art-diagram.d.ts +96 -0
  67. package/src/features/diagrams/smart-art-diagram.js +258 -0
  68. package/src/features/index.d.ts +11 -0
  69. package/src/features/index.js +11 -0
  70. package/src/features/ink/constants.d.ts +54 -0
  71. package/src/features/ink/constants.js +54 -0
  72. package/src/features/ink/index.d.ts +18 -0
  73. package/src/features/ink/index.js +15 -0
  74. package/src/features/ink/ink-effects.d.ts +35 -0
  75. package/src/features/ink/ink-effects.js +45 -0
  76. package/src/features/ink/ink-model.d.ts +237 -0
  77. package/src/features/ink/ink-model.js +406 -0
  78. package/src/features/ink/ink-parser.d.ts +59 -0
  79. package/src/features/ink/ink-parser.js +671 -0
  80. package/src/features/ink/ink-serializer.d.ts +16 -0
  81. package/src/features/ink/ink-serializer.js +281 -0
  82. package/src/features/ink/ink-units.d.ts +33 -0
  83. package/src/features/ink/ink-units.js +92 -0
  84. package/src/features/ink/ink-xml.d.ts +26 -0
  85. package/src/features/ink/ink-xml.js +165 -0
  86. package/src/features/ink/trace-codec.d.ts +127 -0
  87. package/src/features/ink/trace-codec.js +266 -0
  88. package/src/features/mathml/constants.d.ts +47 -0
  89. package/src/features/mathml/constants.js +47 -0
  90. package/src/features/mathml/errors.d.ts +50 -0
  91. package/src/features/mathml/errors.js +69 -0
  92. package/src/features/mathml/index.d.ts +30 -0
  93. package/src/features/mathml/index.js +22 -0
  94. package/src/features/mathml/math-factory.d.ts +26 -0
  95. package/src/features/mathml/math-factory.js +568 -0
  96. package/src/features/mathml/model/controls.d.ts +896 -0
  97. package/src/features/mathml/model/controls.js +1541 -0
  98. package/src/features/mathml/model/enums.d.ts +153 -0
  99. package/src/features/mathml/model/enums.js +133 -0
  100. package/src/features/mathml/model/math-element.d.ts +173 -0
  101. package/src/features/mathml/model/math-element.js +315 -0
  102. package/src/features/mathml/model/roots.d.ts +82 -0
  103. package/src/features/mathml/model/roots.js +177 -0
  104. package/src/features/mathml/openxml.d.ts +56 -0
  105. package/src/features/mathml/openxml.js +87 -0
  106. package/src/features/mathml/parse/math-parser.d.ts +43 -0
  107. package/src/features/mathml/parse/math-parser.js +636 -0
  108. package/src/features/mathml/serialize/math-serializer.d.ts +34 -0
  109. package/src/features/mathml/serialize/math-serializer.js +749 -0
  110. package/src/features/smart-art/diagram-xml.d.ts +63 -0
  111. package/src/features/smart-art/diagram-xml.js +459 -0
  112. package/src/features/smart-art/errors.d.ts +24 -0
  113. package/src/features/smart-art/errors.js +47 -0
  114. package/src/features/smart-art/index.d.ts +26 -0
  115. package/src/features/smart-art/index.js +26 -0
  116. package/src/features/smart-art/minimal-samples.d.ts +18 -0
  117. package/src/features/smart-art/minimal-samples.js +40 -0
  118. package/src/features/smart-art/mutators.d.ts +60 -0
  119. package/src/features/smart-art/mutators.js +566 -0
  120. package/src/features/smart-art/namespaces.d.ts +153 -0
  121. package/src/features/smart-art/namespaces.js +163 -0
  122. package/src/features/smart-art/package-graph.d.ts +61 -0
  123. package/src/features/smart-art/package-graph.js +413 -0
  124. package/src/features/smart-art/parse-colors.d.ts +19 -0
  125. package/src/features/smart-art/parse-colors.js +39 -0
  126. package/src/features/smart-art/parse-data.d.ts +21 -0
  127. package/src/features/smart-art/parse-data.js +121 -0
  128. package/src/features/smart-art/parse-layout.d.ts +20 -0
  129. package/src/features/smart-art/parse-layout.js +40 -0
  130. package/src/features/smart-art/parse-rel-ids.d.ts +71 -0
  131. package/src/features/smart-art/parse-rel-ids.js +233 -0
  132. package/src/features/smart-art/parse-style.d.ts +19 -0
  133. package/src/features/smart-art/parse-style.js +39 -0
  134. package/src/features/smart-art/point-text.d.ts +80 -0
  135. package/src/features/smart-art/point-text.js +424 -0
  136. package/src/features/smart-art/register.d.ts +33 -0
  137. package/src/features/smart-art/register.js +95 -0
  138. package/src/features/smart-art/serialize.d.ts +40 -0
  139. package/src/features/smart-art/serialize.js +48 -0
  140. package/src/features/smart-art/types.d.ts +403 -0
  141. package/src/features/smart-art/types.js +28 -0
  142. package/src/global.js +1 -0
  143. package/src/index.d.ts +21 -0
  144. package/src/index.js +22 -0
  145. package/tsconfig.build.json +13 -0
  146. package/tsconfig.harness.json +32 -0
  147. package/tslint.json +111 -0
@@ -0,0 +1,14 @@
1
+ /*!
2
+ * filename: index.d.ts
3
+ * version : 35.1.37
4
+ * Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
5
+ * Use of this code is subject to the terms of our license.
6
+ * A copy of the current license can be obtained at any time by e-mailing
7
+ * licensing@syncfusion.com. Any infringement will be prosecuted under
8
+ * applicable laws.
9
+ */
10
+ import * as _officecommon from '@syncfusion/ej2-office-common';
11
+
12
+ export declare namespace ej {
13
+ const officecommon: typeof _officecommon;
14
+ }
package/encryption.js ADDED
@@ -0,0 +1,4 @@
1
+ /**
2
+ * encryption
3
+ */
4
+ export * from './src/encryption/index';
package/features.js ADDED
@@ -0,0 +1,4 @@
1
+ /**
2
+ * features
3
+ */
4
+ export * from './src/features/index';
package/global.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "sdk": {
3
+ "version": "10.0.400",
4
+ "rollForward": "latestFeature"
5
+ }
6
+ }
package/index.js ADDED
@@ -0,0 +1,4 @@
1
+ /**
2
+ * index
3
+ */
4
+ export * from './src/index';
package/license ADDED
@@ -0,0 +1,10 @@
1
+ Essential JS 2 library is available under the Syncfusion Essential Studio program, and can be licensed either under the Syncfusion Community License Program or the Syncfusion commercial license.
2
+
3
+ To be qualified for the Syncfusion Community License Program you must have a gross revenue of less than one (1) million U.S. dollars ($1,000,000.00 USD) per year and have less than five (5) developers in your organization, and agree to be bound by Syncfusion’s terms and conditions.
4
+
5
+ Customers who do not qualify for the community license can contact sales@syncfusion.com for commercial licensing options.
6
+
7
+ Under no circumstances you can use this product without (1) either a Community License or a commercial license and (2) without agreeing and abiding by Syncfusion’s license containing all terms and conditions.
8
+
9
+ The Syncfusion license that contains the terms and conditions can be found at
10
+ https://www.syncfusion.com/content/downloads/syncfusion_license.pdf
package/nuget.config ADDED
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <configuration>
3
+ <packageSources>
4
+ <clear />
5
+ <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
6
+ </packageSources>
7
+ </configuration>
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "@syncfusion/ej2-office-common",
3
+ "version": "35.1.37",
4
+ "description": "Shared OOXML codecs and domain models for EJ2 Office JavaScript libraries (ink, diagrams, mathml, smart-art, encryption).",
5
+ "author": "Syncfusion Inc.",
6
+ "license": "SEE LICENSE IN license",
7
+ "devDependencies": {},
8
+ "main": "./dist/ej2-office-common.umd.min.js",
9
+ "module": "./index.js",
10
+ "es2015": "./dist/es6/ej2-office-common.es5.js",
11
+ "typings": "index.d.ts",
12
+ "keywords": [
13
+ "ej2",
14
+ "syncfusion",
15
+ "office-common"
16
+ ],
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "https://github.com/syncfusion/ej2-javascript-ui-controls/tree/master/controls/office-common"
20
+ },
21
+ "sideEffects": false,
22
+ "homepage": "https://www.syncfusion.com/javascript-ui-controls"
23
+ }
package/src/all.d.ts ADDED
@@ -0,0 +1,41 @@
1
+ /**
2
+ * All-in entry for consumers who want every public API from @syncfusion/ej2-office-common.
3
+ * Prefer explicit `@syncfusion/ej2-office-common/<feature>` subpaths when bundle size matters.
4
+ *
5
+ * @remarks
6
+ * Re-exports the root surface (ink, mathml, encryption) plus the optional
7
+ * SmartArt (`./smart-art`) module. Diagram feature symbols remain on the
8
+ * `@syncfusion/ej2-office-common/diagrams` subpath only (same dual-export pattern as
9
+ * development). FEATURE_SUBPATHS lists every optional feature export.
10
+ *
11
+ * @packageDocumentation
12
+ */
13
+ export * from './index';
14
+ export { DIAGRAM_COLORS_CONTENT_TYPE, DIAGRAM_COLORS_RELATIONSHIP_TYPE, DIAGRAM_CONTENT_TYPES, DIAGRAM_DATA_CONTENT_TYPE, DIAGRAM_DATA_RELATIONSHIP_TYPE, DIAGRAM_GRAPHIC_DATA_URI, DIAGRAM_LAYOUT_CONTENT_TYPE, DIAGRAM_LAYOUT_RELATIONSHIP_TYPE, DIAGRAM_NAMESPACE, DIAGRAM_QUICK_STYLE_RELATIONSHIP_TYPE, DIAGRAM_RELATIONSHIP_TYPES, DIAGRAM_STYLE_CONTENT_TYPE, DRAWINGML_MAIN_NAMESPACE, OFFICE_DOCUMENT_RELATIONSHIPS_NAMESPACE, OFFICE_IMAGE_RELATIONSHIP_TYPE, DiagramPartError, DiagramPointType, createDiagramInstance, diagramPoint, diagramPointText, enumerateDiagramInstances, findDiagramRelIds, getDiagramInstance, getDiagramPartHandler, listDiagramConnections, listDiagramParts, listDiagramPoints, normalizePartName, parseDiagramColors, parseDiagramData, parseDiagramLayout, parseDiagramRelIds, parseDiagramStyle, registerSmartArtFeature, removeDiagramInstance, serializeDiagramColors, serializeDiagramData, serializeDiagramLayout, serializeDiagramStyle, withDiagramPointText, CreateDiagramInstanceOptions, CreateDiagramInstanceResult, CreateDiagramInstanceSeeds, DiagramColorsPart, DiagramConnection, DiagramDataPart, DiagramGraphicHook, DiagramInstance, DiagramLayoutPart, DiagramPackageGraph, DiagramPackagePart, DiagramPackageRelationship, DiagramPartHandler, DiagramPartNames, DiagramPoint, DiagramRelIds, DiagramStylePart, GetDiagramInstanceOptions, RemoveDiagramInstanceOptions, RemoveDiagramInstanceResult, } from './features/smart-art/index';
15
+ /**
16
+ * Feature subpaths registered for the configurator / bundle matrix.
17
+ * Must stay in sync with `package.json` `exports` feature keys.
18
+ *
19
+ * @remarks
20
+ * Non-feature surfaces such as `./encryption` are omitted here.
21
+ *
22
+ * @public
23
+ */
24
+ export declare const FEATURE_SUBPATHS: string[];
25
+ /**
26
+ * Union of FEATURE_SUBPATHS string literals.
27
+ *
28
+ * @public
29
+ */
30
+ export declare type FeatureSubpath = (typeof FEATURE_SUBPATHS)[number];
31
+ /**
32
+ * Registers every optional feature that installs side-effect handlers in this build.
33
+ *
34
+ * @remarks
35
+ * Invokes registerSmartArtFeature, which installs the four Transitional
36
+ * diagram content-type handlers (idempotent). Ink / diagrams / mathml modules
37
+ * do not expose a matching register hook on this tree.
38
+ *
39
+ * @public
40
+ */
41
+ export declare function registerAllFeatures(): void;
package/src/all.js ADDED
@@ -0,0 +1,38 @@
1
+ /**
2
+ * All-in entry for consumers who want every public API from @syncfusion/ej2-office-common.
3
+ * Prefer explicit `@syncfusion/ej2-office-common/<feature>` subpaths when bundle size matters.
4
+ *
5
+ * @remarks
6
+ * Re-exports the root surface (ink, mathml, encryption) plus the optional
7
+ * SmartArt (`./smart-art`) module. Diagram feature symbols remain on the
8
+ * `@syncfusion/ej2-office-common/diagrams` subpath only (same dual-export pattern as
9
+ * development). FEATURE_SUBPATHS lists every optional feature export.
10
+ *
11
+ * @packageDocumentation
12
+ */
13
+ export * from './index';
14
+ import { registerSmartArtFeature } from './features/smart-art/index';
15
+ export { DIAGRAM_COLORS_CONTENT_TYPE, DIAGRAM_COLORS_RELATIONSHIP_TYPE, DIAGRAM_CONTENT_TYPES, DIAGRAM_DATA_CONTENT_TYPE, DIAGRAM_DATA_RELATIONSHIP_TYPE, DIAGRAM_GRAPHIC_DATA_URI, DIAGRAM_LAYOUT_CONTENT_TYPE, DIAGRAM_LAYOUT_RELATIONSHIP_TYPE, DIAGRAM_NAMESPACE, DIAGRAM_QUICK_STYLE_RELATIONSHIP_TYPE, DIAGRAM_RELATIONSHIP_TYPES, DIAGRAM_STYLE_CONTENT_TYPE, DRAWINGML_MAIN_NAMESPACE, OFFICE_DOCUMENT_RELATIONSHIPS_NAMESPACE, OFFICE_IMAGE_RELATIONSHIP_TYPE, DiagramPartError, DiagramPointType, createDiagramInstance, diagramPoint, diagramPointText, enumerateDiagramInstances, findDiagramRelIds, getDiagramInstance, getDiagramPartHandler, listDiagramConnections, listDiagramParts, listDiagramPoints, normalizePartName, parseDiagramColors, parseDiagramData, parseDiagramLayout, parseDiagramRelIds, parseDiagramStyle, registerSmartArtFeature, removeDiagramInstance, serializeDiagramColors, serializeDiagramData, serializeDiagramLayout, serializeDiagramStyle, withDiagramPointText, } from './features/smart-art/index';
16
+ /**
17
+ * Feature subpaths registered for the configurator / bundle matrix.
18
+ * Must stay in sync with `package.json` `exports` feature keys.
19
+ *
20
+ * @remarks
21
+ * Non-feature surfaces such as `./encryption` are omitted here.
22
+ *
23
+ * @public
24
+ */
25
+ export var FEATURE_SUBPATHS = ['ink', 'diagrams', 'mathml', 'smart-art'];
26
+ /**
27
+ * Registers every optional feature that installs side-effect handlers in this build.
28
+ *
29
+ * @remarks
30
+ * Invokes registerSmartArtFeature, which installs the four Transitional
31
+ * diagram content-type handlers (idempotent). Ink / diagrams / mathml modules
32
+ * do not expose a matching register hook on this tree.
33
+ *
34
+ * @public
35
+ */
36
+ export function registerAllFeatures() {
37
+ registerSmartArtFeature();
38
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Core shared OOXML primitives for EJ2 Office libraries.
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+ export * from './xml/index';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Core shared OOXML primitives for EJ2 Office libraries.
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+ export * from './xml/index';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Open XML tree types for shared codecs.
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+ export { NamespaceDeclaration, OpenXmlAttribute, OpenXmlChild, OpenXmlElement, OpenXmlText, } from './model';
7
+ export { XML_NAMESPACE, XMLNS_NAMESPACE } from './model';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Open XML tree types for shared codecs.
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+ export { XML_NAMESPACE, XMLNS_NAMESPACE } from './model';
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Minimal Open XML element tree model shared by office-common codecs.
3
+ *
4
+ * Shape matches the application-repo OpenXml tree (`ej2-docx` `src/core/xml/model.ts`)
5
+ * so ink parse/serialize can accept host-supplied trees without a second DOM type.
6
+ *
7
+ * This module does **not** parse raw bytes — callers supply an element tree.
8
+ */
9
+ /**
10
+ * Attribute on an {@link OpenXmlElement}.
11
+ *
12
+ * @public
13
+ */
14
+ export interface OpenXmlAttribute {
15
+ readonly namespaceUri: string;
16
+ readonly localName: string;
17
+ readonly prefix: string;
18
+ readonly value: string;
19
+ }
20
+ /**
21
+ * `xmlns` declaration on an {@link OpenXmlElement}.
22
+ *
23
+ * @public
24
+ */
25
+ export interface NamespaceDeclaration {
26
+ readonly prefix: string;
27
+ readonly namespaceUri: string;
28
+ }
29
+ /**
30
+ * Child of an {@link OpenXmlElement}.
31
+ *
32
+ * @public
33
+ */
34
+ export declare type OpenXmlChild = OpenElement | OpenXmlText;
35
+ /**
36
+ * Text node in the XML tree.
37
+ *
38
+ * @public
39
+ */
40
+ export interface OpenXmlText {
41
+ readonly kind: 'text';
42
+ readonly value: string;
43
+ }
44
+ /**
45
+ * Element in the preserved XML tree.
46
+ *
47
+ * @public
48
+ */
49
+ export interface OpenXmlElement {
50
+ readonly kind: 'element';
51
+ readonly namespaceUri: string;
52
+ readonly localName: string;
53
+ readonly prefix: string;
54
+ readonly attributes: ReadonlyArray<OpenXmlAttribute>;
55
+ readonly namespaceDeclarations: ReadonlyArray<NamespaceDeclaration>;
56
+ readonly children: ReadonlyArray<OpenXmlChild>;
57
+ }
58
+ /** Alias kept for internal clarity when building trees. */
59
+ export declare type OpenElement = OpenXmlElement;
60
+ /**
61
+ * XML namespace URI (`xml:`).
62
+ *
63
+ * @public
64
+ */
65
+ export declare const XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
66
+ /**
67
+ * XMLNS namespace URI (`xmlns:`).
68
+ *
69
+ * @public
70
+ */
71
+ export declare const XMLNS_NAMESPACE = "http://www.w3.org/2000/xmlns/";
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Minimal Open XML element tree model shared by office-common codecs.
3
+ *
4
+ * Shape matches the application-repo OpenXml tree (`ej2-docx` `src/core/xml/model.ts`)
5
+ * so ink parse/serialize can accept host-supplied trees without a second DOM type.
6
+ *
7
+ * This module does **not** parse raw bytes — callers supply an element tree.
8
+ */
9
+ /**
10
+ * XML namespace URI (`xml:`).
11
+ *
12
+ * @public
13
+ */
14
+ export var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
15
+ /**
16
+ * XMLNS namespace URI (`xmlns:`).
17
+ *
18
+ * @public
19
+ */
20
+ export var XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/';
@@ -0,0 +1,61 @@
1
+ /**
2
+ * EncryptionVersionInfo major for Agile: `0x0004` ([MS-OFFCRYPTO] §2.3.4.10).
3
+ *
4
+ * @public
5
+ */
6
+ export declare const AGILE_VERSION_MAJOR = 4;
7
+ /**
8
+ * EncryptionVersionInfo minor for Agile: `0x0004` ([MS-OFFCRYPTO] §2.3.4.10).
9
+ *
10
+ * @public
11
+ */
12
+ export declare const AGILE_VERSION_MINOR = 4;
13
+ /** Reserved field after version MUST be 0x00000040 (§2.3.4.10). */
14
+ export declare const AGILE_RESERVED = 64;
15
+ /** EncryptionInfo XML target namespace (§2.3.4.10). */
16
+ export declare const AGILE_ENCRYPTION_NS = "http://schemas.microsoft.com/office/2006/encryption";
17
+ /** PasswordKeyEncryptor URI on keyEncryptor (§2.3.4.10). */
18
+ export declare const PASSWORD_KEY_ENCRYPTOR_URI = "http://schemas.microsoft.com/office/2006/keyEncryptor/password";
19
+ /** PasswordKeyEncryptor element namespace (§2.3.4.10). */
20
+ export declare const PASSWORD_KEY_ENCRYPTOR_NS = "http://schemas.microsoft.com/office/2006/keyEncryptor/password";
21
+ /**
22
+ * Block key for encryptedVerifierHashInput (§2.3.4.13).
23
+ * Bytes: fe a7 d2 76 3b 4b 9e 79.
24
+ */
25
+ export declare const BLOCK_KEY_VERIFIER_INPUT: Uint8Array;
26
+ /**
27
+ * Block key for encryptedVerifierHashValue (§2.3.4.13).
28
+ * Bytes: d7 aa 0f 6d 30 61 34 4e.
29
+ */
30
+ export declare const BLOCK_KEY_VERIFIER_HASH: Uint8Array;
31
+ /**
32
+ * Block key for encryptedKeyValue (§2.3.4.13).
33
+ * Bytes: 14 6e 0b e7 ab ac d0 d6.
34
+ */
35
+ export declare const BLOCK_KEY_ENCRYPTOR_KEY: Uint8Array;
36
+ /**
37
+ * Block key for encryptedHmacKey (§2.3.4.14).
38
+ * Bytes: 5f b2 ad 01 0c b9 e1 f6.
39
+ */
40
+ export declare const BLOCK_KEY_HMAC_KEY: Uint8Array;
41
+ /**
42
+ * Block key for encryptedHmacValue (§2.3.4.14).
43
+ * Bytes: a0 67 7f 02 b2 2c 84 33.
44
+ */
45
+ export declare const BLOCK_KEY_HMAC_VALUE: Uint8Array;
46
+ /** EncryptedPackage segment size in bytes (§2.3.4.15). */
47
+ export declare const ENCRYPTED_PACKAGE_SEGMENT_SIZE = 4096;
48
+ /** CFB root stream names for OFFCRYPTO (§2.3.4.4, §2.3.4.10). */
49
+ export declare const STREAM_ENCRYPTION_INFO = "EncryptionInfo";
50
+ export declare const STREAM_ENCRYPTED_PACKAGE = "EncryptedPackage";
51
+ /** Maximum spinCount from ST_SpinCount (§2.3.4.10). */
52
+ export declare const MAX_SPIN_COUNT = 10000000;
53
+ /**
54
+ * Standard Encryption EncryptionVersionInfo minor version (§2.3.4.5).
55
+ * Major is 2, 3, or 4 with minor 0x0002 — explicitly unsupported in Phase 6.
56
+ */
57
+ export declare const STANDARD_ENCRYPTION_VERSION_MINOR = 2;
58
+ /** Key padding byte when Hfinal is shorter than keyBits/8 (§2.3.4.11). */
59
+ export declare const KEY_PAD_BYTE = 54;
60
+ /** IV padding byte when IV is shorter than blockSize (§2.3.4.12). */
61
+ export declare const IV_PAD_BYTE = 54;
@@ -0,0 +1,71 @@
1
+ /*
2
+ * Agile OFFCRYPTO constants cited from local [MS-OFFCRYPTO].
3
+ *
4
+ * @remarks
5
+ * Never invent algorithm URIs, element names, or block keys. All values below
6
+ * are taken from `specs/microsoft/[MS-OFFCRYPTO].md` §2.3.4.10–§2.3.4.15.
7
+ * Re-exported from the encryption public surface for fixture / host harness use.
8
+ *
9
+ * @packageDocumentation
10
+ */
11
+ /**
12
+ * EncryptionVersionInfo major for Agile: `0x0004` ([MS-OFFCRYPTO] §2.3.4.10).
13
+ *
14
+ * @public
15
+ */
16
+ export var AGILE_VERSION_MAJOR = 0x0004;
17
+ /**
18
+ * EncryptionVersionInfo minor for Agile: `0x0004` ([MS-OFFCRYPTO] §2.3.4.10).
19
+ *
20
+ * @public
21
+ */
22
+ export var AGILE_VERSION_MINOR = 0x0004;
23
+ /** Reserved field after version MUST be 0x00000040 (§2.3.4.10). */
24
+ export var AGILE_RESERVED = 0x00000040;
25
+ /** EncryptionInfo XML target namespace (§2.3.4.10). */
26
+ export var AGILE_ENCRYPTION_NS = 'http://schemas.microsoft.com/office/2006/encryption';
27
+ /** PasswordKeyEncryptor URI on keyEncryptor (§2.3.4.10). */
28
+ export var PASSWORD_KEY_ENCRYPTOR_URI = 'http://schemas.microsoft.com/office/2006/keyEncryptor/password';
29
+ /** PasswordKeyEncryptor element namespace (§2.3.4.10). */
30
+ export var PASSWORD_KEY_ENCRYPTOR_NS = 'http://schemas.microsoft.com/office/2006/keyEncryptor/password';
31
+ /**
32
+ * Block key for encryptedVerifierHashInput (§2.3.4.13).
33
+ * Bytes: fe a7 d2 76 3b 4b 9e 79.
34
+ */
35
+ export var BLOCK_KEY_VERIFIER_INPUT = Uint8Array.of(0xfe, 0xa7, 0xd2, 0x76, 0x3b, 0x4b, 0x9e, 0x79);
36
+ /**
37
+ * Block key for encryptedVerifierHashValue (§2.3.4.13).
38
+ * Bytes: d7 aa 0f 6d 30 61 34 4e.
39
+ */
40
+ export var BLOCK_KEY_VERIFIER_HASH = Uint8Array.of(0xd7, 0xaa, 0x0f, 0x6d, 0x30, 0x61, 0x34, 0x4e);
41
+ /**
42
+ * Block key for encryptedKeyValue (§2.3.4.13).
43
+ * Bytes: 14 6e 0b e7 ab ac d0 d6.
44
+ */
45
+ export var BLOCK_KEY_ENCRYPTOR_KEY = Uint8Array.of(0x14, 0x6e, 0x0b, 0xe7, 0xab, 0xac, 0xd0, 0xd6);
46
+ /**
47
+ * Block key for encryptedHmacKey (§2.3.4.14).
48
+ * Bytes: 5f b2 ad 01 0c b9 e1 f6.
49
+ */
50
+ export var BLOCK_KEY_HMAC_KEY = Uint8Array.of(0x5f, 0xb2, 0xad, 0x01, 0x0c, 0xb9, 0xe1, 0xf6);
51
+ /**
52
+ * Block key for encryptedHmacValue (§2.3.4.14).
53
+ * Bytes: a0 67 7f 02 b2 2c 84 33.
54
+ */
55
+ export var BLOCK_KEY_HMAC_VALUE = Uint8Array.of(0xa0, 0x67, 0x7f, 0x02, 0xb2, 0x2c, 0x84, 0x33);
56
+ /** EncryptedPackage segment size in bytes (§2.3.4.15). */
57
+ export var ENCRYPTED_PACKAGE_SEGMENT_SIZE = 4096;
58
+ /** CFB root stream names for OFFCRYPTO (§2.3.4.4, §2.3.4.10). */
59
+ export var STREAM_ENCRYPTION_INFO = 'EncryptionInfo';
60
+ export var STREAM_ENCRYPTED_PACKAGE = 'EncryptedPackage';
61
+ /** Maximum spinCount from ST_SpinCount (§2.3.4.10). */
62
+ export var MAX_SPIN_COUNT = 10000000;
63
+ /**
64
+ * Standard Encryption EncryptionVersionInfo minor version (§2.3.4.5).
65
+ * Major is 2, 3, or 4 with minor 0x0002 — explicitly unsupported in Phase 6.
66
+ */
67
+ export var STANDARD_ENCRYPTION_VERSION_MINOR = 0x0002;
68
+ /** Key padding byte when Hfinal is shorter than keyBits/8 (§2.3.4.11). */
69
+ export var KEY_PAD_BYTE = 0x36;
70
+ /** IV padding byte when IV is shorter than blockSize (§2.3.4.12). */
71
+ export var IV_PAD_BYTE = 0x36;
@@ -0,0 +1,46 @@
1
+ import { AgileHashName } from './crypto-primitives';
2
+ import { DecryptSecurityLimits } from './errors';
3
+ /** Parsed KeyData from encryption XML. */
4
+ export interface AgileKeyData {
5
+ readonly saltSize: number;
6
+ readonly blockSize: number;
7
+ readonly keyBits: number;
8
+ readonly hashSize: number;
9
+ readonly cipherAlgorithm: string;
10
+ readonly cipherChaining: string;
11
+ readonly hashAlgorithm: AgileHashName;
12
+ readonly saltValue: Uint8Array;
13
+ }
14
+ /** Parsed DataIntegrity (optional but expected on modern packages). */
15
+ export interface AgileDataIntegrity {
16
+ readonly encryptedHmacKey: Uint8Array;
17
+ readonly encryptedHmacValue: Uint8Array;
18
+ }
19
+ /** Password key encryptor (p:encryptedKey attributes). */
20
+ export interface AgilePasswordKeyEncryptor {
21
+ readonly spinCount: number;
22
+ readonly saltSize: number;
23
+ readonly blockSize: number;
24
+ readonly keyBits: number;
25
+ readonly hashSize: number;
26
+ readonly cipherAlgorithm: string;
27
+ readonly cipherChaining: string;
28
+ readonly hashAlgorithm: AgileHashName;
29
+ readonly saltValue: Uint8Array;
30
+ readonly encryptedVerifierHashInput: Uint8Array;
31
+ readonly encryptedVerifierHashValue: Uint8Array;
32
+ readonly encryptedKeyValue: Uint8Array;
33
+ }
34
+ /** Full Agile EncryptionInfo model used by decrypt. */
35
+ export interface AgileEncryptionInfo {
36
+ readonly keyData: AgileKeyData;
37
+ readonly dataIntegrity: AgileDataIntegrity | undefined;
38
+ readonly passwordKeyEncryptor: AgilePasswordKeyEncryptor;
39
+ }
40
+ /**
41
+ * Parses EncryptionInfo stream bytes into an Agile model.
42
+ *
43
+ * @throws {UnsupportedEncryptionError} Standard Encryption or unknown version/alg.
44
+ * @throws {EncryptedPackageError} Truncated or missing required Agile fields.
45
+ */
46
+ export declare function parseAgileEncryptionInfo(encryptionInfo: Uint8Array, limits: DecryptSecurityLimits): AgileEncryptionInfo;