@pptx-studio/writer 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/index.d.ts +22 -22
- package/dist/index.d.ts.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @pptx-studio/writer
|
|
2
2
|
|
|
3
|
+
## 0.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b58dd19: Built with tsdown 0.23. The declarations take a new shape, and the API is unchanged.
|
|
8
|
+
|
|
9
|
+
- Every value is exported where it is declared (`export declare function …`), not in a trailing
|
|
10
|
+
`export { … }`.
|
|
11
|
+
- The types are exported in one `export type { … }`.
|
|
12
|
+
- The JavaScript is byte-for-byte what 0.22 emitted.
|
|
13
|
+
- In geometry, opc, validate and xml, the source maps name fewer symbols.
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [b58dd19]
|
|
16
|
+
- @pptx-studio/opc@0.1.3
|
|
17
|
+
- @pptx-studio/xml@0.1.2
|
|
18
|
+
- @pptx-studio/validate@0.2.1
|
|
19
|
+
|
|
3
20
|
## 0.1.2
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ import { XmlParseLimits } from "@pptx-studio/xml";
|
|
|
16
16
|
* garbage collection that could not be shown to be safe, and the one assertion
|
|
17
17
|
* the writer makes on its own output.
|
|
18
18
|
*/
|
|
19
|
-
declare const WRITER_ERROR_CODES: readonly ["ERR_PREPARE_FAILED", "ERR_COLLECTION_UNSAFE", "ERR_PRESERVATION_BROKEN"];
|
|
19
|
+
export declare const WRITER_ERROR_CODES: readonly ["ERR_PREPARE_FAILED", "ERR_COLLECTION_UNSAFE", "ERR_PRESERVATION_BROKEN"];
|
|
20
20
|
type WriterErrorCode = (typeof WRITER_ERROR_CODES)[number];
|
|
21
21
|
interface WriterErrorDetail {
|
|
22
22
|
/** The prepare hook that threw, for `ERR_PREPARE_FAILED`. */
|
|
@@ -26,7 +26,7 @@ interface WriterErrorDetail {
|
|
|
26
26
|
/** Relationship parts that would not parse, for `ERR_COLLECTION_UNSAFE`. */
|
|
27
27
|
readonly blockedBy?: readonly string[];
|
|
28
28
|
}
|
|
29
|
-
declare class WriterError extends Error {
|
|
29
|
+
export declare class WriterError extends Error {
|
|
30
30
|
readonly name = "WriterError";
|
|
31
31
|
readonly code: WriterErrorCode;
|
|
32
32
|
readonly detail: WriterErrorDetail;
|
|
@@ -34,7 +34,7 @@ declare class WriterError extends Error {
|
|
|
34
34
|
cause?: unknown;
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
|
-
declare function isWriterError(value: unknown): value is WriterError;
|
|
37
|
+
export declare function isWriterError(value: unknown): value is WriterError;
|
|
38
38
|
//#endregion
|
|
39
39
|
//#region src/gc/reachability.d.ts
|
|
40
40
|
/**
|
|
@@ -76,14 +76,14 @@ interface Reachability {
|
|
|
76
76
|
readonly blockedBy: readonly string[];
|
|
77
77
|
}
|
|
78
78
|
/** Every part reachable by following relationships from the package root. */
|
|
79
|
-
declare function reachableParts(store: PartStore): Reachability;
|
|
79
|
+
export declare function reachableParts(store: PartStore): Reachability;
|
|
80
80
|
/**
|
|
81
81
|
* Parts nothing in the package can get to.
|
|
82
82
|
*
|
|
83
83
|
* Relationship parts are excluded by construction rather than by filter - see
|
|
84
84
|
* the header. `[Content_Types].xml` never appears because it is not a part.
|
|
85
85
|
*/
|
|
86
|
-
declare function orphanedParts(store: PartStore, walk: Reachability): string[];
|
|
86
|
+
export declare function orphanedParts(store: PartStore, walk: Reachability): string[];
|
|
87
87
|
//#endregion
|
|
88
88
|
//#region src/gc/collect.d.ts
|
|
89
89
|
/**
|
|
@@ -150,7 +150,7 @@ type CollectionPolicy =
|
|
|
150
150
|
/** Collect nothing. */
|
|
151
151
|
'none';
|
|
152
152
|
/** `/ppt/media/...` - the default sweep set. */
|
|
153
|
-
declare function isMediaPart(partName: string): boolean;
|
|
153
|
+
export declare function isMediaPart(partName: string): boolean;
|
|
154
154
|
interface CollectOptions {
|
|
155
155
|
/** The package about to be written. */
|
|
156
156
|
readonly store: PartStore;
|
|
@@ -203,7 +203,7 @@ interface CollectionPlan {
|
|
|
203
203
|
* arrived that way. `collectGarbage` is the variant that refuses, for callers
|
|
204
204
|
* who asked for a sweep and would misread silence as "nothing to do".
|
|
205
205
|
*/
|
|
206
|
-
declare function planCollection(options: CollectOptions): CollectionPlan;
|
|
206
|
+
export declare function planCollection(options: CollectOptions): CollectionPlan;
|
|
207
207
|
/**
|
|
208
208
|
* Collect, and refuse rather than guess.
|
|
209
209
|
*
|
|
@@ -216,7 +216,7 @@ declare function planCollection(options: CollectOptions): CollectionPlan;
|
|
|
216
216
|
* some unrelated `.rels` will not parse would be refusing to save a file over a
|
|
217
217
|
* defect it did not cause and cannot fix.
|
|
218
218
|
*/
|
|
219
|
-
declare function collectGarbage(options: CollectOptions): CollectionPlan;
|
|
219
|
+
export declare function collectGarbage(options: CollectOptions): CollectionPlan;
|
|
220
220
|
//#endregion
|
|
221
221
|
//#region src/export/prepare.d.ts
|
|
222
222
|
/**
|
|
@@ -295,7 +295,7 @@ interface PrepareRecord {
|
|
|
295
295
|
* PowerPoint reports as a problem with the content and no way to find out
|
|
296
296
|
* which.
|
|
297
297
|
*/
|
|
298
|
-
declare function runPrepare(hooks: readonly PrepareHook[], store: PartStore, baseline: PartStore | null): PrepareRecord[];
|
|
298
|
+
export declare function runPrepare(hooks: readonly PrepareHook[], store: PartStore, baseline: PartStore | null): PrepareRecord[];
|
|
299
299
|
//#endregion
|
|
300
300
|
//#region src/export/preserve.d.ts
|
|
301
301
|
/**
|
|
@@ -342,7 +342,7 @@ interface PreservationCheck {
|
|
|
342
342
|
* whole category of failure this package is built to make impossible, and every
|
|
343
343
|
* later one is likely the same cause.
|
|
344
344
|
*/
|
|
345
|
-
declare function assertPreserved(output: Uint8Array, original: Uint8Array | undefined, rewritten: ReadonlySet<string>, zip?: ReadZipOptions): PreservationCheck;
|
|
345
|
+
export declare function assertPreserved(output: Uint8Array, original: Uint8Array | undefined, rewritten: ReadonlySet<string>, zip?: ReadZipOptions): PreservationCheck;
|
|
346
346
|
//#endregion
|
|
347
347
|
//#region src/export/export.d.ts
|
|
348
348
|
/**
|
|
@@ -440,8 +440,8 @@ interface OpenPackage {
|
|
|
440
440
|
readonly baselineBytes: Uint8Array;
|
|
441
441
|
}
|
|
442
442
|
/** Open a package for editing, with the baseline an export will need. */
|
|
443
|
-
declare function openPackage(bytes: Uint8Array, options?: ReadZipOptions): OpenPackage;
|
|
444
|
-
declare function exportPackage(options: ExportOptions): ExportResult;
|
|
443
|
+
export declare function openPackage(bytes: Uint8Array, options?: ReadZipOptions): OpenPackage;
|
|
444
|
+
export declare function exportPackage(options: ExportOptions): ExportResult;
|
|
445
445
|
//#endregion
|
|
446
446
|
//#region src/oracle/bisect.d.ts
|
|
447
447
|
/**
|
|
@@ -563,9 +563,9 @@ interface Change {
|
|
|
563
563
|
readonly children: readonly Change[];
|
|
564
564
|
}
|
|
565
565
|
/** Every change in the forest, parents before children. */
|
|
566
|
-
declare function flattenChanges(changes: readonly Change[]): Change[];
|
|
566
|
+
export declare function flattenChanges(changes: readonly Change[]): Change[];
|
|
567
567
|
/** The leaves: the finest changes this delta can express. */
|
|
568
|
-
declare function leafChanges(changes: readonly Change[]): Change[];
|
|
568
|
+
export declare function leafChanges(changes: readonly Change[]): Change[];
|
|
569
569
|
/**
|
|
570
570
|
* What the oracle says about one candidate package.
|
|
571
571
|
*
|
|
@@ -646,16 +646,16 @@ interface BisectResult {
|
|
|
646
646
|
readonly truncated: boolean;
|
|
647
647
|
}
|
|
648
648
|
/** The forest of changes between two packages. One root per differing entry. */
|
|
649
|
-
declare function collectDelta(original: ZipArchive, broken: ZipArchive, maxChanges?: number): {
|
|
649
|
+
export declare function collectDelta(original: ZipArchive, broken: ZipArchive, maxChanges?: number): {
|
|
650
650
|
changes: Change[];
|
|
651
651
|
text: Map<string, string>;
|
|
652
652
|
truncated: boolean;
|
|
653
653
|
};
|
|
654
|
-
declare function bisectPackages(originalBytes: Uint8Array, brokenBytes: Uint8Array, options: BisectOptions): BisectResult;
|
|
654
|
+
export declare function bisectPackages(originalBytes: Uint8Array, brokenBytes: Uint8Array, options: BisectOptions): BisectResult;
|
|
655
655
|
/** One line naming a change, without its text. */
|
|
656
|
-
declare function describeChange(change: Change): string;
|
|
656
|
+
export declare function describeChange(change: Change): string;
|
|
657
657
|
/** `2 change(s) in 1 entry(s), from a delta of 91, in 37 oracle run(s)`. */
|
|
658
|
-
declare function summarizeBisect(result: BisectResult): string;
|
|
658
|
+
export declare function summarizeBisect(result: BisectResult): string;
|
|
659
659
|
//#endregion
|
|
660
660
|
//#region src/oracle/roundtrip.d.ts
|
|
661
661
|
/**
|
|
@@ -787,9 +787,9 @@ interface CompareOptions {
|
|
|
787
787
|
* not read - is a difference with a reason, because the caller of a comparison
|
|
788
788
|
* wants the whole list and not the first item on it.
|
|
789
789
|
*/
|
|
790
|
-
declare function comparePackages(original: PartStore, written: PartStore, options?: CompareOptions): RoundTripReport;
|
|
790
|
+
export declare function comparePackages(original: PartStore, written: PartStore, options?: CompareOptions): RoundTripReport;
|
|
791
791
|
/** A one-line summary, for a CLI and for a test failure message. */
|
|
792
|
-
declare function summarizeRoundTrip(report: RoundTripReport): string;
|
|
792
|
+
export declare function summarizeRoundTrip(report: RoundTripReport): string;
|
|
793
793
|
/**
|
|
794
794
|
* Read a package, write it back, and compare the two.
|
|
795
795
|
*
|
|
@@ -804,7 +804,7 @@ declare function summarizeRoundTrip(report: RoundTripReport): string;
|
|
|
804
804
|
* flattening the two into one verdict would lose the distinction exactly where
|
|
805
805
|
* it matters.
|
|
806
806
|
*/
|
|
807
|
-
declare function roundTripPackage(bytes: Uint8Array, options?: RoundTripOptions): RoundTripResult;
|
|
807
|
+
export declare function roundTripPackage(bytes: Uint8Array, options?: RoundTripOptions): RoundTripResult;
|
|
808
808
|
interface RoundTripOptions extends Omit<ExportOptions, 'store' | 'baseline' | 'baselineBytes'>, CompareOptions {}
|
|
809
809
|
interface RoundTripResult {
|
|
810
810
|
readonly exported: ExportResult;
|
|
@@ -814,5 +814,5 @@ interface RoundTripResult {
|
|
|
814
814
|
readonly ok: boolean;
|
|
815
815
|
}
|
|
816
816
|
//#endregion
|
|
817
|
-
export {
|
|
817
|
+
export type { BisectOptions, BisectOutcome, BisectResult, Change, ChangeKind, CollectOptions, CollectionPlan, CollectionPolicy, CompareHow, CompareOptions, Difference, DifferenceKind, ExportOptions, ExportResult, KeptPart, OpenPackage, Oracle, PartComparison, PrepareContext, PrepareHook, PrepareRecord, PreservationCheck, Reachability, Relabelling, RoundTripOptions, RoundTripReport, RoundTripResult, RunEvent, Span, Verdict, WriterErrorCode, WriterErrorDetail };
|
|
818
818
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/errors.ts","../src/gc/reachability.ts","../src/gc/collect.ts","../src/export/prepare.ts","../src/export/preserve.ts","../src/export/export.ts","../src/oracle/bisect.ts","../src/oracle/roundtrip.ts"],"mappings":";;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/errors.ts","../src/gc/reachability.ts","../src/gc/collect.ts","../src/export/prepare.ts","../src/export/preserve.ts","../src/export/export.ts","../src/oracle/bisect.ts","../src/oracle/roundtrip.ts"],"mappings":";;;;;;;;;;;;;;;;;;qBAea;KAmBD,0BAA0B;UAErB;;WAEN;;WAEA;;WAEA;;qBAGE,oBAAoB;WACb;WACT,MAAM;WACN,QAAQ;EAGf,YAAA,MAAM,iBACN,iBACA,SAAQ,mBACR;IAAW;;;wBAQC,cAAc,iBAAiB,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;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WACT,YAAY;WACZ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pptx-studio/writer",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Export a .pptx: dirty-part-only serialization, media GC, prepare hooks, the repair firewall",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -40,14 +40,14 @@
|
|
|
40
40
|
"./package.json": "./package.json"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@pptx-studio/opc": "^0.1.
|
|
44
|
-
"@pptx-studio/validate": "^0.2.
|
|
45
|
-
"@pptx-studio/xml": "^0.1.
|
|
43
|
+
"@pptx-studio/opc": "^0.1.3",
|
|
44
|
+
"@pptx-studio/validate": "^0.2.1",
|
|
45
|
+
"@pptx-studio/xml": "^0.1.2"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@arethetypeswrong/cli": "0.18.5",
|
|
49
49
|
"publint": "0.3.24",
|
|
50
|
-
"tsdown": "0.
|
|
50
|
+
"tsdown": "0.23.0",
|
|
51
51
|
"typescript": "6.0.3"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|