ppt-codec 1.5.0 → 1.7.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.
- package/README.md +91 -75
- package/dist/base64.cjs +48 -0
- package/dist/base64.d.cts +5 -0
- package/dist/base64.d.ts +5 -0
- package/dist/base64.js +46 -0
- package/dist/diagnostics-CqxAnubw.d.cts +16 -0
- package/dist/diagnostics-CqxAnubw.d.ts +16 -0
- package/dist/diagnostics.cjs +11 -0
- package/dist/diagnostics.d.cts +2 -0
- package/dist/diagnostics.d.ts +2 -0
- package/dist/diagnostics.js +9 -0
- package/dist/document/color-scheme.cjs +4 -0
- package/dist/document/color-scheme.d.cts +2 -1
- package/dist/document/color-scheme.d.ts +2 -1
- package/dist/document/color-scheme.js +4 -1
- package/dist/document/master-write.cjs +21 -16
- package/dist/document/master-write.d.cts +2 -1
- package/dist/document/master-write.d.ts +2 -1
- package/dist/document/master-write.js +21 -16
- package/dist/document/notes-write.cjs +15 -7
- package/dist/document/notes-write.d.cts +2 -1
- package/dist/document/notes-write.d.ts +2 -1
- package/dist/document/notes-write.js +15 -7
- package/dist/document/notes.cjs +4 -3
- package/dist/document/notes.js +4 -3
- package/dist/drawing/blips.cjs +81 -0
- package/dist/drawing/blips.d.cts +16 -0
- package/dist/drawing/blips.d.ts +16 -0
- package/dist/drawing/blips.js +77 -0
- package/dist/drawing/properties.cjs +102 -0
- package/dist/drawing/properties.d.cts +29 -0
- package/dist/drawing/properties.d.ts +29 -0
- package/dist/drawing/properties.js +87 -0
- package/dist/drawing/shapes-write.cjs +234 -17
- package/dist/drawing/shapes-write.d.cts +16 -4
- package/dist/drawing/shapes-write.d.ts +16 -4
- package/dist/drawing/shapes-write.js +237 -19
- package/dist/drawing/shapes.cjs +34 -4
- package/dist/drawing/shapes.d.cts +11 -2
- package/dist/drawing/shapes.d.ts +11 -2
- package/dist/drawing/shapes.js +35 -5
- package/dist/index.cjs +48 -3
- package/dist/index.d.cts +12 -8
- package/dist/index.d.ts +12 -8
- package/dist/index.js +11 -7
- package/dist/ole/embedded-write.cjs +66 -0
- package/dist/ole/embedded-write.d.cts +12 -0
- package/dist/ole/embedded-write.d.ts +12 -0
- package/dist/ole/embedded-write.js +63 -0
- package/dist/ole/embedded.cjs +66 -0
- package/dist/ole/embedded.d.cts +12 -0
- package/dist/ole/embedded.d.ts +12 -0
- package/dist/ole/embedded.js +63 -0
- package/dist/read.cjs +145 -22
- package/dist/read.d.cts +13 -5
- package/dist/read.d.ts +13 -5
- package/dist/read.js +148 -26
- package/dist/record/types.cjs +28 -0
- package/dist/record/types.d.cts +15 -1
- package/dist/record/types.d.ts +15 -1
- package/dist/record/types.js +15 -1
- package/dist/stream/current-user.cjs +1 -0
- package/dist/stream/current-user.d.cts +2 -1
- package/dist/stream/current-user.d.ts +2 -1
- package/dist/stream/current-user.js +1 -1
- package/dist/units.cjs +10 -0
- package/dist/units.d.cts +4 -1
- package/dist/units.d.ts +4 -1
- package/dist/units.js +8 -1
- package/dist/write.cjs +137 -38
- package/dist/write.d.cts +14 -5
- package/dist/write.d.ts +14 -5
- package/dist/write.js +137 -38
- package/package.json +2 -1
|
@@ -4,5 +4,6 @@ import { RgbColor } from "../text/style.js";
|
|
|
4
4
|
declare function readSlideSchemeColorSchemeAtom(record: PptRecord): readonly RgbColor[];
|
|
5
5
|
/** Resolves a scheme-slot index (0-7, see text/style.ts's own ColorIndexStruct table) against a resolved 8-entry colour scheme. Throws rather than returning undefined for an out-of-range index: readColorIndexStruct already rejects any index outside 0x00-0x07/0xFE/0xFF at parse time, so a RunColor of kind "scheme" reaching this function always carries a genuinely valid slot. */
|
|
6
6
|
declare function resolveSchemeColor(schemeIndex: number, colorScheme: readonly RgbColor[]): RgbColor;
|
|
7
|
+
declare function findSlideSchemeColorSchemeAtom(records: readonly PptRecord[]): PptRecord | undefined;
|
|
7
8
|
//#endregion
|
|
8
|
-
export { readSlideSchemeColorSchemeAtom, resolveSchemeColor };
|
|
9
|
+
export { findSlideSchemeColorSchemeAtom, readSlideSchemeColorSchemeAtom, resolveSchemeColor };
|
|
@@ -31,5 +31,8 @@ function resolveSchemeColor(schemeIndex, colorScheme) {
|
|
|
31
31
|
if (color === void 0) throw new PptFormatError(`colour scheme slot ${schemeIndex} has no entry in a ${colorScheme.length}-entry colour scheme`);
|
|
32
32
|
return color;
|
|
33
33
|
}
|
|
34
|
+
function findSlideSchemeColorSchemeAtom(records) {
|
|
35
|
+
return records.find((record) => record.header.recType === 2032 && record.header.recInstance === SLIDE_SCHEME_REC_INSTANCE);
|
|
36
|
+
}
|
|
34
37
|
//#endregion
|
|
35
|
-
export { readSlideSchemeColorSchemeAtom, resolveSchemeColor };
|
|
38
|
+
export { findSlideSchemeColorSchemeAtom, readSlideSchemeColorSchemeAtom, resolveSchemeColor };
|
|
@@ -3,8 +3,8 @@ const require_record_types = require("../record/types.cjs");
|
|
|
3
3
|
require("../text/atoms.cjs");
|
|
4
4
|
const require_record_write = require("../record/write.cjs");
|
|
5
5
|
const require_document_color_scheme_write = require("./color-scheme-write.cjs");
|
|
6
|
-
const require_drawing_shapes_write = require("../drawing/shapes-write.cjs");
|
|
7
6
|
const require_read = require("../read.cjs");
|
|
7
|
+
const require_drawing_shapes_write = require("../drawing/shapes-write.cjs");
|
|
8
8
|
//#region src/document/master-write.ts
|
|
9
9
|
const SL_TITLE_BODY = 1;
|
|
10
10
|
const SL_BLANK = 16;
|
|
@@ -86,7 +86,7 @@ function writeSlideAtomForSlide(notesIdRef) {
|
|
|
86
86
|
function writeTextMasterStyleAtom(textType) {
|
|
87
87
|
return require_record_write.writeAtom(require_record_types.RT_TextMasterStyleAtom, require_record_write.u16le(0), { recInstance: textType });
|
|
88
88
|
}
|
|
89
|
-
function writeMainMaster(size,
|
|
89
|
+
function writeMainMaster(size, context) {
|
|
90
90
|
const placeholders = MASTER_PLACEHOLDER_TYPES.map((placementId, index) => {
|
|
91
91
|
const frame = placeholderFrames(size)[index];
|
|
92
92
|
if (frame === void 0) throw new Error("internal error: the main master states more placeholder types than it has rectangles for");
|
|
@@ -102,20 +102,25 @@ function writeMainMaster(size, fontIndexOf) {
|
|
|
102
102
|
clientData: placeholderClientData(index, placementId)
|
|
103
103
|
};
|
|
104
104
|
});
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
105
|
+
const drawing = require_drawing_shapes_write.writeSlideDrawing(placeholders, context);
|
|
106
|
+
return {
|
|
107
|
+
bytes: require_record_write.writeContainer(require_record_types.RT_MainMaster, [
|
|
108
|
+
writeSlideAtom({
|
|
109
|
+
geom: SL_TITLE_BODY,
|
|
110
|
+
placeholderTypes: MASTER_PLACEHOLDER_TYPES,
|
|
111
|
+
masterIdRef: 0,
|
|
112
|
+
notesIdRef: 0,
|
|
113
|
+
slideFlags: 0
|
|
114
|
+
}),
|
|
115
|
+
writeTextMasterStyleAtom(0),
|
|
116
|
+
writeTextMasterStyleAtom(1),
|
|
117
|
+
writeTextMasterStyleAtom(2),
|
|
118
|
+
drawing.bytes,
|
|
119
|
+
require_document_color_scheme_write.writeSlideSchemeColorSchemeAtom()
|
|
120
|
+
]),
|
|
121
|
+
shapeCount: drawing.shapeCount,
|
|
122
|
+
maxSpid: drawing.maxSpid
|
|
123
|
+
};
|
|
119
124
|
}
|
|
120
125
|
function writeMasterListWithText(persistIdRef) {
|
|
121
126
|
return require_record_write.writeContainer(require_record_types.RT_SlideListWithText, [require_record_write.writeAtom(require_record_types.RT_SlidePersistAtom, require_record_write.concatBytes(require_record_write.u32le(persistIdRef), require_record_write.u32le(0), require_record_write.i32le(0), require_record_write.u32le(MASTER_SLIDE_ID), require_record_write.u32le(0)))], { recInstance: 1 });
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DrawingWriteContext, DrawingWritten } from "../drawing/shapes-write.cjs";
|
|
1
2
|
import { PageSize } from "document-schema.js";
|
|
2
3
|
//#region src/document/master-write.d.ts
|
|
3
4
|
declare const MASTER_SLIDE_ID = 2147483648;
|
|
@@ -9,7 +10,7 @@ declare function writeSlideAtom(options: {
|
|
|
9
10
|
readonly slideFlags: number;
|
|
10
11
|
}): Uint8Array<ArrayBuffer>;
|
|
11
12
|
declare function writeSlideAtomForSlide(notesIdRef: number): Uint8Array<ArrayBuffer>;
|
|
12
|
-
declare function writeMainMaster(size: PageSize,
|
|
13
|
+
declare function writeMainMaster(size: PageSize, context: DrawingWriteContext): DrawingWritten;
|
|
13
14
|
declare function writeMasterListWithText(persistIdRef: number): Uint8Array<ArrayBuffer>;
|
|
14
15
|
//#endregion
|
|
15
16
|
export { MASTER_SLIDE_ID, writeMainMaster, writeMasterListWithText, writeSlideAtom, writeSlideAtomForSlide };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DrawingWriteContext, DrawingWritten } from "../drawing/shapes-write.js";
|
|
1
2
|
import { PageSize } from "document-schema.js";
|
|
2
3
|
//#region src/document/master-write.d.ts
|
|
3
4
|
declare const MASTER_SLIDE_ID = 2147483648;
|
|
@@ -9,7 +10,7 @@ declare function writeSlideAtom(options: {
|
|
|
9
10
|
readonly slideFlags: number;
|
|
10
11
|
}): Uint8Array<ArrayBuffer>;
|
|
11
12
|
declare function writeSlideAtomForSlide(notesIdRef: number): Uint8Array<ArrayBuffer>;
|
|
12
|
-
declare function writeMainMaster(size: PageSize,
|
|
13
|
+
declare function writeMainMaster(size: PageSize, context: DrawingWriteContext): DrawingWritten;
|
|
13
14
|
declare function writeMasterListWithText(persistIdRef: number): Uint8Array<ArrayBuffer>;
|
|
14
15
|
//#endregion
|
|
15
16
|
export { MASTER_SLIDE_ID, writeMainMaster, writeMasterListWithText, writeSlideAtom, writeSlideAtomForSlide };
|
|
@@ -2,8 +2,8 @@ import { OfficeArtClientData, RT_MainMaster, RT_PlaceholderAtom, RT_SlideAtom, R
|
|
|
2
2
|
import "../text/atoms.js";
|
|
3
3
|
import { concatBytes, i32le, u16le, u32le, u8, writeAtom, writeContainer } from "../record/write.js";
|
|
4
4
|
import { writeSlideSchemeColorSchemeAtom } from "./color-scheme-write.js";
|
|
5
|
-
import { writeDrawingWithClientData } from "../drawing/shapes-write.js";
|
|
6
5
|
import { DEFAULT_INSET_LEFT_RIGHT_PT, DEFAULT_INSET_TOP_BOTTOM_PT } from "../read.js";
|
|
6
|
+
import { writeSlideDrawing } from "../drawing/shapes-write.js";
|
|
7
7
|
//#region src/document/master-write.ts
|
|
8
8
|
const SL_TITLE_BODY = 1;
|
|
9
9
|
const SL_BLANK = 16;
|
|
@@ -85,7 +85,7 @@ function writeSlideAtomForSlide(notesIdRef) {
|
|
|
85
85
|
function writeTextMasterStyleAtom(textType) {
|
|
86
86
|
return writeAtom(RT_TextMasterStyleAtom, u16le(0), { recInstance: textType });
|
|
87
87
|
}
|
|
88
|
-
function writeMainMaster(size,
|
|
88
|
+
function writeMainMaster(size, context) {
|
|
89
89
|
const placeholders = MASTER_PLACEHOLDER_TYPES.map((placementId, index) => {
|
|
90
90
|
const frame = placeholderFrames(size)[index];
|
|
91
91
|
if (frame === void 0) throw new Error("internal error: the main master states more placeholder types than it has rectangles for");
|
|
@@ -101,20 +101,25 @@ function writeMainMaster(size, fontIndexOf) {
|
|
|
101
101
|
clientData: placeholderClientData(index, placementId)
|
|
102
102
|
};
|
|
103
103
|
});
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
104
|
+
const drawing = writeSlideDrawing(placeholders, context);
|
|
105
|
+
return {
|
|
106
|
+
bytes: writeContainer(RT_MainMaster, [
|
|
107
|
+
writeSlideAtom({
|
|
108
|
+
geom: SL_TITLE_BODY,
|
|
109
|
+
placeholderTypes: MASTER_PLACEHOLDER_TYPES,
|
|
110
|
+
masterIdRef: 0,
|
|
111
|
+
notesIdRef: 0,
|
|
112
|
+
slideFlags: 0
|
|
113
|
+
}),
|
|
114
|
+
writeTextMasterStyleAtom(0),
|
|
115
|
+
writeTextMasterStyleAtom(1),
|
|
116
|
+
writeTextMasterStyleAtom(2),
|
|
117
|
+
drawing.bytes,
|
|
118
|
+
writeSlideSchemeColorSchemeAtom()
|
|
119
|
+
]),
|
|
120
|
+
shapeCount: drawing.shapeCount,
|
|
121
|
+
maxSpid: drawing.maxSpid
|
|
122
|
+
};
|
|
118
123
|
}
|
|
119
124
|
function writeMasterListWithText(persistIdRef) {
|
|
120
125
|
return writeContainer(RT_SlideListWithText, [writeAtom(RT_SlidePersistAtom, concatBytes(u32le(persistIdRef), u32le(0), i32le(0), u32le(MASTER_SLIDE_ID), u32le(0)))], { recInstance: 1 });
|
|
@@ -2,8 +2,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_record_types = require("../record/types.cjs");
|
|
3
3
|
const require_record_write = require("../record/write.cjs");
|
|
4
4
|
const require_document_color_scheme_write = require("./color-scheme-write.cjs");
|
|
5
|
-
const require_drawing_shapes_write = require("../drawing/shapes-write.cjs");
|
|
6
5
|
const require_read = require("../read.cjs");
|
|
6
|
+
const require_drawing_shapes_write = require("../drawing/shapes-write.cjs");
|
|
7
7
|
//#region src/document/notes-write.ts
|
|
8
8
|
const NOTES_BODY_TOP_FRACTION = .5;
|
|
9
9
|
const NOTES_BODY_MARGIN_FRACTION = .05;
|
|
@@ -31,12 +31,20 @@ function notesBodyShape(notes, notesPageSize) {
|
|
|
31
31
|
function writeNotesAtom(slideIdRef) {
|
|
32
32
|
return require_record_write.writeAtom(require_record_types.RT_NotesAtom, require_record_write.concatBytes(require_record_write.u32le(slideIdRef), require_record_write.u16le(0), require_record_write.u16le(0)), { recVer: 1 });
|
|
33
33
|
}
|
|
34
|
-
function writeNotesContainer(slideIdRef, notes, notesPageSize,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
function writeNotesContainer(slideIdRef, notes, notesPageSize, context) {
|
|
35
|
+
const drawing = require_drawing_shapes_write.writeSlideDrawing([{
|
|
36
|
+
shape: notesBodyShape(notes, notesPageSize),
|
|
37
|
+
clientData: void 0
|
|
38
|
+
}], context);
|
|
39
|
+
return {
|
|
40
|
+
bytes: require_record_write.writeContainer(require_record_types.RT_Notes, [
|
|
41
|
+
writeNotesAtom(slideIdRef),
|
|
42
|
+
drawing.bytes,
|
|
43
|
+
require_document_color_scheme_write.writeSlideSchemeColorSchemeAtom()
|
|
44
|
+
]),
|
|
45
|
+
shapeCount: drawing.shapeCount,
|
|
46
|
+
maxSpid: drawing.maxSpid
|
|
47
|
+
};
|
|
40
48
|
}
|
|
41
49
|
//#endregion
|
|
42
50
|
exports.writeNotesAtom = writeNotesAtom;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { DrawingWriteContext, DrawingWritten } from "../drawing/shapes-write.cjs";
|
|
1
2
|
import { PageSize } from "document-schema.js";
|
|
2
3
|
//#region src/document/notes-write.d.ts
|
|
3
4
|
declare function writeNotesAtom(slideIdRef: number): Uint8Array<ArrayBuffer>;
|
|
4
|
-
declare function writeNotesContainer(slideIdRef: number, notes: string, notesPageSize: PageSize,
|
|
5
|
+
declare function writeNotesContainer(slideIdRef: number, notes: string, notesPageSize: PageSize, context: DrawingWriteContext): DrawingWritten;
|
|
5
6
|
//#endregion
|
|
6
7
|
export { writeNotesAtom, writeNotesContainer };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { DrawingWriteContext, DrawingWritten } from "../drawing/shapes-write.js";
|
|
1
2
|
import { PageSize } from "document-schema.js";
|
|
2
3
|
//#region src/document/notes-write.d.ts
|
|
3
4
|
declare function writeNotesAtom(slideIdRef: number): Uint8Array<ArrayBuffer>;
|
|
4
|
-
declare function writeNotesContainer(slideIdRef: number, notes: string, notesPageSize: PageSize,
|
|
5
|
+
declare function writeNotesContainer(slideIdRef: number, notes: string, notesPageSize: PageSize, context: DrawingWriteContext): DrawingWritten;
|
|
5
6
|
//#endregion
|
|
6
7
|
export { writeNotesAtom, writeNotesContainer };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { RT_Notes, RT_NotesAtom } from "../record/types.js";
|
|
2
2
|
import { concatBytes, u16le, u32le, writeAtom, writeContainer } from "../record/write.js";
|
|
3
3
|
import { writeSlideSchemeColorSchemeAtom } from "./color-scheme-write.js";
|
|
4
|
-
import { writeSlideDrawing } from "../drawing/shapes-write.js";
|
|
5
4
|
import { DEFAULT_INSET_LEFT_RIGHT_PT, DEFAULT_INSET_TOP_BOTTOM_PT } from "../read.js";
|
|
5
|
+
import { writeSlideDrawing } from "../drawing/shapes-write.js";
|
|
6
6
|
//#region src/document/notes-write.ts
|
|
7
7
|
const NOTES_BODY_TOP_FRACTION = .5;
|
|
8
8
|
const NOTES_BODY_MARGIN_FRACTION = .05;
|
|
@@ -30,12 +30,20 @@ function notesBodyShape(notes, notesPageSize) {
|
|
|
30
30
|
function writeNotesAtom(slideIdRef) {
|
|
31
31
|
return writeAtom(RT_NotesAtom, concatBytes(u32le(slideIdRef), u16le(0), u16le(0)), { recVer: 1 });
|
|
32
32
|
}
|
|
33
|
-
function writeNotesContainer(slideIdRef, notes, notesPageSize,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
function writeNotesContainer(slideIdRef, notes, notesPageSize, context) {
|
|
34
|
+
const drawing = writeSlideDrawing([{
|
|
35
|
+
shape: notesBodyShape(notes, notesPageSize),
|
|
36
|
+
clientData: void 0
|
|
37
|
+
}], context);
|
|
38
|
+
return {
|
|
39
|
+
bytes: writeContainer(RT_Notes, [
|
|
40
|
+
writeNotesAtom(slideIdRef),
|
|
41
|
+
drawing.bytes,
|
|
42
|
+
writeSlideSchemeColorSchemeAtom()
|
|
43
|
+
]),
|
|
44
|
+
shapeCount: drawing.shapeCount,
|
|
45
|
+
maxSpid: drawing.maxSpid
|
|
46
|
+
};
|
|
39
47
|
}
|
|
40
48
|
//#endregion
|
|
41
49
|
export { writeNotesAtom, writeNotesContainer };
|
package/dist/document/notes.cjs
CHANGED
|
@@ -26,9 +26,10 @@ function readNotesText(notesContainer) {
|
|
|
26
26
|
const drawing = require_record_tree.findChild(require_record_tree.childRecords(notesContainer), require_record_types.RT_Drawing);
|
|
27
27
|
if (drawing === void 0) return "";
|
|
28
28
|
const bodies = [];
|
|
29
|
-
for (const
|
|
30
|
-
if (
|
|
31
|
-
|
|
29
|
+
for (const entry of require_drawing_shapes.readDrawingShapes(drawing)) {
|
|
30
|
+
if (!("clientTextbox" in entry)) continue;
|
|
31
|
+
if (entry.clientTextbox === void 0) continue;
|
|
32
|
+
const text = require_text_atoms.readTextBody(require_record_tree.childRecords(entry.clientTextbox));
|
|
32
33
|
if (text === void 0 || text.length === 0) continue;
|
|
33
34
|
bodies.push(require_text_atoms.splitParagraphs(text).map((paragraph) => paragraph.text).join("\n"));
|
|
34
35
|
}
|
package/dist/document/notes.js
CHANGED
|
@@ -25,9 +25,10 @@ function readNotesText(notesContainer) {
|
|
|
25
25
|
const drawing = findChild(childRecords(notesContainer), RT_Drawing);
|
|
26
26
|
if (drawing === void 0) return "";
|
|
27
27
|
const bodies = [];
|
|
28
|
-
for (const
|
|
29
|
-
if (
|
|
30
|
-
|
|
28
|
+
for (const entry of readDrawingShapes(drawing)) {
|
|
29
|
+
if (!("clientTextbox" in entry)) continue;
|
|
30
|
+
if (entry.clientTextbox === void 0) continue;
|
|
31
|
+
const text = readTextBody(childRecords(entry.clientTextbox));
|
|
31
32
|
if (text === void 0 || text.length === 0) continue;
|
|
32
33
|
bodies.push(splitParagraphs(text).map((paragraph) => paragraph.text).join("\n"));
|
|
33
34
|
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_errors = require("../errors.cjs");
|
|
3
|
+
const require_record_tree = require("../record/tree.cjs");
|
|
4
|
+
const require_record_types = require("../record/types.cjs");
|
|
5
|
+
const require_record_write = require("../record/write.cjs");
|
|
6
|
+
//#region src/drawing/blips.ts
|
|
7
|
+
const MSOBLIP_JPEG = 5;
|
|
8
|
+
const MSOBLIP_PNG = 6;
|
|
9
|
+
function isBlipFormat(format) {
|
|
10
|
+
return format === "png" || format === "jpeg";
|
|
11
|
+
}
|
|
12
|
+
function blipPayload(record) {
|
|
13
|
+
const format = record.header.recType === 61470 ? "png" : record.header.recType === 61469 ? "jpeg" : void 0;
|
|
14
|
+
if (format === void 0) return;
|
|
15
|
+
const uidCount = (record.header.recInstance & 1) + 1;
|
|
16
|
+
const dataStart = uidCount * 16 + 1;
|
|
17
|
+
if (record.data.length < dataStart) throw new require_errors.PptFormatError(`a blip record of type 0x${record.header.recType.toString(16)} declares ${record.header.recInstance.toString(16)} as its instance (so ${uidCount} digest(s)) but carries only ${record.data.length} bytes`);
|
|
18
|
+
return {
|
|
19
|
+
format,
|
|
20
|
+
bytes: record.data.subarray(dataStart)
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const FBSE_FIXED_SIZE = 36;
|
|
24
|
+
const FO_DELAY_NONE = 4294967295;
|
|
25
|
+
function readStoreEntry(entry, picturesStream) {
|
|
26
|
+
if (entry.header.recType !== 61447) return blipPayload(entry);
|
|
27
|
+
const view = new DataView(entry.data.buffer, entry.data.byteOffset, entry.data.byteLength);
|
|
28
|
+
const cRef = view.getUint32(24, true);
|
|
29
|
+
const foDelay = view.getUint32(28, true);
|
|
30
|
+
const cbName = view.getUint8(35);
|
|
31
|
+
const embeddedAt = entry.dataOffset + FBSE_FIXED_SIZE + cbName;
|
|
32
|
+
if (embeddedAt < entry.dataOffset + entry.header.recLen) return blipPayload(require_record_tree.readRecordAt(entry.stream, embeddedAt));
|
|
33
|
+
if (cRef === 0 || foDelay === FO_DELAY_NONE) return;
|
|
34
|
+
if (picturesStream === void 0) return;
|
|
35
|
+
return blipPayload(require_record_tree.readRecordAt(picturesStream, foDelay));
|
|
36
|
+
}
|
|
37
|
+
function readBlipStore(documentContainer, picturesStream) {
|
|
38
|
+
const drawingGroup = require_record_tree.findChild(require_record_tree.childRecords(documentContainer), require_record_types.RT_DrawingGroup);
|
|
39
|
+
if (drawingGroup === void 0) return [];
|
|
40
|
+
const dgg = require_record_tree.findChild(require_record_tree.childRecords(drawingGroup), require_record_types.OfficeArtDggContainer);
|
|
41
|
+
if (dgg === void 0) return [];
|
|
42
|
+
const bStore = require_record_tree.findChild(require_record_tree.childRecords(dgg), require_record_types.OfficeArtBStoreContainer);
|
|
43
|
+
if (bStore === void 0) return [];
|
|
44
|
+
const blips = [];
|
|
45
|
+
for (const entry of require_record_tree.childRecords(bStore)) {
|
|
46
|
+
const blip = readStoreEntry(entry, picturesStream);
|
|
47
|
+
if (blip !== void 0) blips.push(blip);
|
|
48
|
+
}
|
|
49
|
+
return blips;
|
|
50
|
+
}
|
|
51
|
+
function blipForPib(blips, pib) {
|
|
52
|
+
if (pib <= 0) return;
|
|
53
|
+
return blips[pib - 1];
|
|
54
|
+
}
|
|
55
|
+
const ZERO_DIGEST = /* @__PURE__ */ new Uint8Array(16);
|
|
56
|
+
const TAG_EXTERNAL = 255;
|
|
57
|
+
function writeBlipRecord(blip) {
|
|
58
|
+
const recType = blip.format === "png" ? require_record_types.OfficeArtBlipPNG : require_record_types.OfficeArtBlipJPEG;
|
|
59
|
+
const recInstance = blip.format === "png" ? 1760 : 1130;
|
|
60
|
+
return require_record_write.writeAtom(recType, require_record_write.concatBytes(ZERO_DIGEST, require_record_write.u8(TAG_EXTERNAL), blip.bytes), { recInstance });
|
|
61
|
+
}
|
|
62
|
+
function writeFbse(blip) {
|
|
63
|
+
const embedded = writeBlipRecord(blip);
|
|
64
|
+
const blipType = blip.format === "png" ? MSOBLIP_PNG : MSOBLIP_JPEG;
|
|
65
|
+
return require_record_write.writeAtom(require_record_types.OfficeArtFBSE, require_record_write.concatBytes(require_record_write.u8(blipType), require_record_write.u8(blipType), ZERO_DIGEST, require_record_write.u16le(TAG_EXTERNAL), require_record_write.u32le(embedded.length), require_record_write.u32le(1), require_record_write.u32le(0), require_record_write.u8(0), require_record_write.u8(0), require_record_write.u8(0), require_record_write.u8(0), embedded), {
|
|
66
|
+
recVer: 2,
|
|
67
|
+
recInstance: blipType
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function writeDrawingGroupContainer(blips, counts) {
|
|
71
|
+
const fdgg = require_record_write.concatBytes(require_record_write.u32le(counts.spidMax), require_record_write.u32le(2), require_record_write.u32le(counts.shapeCount), require_record_write.u32le(counts.drawingCount));
|
|
72
|
+
const idcl = require_record_write.concatBytes(require_record_write.u32le(1), require_record_write.u32le(counts.spidMax));
|
|
73
|
+
const dggChildren = [require_record_write.writeAtom(require_record_types.OfficeArtFDGGBlock, require_record_write.concatBytes(fdgg, idcl))];
|
|
74
|
+
if (blips.length > 0) dggChildren.push(require_record_write.writeContainer(require_record_types.OfficeArtBStoreContainer, blips.map(writeFbse), { recInstance: blips.length }));
|
|
75
|
+
return require_record_write.writeContainer(require_record_types.RT_DrawingGroup, [require_record_write.writeContainer(require_record_types.OfficeArtDggContainer, dggChildren)]);
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
exports.blipForPib = blipForPib;
|
|
79
|
+
exports.isBlipFormat = isBlipFormat;
|
|
80
|
+
exports.readBlipStore = readBlipStore;
|
|
81
|
+
exports.writeDrawingGroupContainer = writeDrawingGroupContainer;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { t as PptRecord } from "../tree-Du_LXAF0.cjs";
|
|
2
|
+
//#region src/drawing/blips.d.ts
|
|
3
|
+
interface PptBlip {
|
|
4
|
+
readonly format: "png" | "jpeg";
|
|
5
|
+
readonly bytes: Uint8Array<ArrayBuffer>;
|
|
6
|
+
}
|
|
7
|
+
declare function isBlipFormat(format: string): format is "png" | "jpeg";
|
|
8
|
+
declare function readBlipStore(documentContainer: PptRecord, picturesStream: Uint8Array<ArrayBuffer> | undefined): readonly PptBlip[];
|
|
9
|
+
declare function blipForPib(blips: readonly PptBlip[], pib: number): PptBlip | undefined;
|
|
10
|
+
declare function writeDrawingGroupContainer(blips: readonly PptBlip[], counts: {
|
|
11
|
+
readonly spidMax: number;
|
|
12
|
+
readonly shapeCount: number;
|
|
13
|
+
readonly drawingCount: number;
|
|
14
|
+
}): Uint8Array<ArrayBuffer>;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { PptBlip, blipForPib, isBlipFormat, readBlipStore, writeDrawingGroupContainer };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { t as PptRecord } from "../tree-PMcPNgd-.js";
|
|
2
|
+
//#region src/drawing/blips.d.ts
|
|
3
|
+
interface PptBlip {
|
|
4
|
+
readonly format: "png" | "jpeg";
|
|
5
|
+
readonly bytes: Uint8Array<ArrayBuffer>;
|
|
6
|
+
}
|
|
7
|
+
declare function isBlipFormat(format: string): format is "png" | "jpeg";
|
|
8
|
+
declare function readBlipStore(documentContainer: PptRecord, picturesStream: Uint8Array<ArrayBuffer> | undefined): readonly PptBlip[];
|
|
9
|
+
declare function blipForPib(blips: readonly PptBlip[], pib: number): PptBlip | undefined;
|
|
10
|
+
declare function writeDrawingGroupContainer(blips: readonly PptBlip[], counts: {
|
|
11
|
+
readonly spidMax: number;
|
|
12
|
+
readonly shapeCount: number;
|
|
13
|
+
readonly drawingCount: number;
|
|
14
|
+
}): Uint8Array<ArrayBuffer>;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { PptBlip, blipForPib, isBlipFormat, readBlipStore, writeDrawingGroupContainer };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { PptFormatError } from "../errors.js";
|
|
2
|
+
import { childRecords, findChild, readRecordAt } from "../record/tree.js";
|
|
3
|
+
import { OfficeArtBStoreContainer, OfficeArtBlipJPEG, OfficeArtBlipPNG, OfficeArtDggContainer, OfficeArtFBSE, OfficeArtFDGGBlock, RT_DrawingGroup } from "../record/types.js";
|
|
4
|
+
import { concatBytes, u16le, u32le, u8, writeAtom, writeContainer } from "../record/write.js";
|
|
5
|
+
//#region src/drawing/blips.ts
|
|
6
|
+
const MSOBLIP_JPEG = 5;
|
|
7
|
+
const MSOBLIP_PNG = 6;
|
|
8
|
+
function isBlipFormat(format) {
|
|
9
|
+
return format === "png" || format === "jpeg";
|
|
10
|
+
}
|
|
11
|
+
function blipPayload(record) {
|
|
12
|
+
const format = record.header.recType === 61470 ? "png" : record.header.recType === 61469 ? "jpeg" : void 0;
|
|
13
|
+
if (format === void 0) return;
|
|
14
|
+
const uidCount = (record.header.recInstance & 1) + 1;
|
|
15
|
+
const dataStart = uidCount * 16 + 1;
|
|
16
|
+
if (record.data.length < dataStart) throw new PptFormatError(`a blip record of type 0x${record.header.recType.toString(16)} declares ${record.header.recInstance.toString(16)} as its instance (so ${uidCount} digest(s)) but carries only ${record.data.length} bytes`);
|
|
17
|
+
return {
|
|
18
|
+
format,
|
|
19
|
+
bytes: record.data.subarray(dataStart)
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
const FBSE_FIXED_SIZE = 36;
|
|
23
|
+
const FO_DELAY_NONE = 4294967295;
|
|
24
|
+
function readStoreEntry(entry, picturesStream) {
|
|
25
|
+
if (entry.header.recType !== 61447) return blipPayload(entry);
|
|
26
|
+
const view = new DataView(entry.data.buffer, entry.data.byteOffset, entry.data.byteLength);
|
|
27
|
+
const cRef = view.getUint32(24, true);
|
|
28
|
+
const foDelay = view.getUint32(28, true);
|
|
29
|
+
const cbName = view.getUint8(35);
|
|
30
|
+
const embeddedAt = entry.dataOffset + FBSE_FIXED_SIZE + cbName;
|
|
31
|
+
if (embeddedAt < entry.dataOffset + entry.header.recLen) return blipPayload(readRecordAt(entry.stream, embeddedAt));
|
|
32
|
+
if (cRef === 0 || foDelay === FO_DELAY_NONE) return;
|
|
33
|
+
if (picturesStream === void 0) return;
|
|
34
|
+
return blipPayload(readRecordAt(picturesStream, foDelay));
|
|
35
|
+
}
|
|
36
|
+
function readBlipStore(documentContainer, picturesStream) {
|
|
37
|
+
const drawingGroup = findChild(childRecords(documentContainer), RT_DrawingGroup);
|
|
38
|
+
if (drawingGroup === void 0) return [];
|
|
39
|
+
const dgg = findChild(childRecords(drawingGroup), OfficeArtDggContainer);
|
|
40
|
+
if (dgg === void 0) return [];
|
|
41
|
+
const bStore = findChild(childRecords(dgg), OfficeArtBStoreContainer);
|
|
42
|
+
if (bStore === void 0) return [];
|
|
43
|
+
const blips = [];
|
|
44
|
+
for (const entry of childRecords(bStore)) {
|
|
45
|
+
const blip = readStoreEntry(entry, picturesStream);
|
|
46
|
+
if (blip !== void 0) blips.push(blip);
|
|
47
|
+
}
|
|
48
|
+
return blips;
|
|
49
|
+
}
|
|
50
|
+
function blipForPib(blips, pib) {
|
|
51
|
+
if (pib <= 0) return;
|
|
52
|
+
return blips[pib - 1];
|
|
53
|
+
}
|
|
54
|
+
const ZERO_DIGEST = /* @__PURE__ */ new Uint8Array(16);
|
|
55
|
+
const TAG_EXTERNAL = 255;
|
|
56
|
+
function writeBlipRecord(blip) {
|
|
57
|
+
const recType = blip.format === "png" ? OfficeArtBlipPNG : OfficeArtBlipJPEG;
|
|
58
|
+
const recInstance = blip.format === "png" ? 1760 : 1130;
|
|
59
|
+
return writeAtom(recType, concatBytes(ZERO_DIGEST, u8(TAG_EXTERNAL), blip.bytes), { recInstance });
|
|
60
|
+
}
|
|
61
|
+
function writeFbse(blip) {
|
|
62
|
+
const embedded = writeBlipRecord(blip);
|
|
63
|
+
const blipType = blip.format === "png" ? MSOBLIP_PNG : MSOBLIP_JPEG;
|
|
64
|
+
return writeAtom(OfficeArtFBSE, concatBytes(u8(blipType), u8(blipType), ZERO_DIGEST, u16le(TAG_EXTERNAL), u32le(embedded.length), u32le(1), u32le(0), u8(0), u8(0), u8(0), u8(0), embedded), {
|
|
65
|
+
recVer: 2,
|
|
66
|
+
recInstance: blipType
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function writeDrawingGroupContainer(blips, counts) {
|
|
70
|
+
const fdgg = concatBytes(u32le(counts.spidMax), u32le(2), u32le(counts.shapeCount), u32le(counts.drawingCount));
|
|
71
|
+
const idcl = concatBytes(u32le(1), u32le(counts.spidMax));
|
|
72
|
+
const dggChildren = [writeAtom(OfficeArtFDGGBlock, concatBytes(fdgg, idcl))];
|
|
73
|
+
if (blips.length > 0) dggChildren.push(writeContainer(OfficeArtBStoreContainer, blips.map(writeFbse), { recInstance: blips.length }));
|
|
74
|
+
return writeContainer(RT_DrawingGroup, [writeContainer(OfficeArtDggContainer, dggChildren)]);
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
77
|
+
export { blipForPib, isBlipFormat, readBlipStore, writeDrawingGroupContainer };
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_errors = require("../errors.cjs");
|
|
3
|
+
const require_record_tree = require("../record/tree.cjs");
|
|
4
|
+
require("../record/types.cjs");
|
|
5
|
+
const require_record_write = require("../record/write.cjs");
|
|
6
|
+
//#region src/drawing/properties.ts
|
|
7
|
+
const OPID_MASK = 16383;
|
|
8
|
+
const OPID_FCOMPLEX = 16384;
|
|
9
|
+
const OPID_FBID = 32768;
|
|
10
|
+
const PROPERTY_ROTATION = 4;
|
|
11
|
+
const PROPERTY_PIB = 260;
|
|
12
|
+
const PROPERTY_TABLE_PROPERTIES = 927;
|
|
13
|
+
const PROPERTY_TABLE_ROW_PROPERTIES = 928;
|
|
14
|
+
const PROPERTY_DX_TEXT_LEFT = 129;
|
|
15
|
+
const PROPERTY_DY_TEXT_TOP = 130;
|
|
16
|
+
const PROPERTY_DX_TEXT_RIGHT = 131;
|
|
17
|
+
const PROPERTY_DY_TEXT_BOTTOM = 132;
|
|
18
|
+
const FIXED_POINT_ONE = 65536;
|
|
19
|
+
function degreesToFixedPoint(degrees) {
|
|
20
|
+
return Math.round(degrees * FIXED_POINT_ONE);
|
|
21
|
+
}
|
|
22
|
+
function fixedPointToDegrees(raw) {
|
|
23
|
+
return raw / FIXED_POINT_ONE;
|
|
24
|
+
}
|
|
25
|
+
const TABLE_FLAG_IS_TABLE = 1;
|
|
26
|
+
function readIMsoArray(complex) {
|
|
27
|
+
if (complex.length < 6) throw new require_errors.PptFormatError(`a complex property's IMsoArray carries ${complex.length} bytes, fewer than the 6 its three count fields need`);
|
|
28
|
+
const view = new DataView(complex.buffer, complex.byteOffset, complex.byteLength);
|
|
29
|
+
const elementCount = view.getUint16(0, true);
|
|
30
|
+
const elementSize = view.getUint16(4, true);
|
|
31
|
+
const data = complex.subarray(6);
|
|
32
|
+
if (data.length < elementCount * elementSize) throw new require_errors.PptFormatError(`a complex property's IMsoArray declares ${elementCount} elements of ${elementSize} bytes but only ${data.length} remain`);
|
|
33
|
+
const elements = [];
|
|
34
|
+
for (let index = 0; index < elementCount; index += 1) elements.push(view.getInt32(6 + index * elementSize, true));
|
|
35
|
+
return elements;
|
|
36
|
+
}
|
|
37
|
+
function writeIMsoArray(elements, elementSize) {
|
|
38
|
+
const data = new Uint8Array(elements.length * elementSize);
|
|
39
|
+
const view = new DataView(data.buffer);
|
|
40
|
+
elements.forEach((element, index) => {
|
|
41
|
+
view.setInt32(index * elementSize, element, true);
|
|
42
|
+
});
|
|
43
|
+
return require_record_write.concatBytes(require_record_write.u16le(elements.length), require_record_write.u16le(elements.length), require_record_write.u16le(elementSize), data);
|
|
44
|
+
}
|
|
45
|
+
function readShapeProperties(shape) {
|
|
46
|
+
const properties = /* @__PURE__ */ new Map();
|
|
47
|
+
for (const record of require_record_tree.childRecords(shape)) {
|
|
48
|
+
if (record.header.recType !== 61451 && record.header.recType !== 61729 && record.header.recType !== 61730) continue;
|
|
49
|
+
const count = record.header.recInstance;
|
|
50
|
+
const needed = count * 6;
|
|
51
|
+
if (record.data.length < needed) throw new require_errors.PptFormatError(`a shape property table declares ${count} properties but its ${record.data.length} bytes of data cannot hold the ${needed} its entries need`);
|
|
52
|
+
const view = new DataView(record.data.buffer, record.data.byteOffset, record.data.byteLength);
|
|
53
|
+
let complexAt = needed;
|
|
54
|
+
for (let index = 0; index < count; index += 1) {
|
|
55
|
+
const at = index * 6;
|
|
56
|
+
const opid = view.getUint16(at, true);
|
|
57
|
+
const value = view.getInt32(at + 2, true);
|
|
58
|
+
const isComplex = (opid & OPID_FCOMPLEX) !== 0;
|
|
59
|
+
let complex;
|
|
60
|
+
if (isComplex) {
|
|
61
|
+
complex = record.data.subarray(complexAt, complexAt + value);
|
|
62
|
+
complexAt += value;
|
|
63
|
+
if (complexAt > record.data.length) throw new require_errors.PptFormatError(`a shape property table's complex data declares ${complexAt} bytes in total but the table carries only ${record.data.length}`);
|
|
64
|
+
}
|
|
65
|
+
properties.set(opid & OPID_MASK, {
|
|
66
|
+
value,
|
|
67
|
+
complex
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return properties;
|
|
72
|
+
}
|
|
73
|
+
function writeShapePropertyTable(recType, entries) {
|
|
74
|
+
const ordered = [...entries].sort((a, b) => a.opid - b.opid);
|
|
75
|
+
const complexParts = [];
|
|
76
|
+
const entryParts = ordered.map((entry) => {
|
|
77
|
+
const isComplex = entry.complex !== void 0;
|
|
78
|
+
const opidWord = entry.opid | (isComplex ? OPID_FCOMPLEX : 0) | (entry.fBid === true ? OPID_FBID : 0);
|
|
79
|
+
if (isComplex) complexParts.push(entry.complex);
|
|
80
|
+
return require_record_write.concatBytes(require_record_write.u16le(opidWord), require_record_write.u32le(entry.op));
|
|
81
|
+
});
|
|
82
|
+
return require_record_write.writeAtom(recType, require_record_write.concatBytes(...entryParts, ...complexParts), {
|
|
83
|
+
recVer: 3,
|
|
84
|
+
recInstance: ordered.length
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
//#endregion
|
|
88
|
+
exports.PROPERTY_DX_TEXT_LEFT = PROPERTY_DX_TEXT_LEFT;
|
|
89
|
+
exports.PROPERTY_DX_TEXT_RIGHT = PROPERTY_DX_TEXT_RIGHT;
|
|
90
|
+
exports.PROPERTY_DY_TEXT_BOTTOM = PROPERTY_DY_TEXT_BOTTOM;
|
|
91
|
+
exports.PROPERTY_DY_TEXT_TOP = PROPERTY_DY_TEXT_TOP;
|
|
92
|
+
exports.PROPERTY_PIB = PROPERTY_PIB;
|
|
93
|
+
exports.PROPERTY_ROTATION = PROPERTY_ROTATION;
|
|
94
|
+
exports.PROPERTY_TABLE_PROPERTIES = PROPERTY_TABLE_PROPERTIES;
|
|
95
|
+
exports.PROPERTY_TABLE_ROW_PROPERTIES = PROPERTY_TABLE_ROW_PROPERTIES;
|
|
96
|
+
exports.TABLE_FLAG_IS_TABLE = TABLE_FLAG_IS_TABLE;
|
|
97
|
+
exports.degreesToFixedPoint = degreesToFixedPoint;
|
|
98
|
+
exports.fixedPointToDegrees = fixedPointToDegrees;
|
|
99
|
+
exports.readIMsoArray = readIMsoArray;
|
|
100
|
+
exports.readShapeProperties = readShapeProperties;
|
|
101
|
+
exports.writeIMsoArray = writeIMsoArray;
|
|
102
|
+
exports.writeShapePropertyTable = writeShapePropertyTable;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { t as PptRecord } from "../tree-Du_LXAF0.cjs";
|
|
2
|
+
//#region src/drawing/properties.d.ts
|
|
3
|
+
declare const PROPERTY_ROTATION = 4;
|
|
4
|
+
declare const PROPERTY_PIB = 260;
|
|
5
|
+
declare const PROPERTY_TABLE_PROPERTIES = 927;
|
|
6
|
+
declare const PROPERTY_TABLE_ROW_PROPERTIES = 928;
|
|
7
|
+
declare const PROPERTY_DX_TEXT_LEFT = 129;
|
|
8
|
+
declare const PROPERTY_DY_TEXT_TOP = 130;
|
|
9
|
+
declare const PROPERTY_DX_TEXT_RIGHT = 131;
|
|
10
|
+
declare const PROPERTY_DY_TEXT_BOTTOM = 132;
|
|
11
|
+
declare function degreesToFixedPoint(degrees: number): number;
|
|
12
|
+
declare function fixedPointToDegrees(raw: number): number;
|
|
13
|
+
declare const TABLE_FLAG_IS_TABLE: number;
|
|
14
|
+
declare function readIMsoArray(complex: Uint8Array<ArrayBuffer>): readonly number[];
|
|
15
|
+
declare function writeIMsoArray(elements: readonly number[], elementSize: number): Uint8Array<ArrayBuffer>;
|
|
16
|
+
interface ShapeProperty {
|
|
17
|
+
readonly value: number;
|
|
18
|
+
readonly complex: Uint8Array<ArrayBuffer> | undefined;
|
|
19
|
+
}
|
|
20
|
+
declare function readShapeProperties(shape: PptRecord): Map<number, ShapeProperty>;
|
|
21
|
+
interface WritableShapeProperty {
|
|
22
|
+
readonly opid: number;
|
|
23
|
+
readonly op: number;
|
|
24
|
+
readonly fBid?: boolean;
|
|
25
|
+
readonly complex?: Uint8Array<ArrayBuffer>;
|
|
26
|
+
}
|
|
27
|
+
declare function writeShapePropertyTable(recType: number, entries: readonly WritableShapeProperty[]): Uint8Array<ArrayBuffer>;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { PROPERTY_DX_TEXT_LEFT, PROPERTY_DX_TEXT_RIGHT, PROPERTY_DY_TEXT_BOTTOM, PROPERTY_DY_TEXT_TOP, PROPERTY_PIB, PROPERTY_ROTATION, PROPERTY_TABLE_PROPERTIES, PROPERTY_TABLE_ROW_PROPERTIES, ShapeProperty, TABLE_FLAG_IS_TABLE, WritableShapeProperty, degreesToFixedPoint, fixedPointToDegrees, readIMsoArray, readShapeProperties, writeIMsoArray, writeShapePropertyTable };
|