docx 8.4.0 → 8.5.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/build/file/core-properties/properties.d.ts +2 -0
- package/build/file/document/body/section-properties/properties/line-number.d.ts +3 -5
- package/build/file/document-wrapper.d.ts +2 -1
- package/build/file/drawing/anchor/anchor.d.ts +5 -1
- package/build/file/drawing/drawing.d.ts +4 -2
- package/build/file/drawing/effect-extent/effect-extent.d.ts +7 -3
- package/build/file/drawing/inline/graphic/graphic-data/graphic-data.d.ts +6 -1
- package/build/file/drawing/inline/graphic/graphic-data/pic/pic.d.ts +6 -1
- package/build/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/no-fill.d.ts +1 -3
- package/build/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/outline.d.ts +41 -3
- package/build/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/rgb-color.d.ts +6 -0
- package/build/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/scheme-color.d.ts +25 -0
- package/build/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/solid-fill.d.ts +12 -0
- package/build/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/solid-fill.spec.d.ts +1 -0
- package/build/file/drawing/inline/graphic/graphic-data/pic/shape-properties/shape-properties.d.ts +5 -1
- package/build/file/drawing/inline/graphic/graphic.d.ts +6 -1
- package/build/file/drawing/inline/inline.d.ts +5 -7
- package/build/file/drawing/inline/inline.spec.d.ts +1 -0
- package/build/file/file.d.ts +3 -0
- package/build/file/fonts/create-regular-font.d.ts +8 -0
- package/build/file/fonts/font-table.d.ts +10 -0
- package/build/file/fonts/font-wrapper.d.ts +16 -0
- package/build/file/fonts/font.d.ts +49 -0
- package/build/file/fonts/font.spec.d.ts +1 -0
- package/build/file/fonts/index.d.ts +1 -0
- package/build/file/fonts/obfuscate-ttf-to-odttf.d.ts +2 -0
- package/build/file/fonts/obsfuscate-ttf-to-odtts.spec.d.ts +1 -0
- package/build/file/index.d.ts +1 -0
- package/build/file/paragraph/frame/frame-properties.d.ts +4 -39
- package/build/file/paragraph/links/pageref-field-instruction.d.ts +1 -1
- package/build/file/paragraph/links/pageref.d.ts +4 -1
- package/build/file/paragraph/properties.d.ts +1 -0
- package/build/file/paragraph/run/image-run.d.ts +2 -0
- package/build/file/paragraph/run/page-number.d.ts +3 -0
- package/build/file/paragraph/run/run.d.ts +1 -0
- package/build/file/paragraph/run/sequential-identifier.d.ts +1 -1
- package/build/file/relationships/relationship/relationship.d.ts +1 -1
- package/build/file/styles/styles.d.ts +1 -1
- package/build/file/table/table-properties/table-cell-margin.d.ts +1 -1
- package/build/file/track-revision/track-revision-components/deleted-text-run.d.ts +1 -1
- package/build/file/xml-components/imported-xml-component.d.ts +1 -1
- package/build/file/xml-components/initializable-xml-component.d.ts +1 -1
- package/build/file/xml-components/simple-elements.d.ts +3 -2
- package/build/index.cjs +908 -550
- package/build/index.iife.js +908 -550
- package/build/index.mjs +908 -550
- package/build/index.umd.js +908 -550
- package/build/util/convenience-functions.d.ts +1 -0
- package/package.json +14 -14
- package/build/file/drawing/effect-extent/effect-extent-attributes.d.ts +0 -14
- package/build/file/drawing/inline/inline-attributes.d.ts +0 -10
- package/build/file/paragraph/formatting/width.d.ts +0 -0
- package/build/file/paragraph/links/pageref-properties.d.ts +0 -4
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ICommentsOptions } from '../paragraph/run/comment-run';
|
|
2
2
|
import { ICompatibilityOptions } from '../settings/compatibility';
|
|
3
|
+
import { FontOptions } from '../fonts/font-table';
|
|
3
4
|
import { XmlComponent } from '../xml-components';
|
|
4
5
|
import { ICustomPropertyOptions } from "../custom-properties";
|
|
5
6
|
import { IDocumentBackgroundOptions } from "../document";
|
|
@@ -35,6 +36,7 @@ export interface IPropertiesOptions {
|
|
|
35
36
|
readonly customProperties?: readonly ICustomPropertyOptions[];
|
|
36
37
|
readonly evenAndOddHeaderAndFooters?: boolean;
|
|
37
38
|
readonly defaultTabStop?: number;
|
|
39
|
+
readonly fonts?: readonly FontOptions[];
|
|
38
40
|
}
|
|
39
41
|
export declare class CoreProperties extends XmlComponent {
|
|
40
42
|
constructor(options: Omit<IPropertiesOptions, "sections">);
|
|
@@ -5,12 +5,10 @@ export declare const LineNumberRestartFormat: {
|
|
|
5
5
|
readonly NEW_SECTION: "newSection";
|
|
6
6
|
readonly CONTINUOUS: "continuous";
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type ILineNumberAttributes = {
|
|
9
9
|
readonly countBy?: number;
|
|
10
10
|
readonly start?: number;
|
|
11
11
|
readonly restart?: (typeof LineNumberRestartFormat)[keyof typeof LineNumberRestartFormat];
|
|
12
12
|
readonly distance?: number | PositiveUniversalMeasure;
|
|
13
|
-
}
|
|
14
|
-
export declare
|
|
15
|
-
constructor({ countBy, start, restart, distance }: ILineNumberAttributes);
|
|
16
|
-
}
|
|
13
|
+
};
|
|
14
|
+
export declare const createLineNumberType: ({ countBy, start, restart, distance }: ILineNumberAttributes) => XmlComponent;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { XmlComponent } from "./xml-components";
|
|
1
2
|
import { Document, IDocumentOptions } from "./document";
|
|
2
3
|
import { Footer } from "./footer/footer";
|
|
3
4
|
import { FootNotes } from "./footnotes";
|
|
4
5
|
import { Header } from "./header/header";
|
|
5
6
|
import { Relationships } from "./relationships";
|
|
6
7
|
export interface IViewWrapper {
|
|
7
|
-
readonly View: Document | Footer | Header | FootNotes;
|
|
8
|
+
readonly View: Document | Footer | Header | FootNotes | XmlComponent;
|
|
8
9
|
readonly Relationships: Relationships;
|
|
9
10
|
}
|
|
10
11
|
export declare class DocumentWrapper implements IViewWrapper {
|
|
@@ -2,5 +2,9 @@ import { IMediaData, IMediaDataTransformation } from '../../media';
|
|
|
2
2
|
import { XmlComponent } from '../../xml-components';
|
|
3
3
|
import { IDrawingOptions } from "../drawing";
|
|
4
4
|
export declare class Anchor extends XmlComponent {
|
|
5
|
-
constructor(mediaData
|
|
5
|
+
constructor({ mediaData, transform, drawingOptions, }: {
|
|
6
|
+
readonly mediaData: IMediaData;
|
|
7
|
+
readonly transform: IMediaDataTransformation;
|
|
8
|
+
readonly drawingOptions: IDrawingOptions;
|
|
9
|
+
});
|
|
6
10
|
}
|
|
@@ -2,15 +2,17 @@ import { IMediaData } from '../media';
|
|
|
2
2
|
import { XmlComponent } from '../xml-components';
|
|
3
3
|
import { DocPropertiesOptions } from "./doc-properties/doc-properties";
|
|
4
4
|
import { IFloating } from "./floating";
|
|
5
|
-
|
|
5
|
+
import { OutlineOptions } from "./inline/graphic/graphic-data/pic/shape-properties/outline/outline";
|
|
6
|
+
export type IDistance = {
|
|
6
7
|
readonly distT?: number;
|
|
7
8
|
readonly distB?: number;
|
|
8
9
|
readonly distL?: number;
|
|
9
10
|
readonly distR?: number;
|
|
10
|
-
}
|
|
11
|
+
};
|
|
11
12
|
export interface IDrawingOptions {
|
|
12
13
|
readonly floating?: IFloating;
|
|
13
14
|
readonly docProperties?: DocPropertiesOptions;
|
|
15
|
+
readonly outline?: OutlineOptions;
|
|
14
16
|
}
|
|
15
17
|
export declare class Drawing extends XmlComponent {
|
|
16
18
|
constructor(imageData: IMediaData, drawingOptions?: IDrawingOptions);
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { XmlComponent } from '../../xml-components';
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
export type EffectExtentAttributes = {
|
|
3
|
+
readonly top: number;
|
|
4
|
+
readonly right: number;
|
|
5
|
+
readonly bottom: number;
|
|
6
|
+
readonly left: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const createEffectExtent: ({ top, right, bottom, left }: EffectExtentAttributes) => XmlComponent;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { IMediaData, IMediaDataTransformation } from '../../../../media';
|
|
2
2
|
import { XmlComponent } from '../../../../xml-components';
|
|
3
|
+
import { OutlineOptions } from "./pic/shape-properties/outline/outline";
|
|
3
4
|
export declare class GraphicData extends XmlComponent {
|
|
4
5
|
private readonly pic;
|
|
5
|
-
constructor(mediaData
|
|
6
|
+
constructor({ mediaData, transform, outline, }: {
|
|
7
|
+
readonly mediaData: IMediaData;
|
|
8
|
+
readonly transform: IMediaDataTransformation;
|
|
9
|
+
readonly outline?: OutlineOptions;
|
|
10
|
+
});
|
|
6
11
|
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { IMediaData, IMediaDataTransformation } from '../../../../../media';
|
|
2
2
|
import { XmlComponent } from '../../../../../xml-components';
|
|
3
|
+
import { OutlineOptions } from "./shape-properties/outline/outline";
|
|
3
4
|
export declare class Pic extends XmlComponent {
|
|
4
|
-
constructor(mediaData
|
|
5
|
+
constructor({ mediaData, transform, outline, }: {
|
|
6
|
+
readonly mediaData: IMediaData;
|
|
7
|
+
readonly transform: IMediaDataTransformation;
|
|
8
|
+
readonly outline?: OutlineOptions;
|
|
9
|
+
});
|
|
5
10
|
}
|
package/build/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/outline.d.ts
CHANGED
|
@@ -1,4 +1,42 @@
|
|
|
1
1
|
import { XmlComponent } from '../../../../../../../xml-components';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { SchemeColor } from "./scheme-color";
|
|
3
|
+
export declare const LineCap: {
|
|
4
|
+
readonly ROUND: "rnd";
|
|
5
|
+
readonly SQUARE: "sq";
|
|
6
|
+
readonly FLAT: "flat";
|
|
7
|
+
};
|
|
8
|
+
export declare const CompoundLine: {
|
|
9
|
+
readonly SINGLE: "sng";
|
|
10
|
+
readonly DOUBLE: "dbl";
|
|
11
|
+
readonly THICK_THIN: "thickThin";
|
|
12
|
+
readonly THIN_THICK: "thinThick";
|
|
13
|
+
readonly TRI: "tri";
|
|
14
|
+
};
|
|
15
|
+
export declare const PenAlignment: {
|
|
16
|
+
readonly CENTER: "ctr";
|
|
17
|
+
readonly INSET: "in";
|
|
18
|
+
};
|
|
19
|
+
export type OutlineAttributes = {
|
|
20
|
+
readonly width?: number;
|
|
21
|
+
readonly cap?: keyof typeof LineCap;
|
|
22
|
+
readonly compoundLine?: keyof typeof CompoundLine;
|
|
23
|
+
readonly align?: keyof typeof PenAlignment;
|
|
24
|
+
};
|
|
25
|
+
type OutlineNoFill = {
|
|
26
|
+
readonly type: "noFill";
|
|
27
|
+
};
|
|
28
|
+
type OutlineRgbSolidFill = {
|
|
29
|
+
readonly type: "solidFill";
|
|
30
|
+
readonly solidFillType: "rgb";
|
|
31
|
+
readonly value: string;
|
|
32
|
+
};
|
|
33
|
+
type OutlineSchemeSolidFill = {
|
|
34
|
+
readonly type: "solidFill";
|
|
35
|
+
readonly solidFillType: "scheme";
|
|
36
|
+
readonly value: (typeof SchemeColor)[keyof typeof SchemeColor];
|
|
37
|
+
};
|
|
38
|
+
type OutlineSolidFill = OutlineRgbSolidFill | OutlineSchemeSolidFill;
|
|
39
|
+
type OutlineFillProperties = OutlineNoFill | OutlineSolidFill;
|
|
40
|
+
export type OutlineOptions = OutlineAttributes & OutlineFillProperties;
|
|
41
|
+
export declare const createOutline: (options: OutlineOptions) => XmlComponent;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { XmlComponent } from '../../../../../../../xml-components';
|
|
2
|
+
type SchemeColorOptions = {
|
|
3
|
+
readonly value: (typeof SchemeColor)[keyof typeof SchemeColor];
|
|
4
|
+
};
|
|
5
|
+
export declare const SchemeColor: {
|
|
6
|
+
readonly BG1: "bg1";
|
|
7
|
+
readonly TX1: "tx1";
|
|
8
|
+
readonly BG2: "bg2";
|
|
9
|
+
readonly TX2: "tx2";
|
|
10
|
+
readonly ACCENT1: "accent1";
|
|
11
|
+
readonly ACCENT2: "accent2";
|
|
12
|
+
readonly ACCENT3: "accent3";
|
|
13
|
+
readonly ACCENT4: "accent4";
|
|
14
|
+
readonly ACCENT5: "accent5";
|
|
15
|
+
readonly ACCENT6: "accent6";
|
|
16
|
+
readonly HLINK: "hlink";
|
|
17
|
+
readonly FOLHLINK: "folHlink";
|
|
18
|
+
readonly DK1: "dk1";
|
|
19
|
+
readonly LT1: "lt1";
|
|
20
|
+
readonly DK2: "dk2";
|
|
21
|
+
readonly LT2: "lt2";
|
|
22
|
+
readonly PHCLR: "phClr";
|
|
23
|
+
};
|
|
24
|
+
export declare const createSchemeColor: (options: SchemeColorOptions) => XmlComponent;
|
|
25
|
+
export {};
|
package/build/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/solid-fill.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { XmlComponent } from '../../../../../../../xml-components';
|
|
2
|
+
import { SchemeColor } from "./scheme-color";
|
|
3
|
+
export type RgbColorOptions = {
|
|
4
|
+
readonly type: "rgb";
|
|
5
|
+
readonly value: string;
|
|
6
|
+
};
|
|
7
|
+
export type SchemeColorOptions = {
|
|
8
|
+
readonly type: "scheme";
|
|
9
|
+
readonly value: (typeof SchemeColor)[keyof typeof SchemeColor];
|
|
10
|
+
};
|
|
11
|
+
export type SolidFillOptions = RgbColorOptions | SchemeColorOptions;
|
|
12
|
+
export declare const createSolidFill: (options: SolidFillOptions) => XmlComponent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/build/file/drawing/inline/graphic/graphic-data/pic/shape-properties/shape-properties.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { IMediaDataTransformation } from '../../../../../../media';
|
|
2
2
|
import { XmlComponent } from '../../../../../../xml-components';
|
|
3
|
+
import { OutlineOptions } from "./outline/outline";
|
|
3
4
|
export declare class ShapeProperties extends XmlComponent {
|
|
4
5
|
private readonly form;
|
|
5
|
-
constructor(transform:
|
|
6
|
+
constructor({ outline, transform }: {
|
|
7
|
+
readonly outline?: OutlineOptions;
|
|
8
|
+
readonly transform: IMediaDataTransformation;
|
|
9
|
+
});
|
|
6
10
|
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { IMediaData, IMediaDataTransformation } from '../../../media';
|
|
2
2
|
import { XmlComponent } from '../../../xml-components';
|
|
3
|
+
import { OutlineOptions } from "./graphic-data/pic/shape-properties/outline/outline";
|
|
3
4
|
export declare class Graphic extends XmlComponent {
|
|
4
5
|
private readonly data;
|
|
5
|
-
constructor(mediaData
|
|
6
|
+
constructor({ mediaData, transform, outline, }: {
|
|
7
|
+
readonly mediaData: IMediaData;
|
|
8
|
+
readonly transform: IMediaDataTransformation;
|
|
9
|
+
readonly outline?: OutlineOptions;
|
|
10
|
+
});
|
|
6
11
|
}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { IMediaData, IMediaDataTransformation } from '../../media';
|
|
2
2
|
import { XmlComponent } from '../../xml-components';
|
|
3
3
|
import { DocPropertiesOptions } from "./../doc-properties/doc-properties";
|
|
4
|
-
|
|
4
|
+
import { OutlineOptions } from "./graphic/graphic-data/pic/shape-properties/outline/outline";
|
|
5
|
+
type InlineOptions = {
|
|
5
6
|
readonly mediaData: IMediaData;
|
|
6
7
|
readonly transform: IMediaDataTransformation;
|
|
7
8
|
readonly docProperties?: DocPropertiesOptions;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
private readonly graphic;
|
|
12
|
-
constructor({ mediaData, transform, docProperties }: InlineOptions);
|
|
13
|
-
}
|
|
9
|
+
readonly outline?: OutlineOptions;
|
|
10
|
+
};
|
|
11
|
+
export declare const createInline: ({ mediaData, transform, docProperties, outline }: InlineOptions) => XmlComponent;
|
|
14
12
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/build/file/file.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { Relationships } from "./relationships";
|
|
|
15
15
|
import { Settings } from "./settings";
|
|
16
16
|
import { Styles } from "./styles";
|
|
17
17
|
import { FileChild } from "./file-child";
|
|
18
|
+
import { FontWrapper } from "./fonts/font-wrapper";
|
|
18
19
|
export interface ISectionOptions {
|
|
19
20
|
readonly headers?: {
|
|
20
21
|
readonly default?: Header;
|
|
@@ -45,6 +46,7 @@ export declare class File {
|
|
|
45
46
|
private readonly appProperties;
|
|
46
47
|
private readonly styles;
|
|
47
48
|
private readonly comments;
|
|
49
|
+
private readonly fontWrapper;
|
|
48
50
|
constructor(options: IPropertiesOptions);
|
|
49
51
|
private addSection;
|
|
50
52
|
private createHeader;
|
|
@@ -66,4 +68,5 @@ export declare class File {
|
|
|
66
68
|
get FootNotes(): FootnotesWrapper;
|
|
67
69
|
get Settings(): Settings;
|
|
68
70
|
get Comments(): Comments;
|
|
71
|
+
get FontTable(): FontWrapper;
|
|
69
72
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { XmlComponent } from '../xml-components';
|
|
2
|
+
import { CharacterSet } from "./font";
|
|
3
|
+
export declare const createRegularFont: ({ name, index, fontKey, characterSet, }: {
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly index: number;
|
|
6
|
+
readonly fontKey: string;
|
|
7
|
+
readonly characterSet?: "00" | "01" | "02" | "4D" | "80" | "81" | "82" | "86" | "88" | "A1" | "A2" | "A3" | "B1" | "B2" | "BA" | "CC" | "DE" | "EE" | "FF" | undefined;
|
|
8
|
+
}) => XmlComponent;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { XmlComponent } from '../xml-components';
|
|
3
|
+
import { FontOptionsWithKey } from "./font-wrapper";
|
|
4
|
+
import { CharacterSet } from "./font";
|
|
5
|
+
export type FontOptions = {
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly data: Buffer;
|
|
8
|
+
readonly characterSet?: (typeof CharacterSet)[keyof typeof CharacterSet];
|
|
9
|
+
};
|
|
10
|
+
export declare const createFontTable: (fonts: readonly FontOptionsWithKey[]) => XmlComponent;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IViewWrapper } from '../document-wrapper';
|
|
2
|
+
import { Relationships } from '../relationships';
|
|
3
|
+
import { XmlComponent } from '../xml-components';
|
|
4
|
+
import { FontOptions } from "./font-table";
|
|
5
|
+
export type FontOptionsWithKey = FontOptions & {
|
|
6
|
+
readonly fontKey: string;
|
|
7
|
+
};
|
|
8
|
+
export declare class FontWrapper implements IViewWrapper {
|
|
9
|
+
readonly options: readonly FontOptions[];
|
|
10
|
+
private readonly fontTable;
|
|
11
|
+
private readonly relationships;
|
|
12
|
+
readonly fontOptionsWithKey: readonly FontOptionsWithKey[];
|
|
13
|
+
constructor(options: readonly FontOptions[]);
|
|
14
|
+
get View(): XmlComponent;
|
|
15
|
+
get Relationships(): Relationships;
|
|
16
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { XmlComponent } from '../xml-components';
|
|
2
|
+
export interface IFontRelationshipOptions {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly fontKey?: string;
|
|
5
|
+
readonly subsetted?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const CharacterSet: {
|
|
8
|
+
readonly ANSI: "00";
|
|
9
|
+
readonly DEFAULT: "01";
|
|
10
|
+
readonly SYMBOL: "02";
|
|
11
|
+
readonly MAC: "4D";
|
|
12
|
+
readonly JIS: "80";
|
|
13
|
+
readonly HANGUL: "81";
|
|
14
|
+
readonly JOHAB: "82";
|
|
15
|
+
readonly GB_2312: "86";
|
|
16
|
+
readonly CHINESEBIG5: "88";
|
|
17
|
+
readonly GREEK: "A1";
|
|
18
|
+
readonly TURKISH: "A2";
|
|
19
|
+
readonly VIETNAMESE: "A3";
|
|
20
|
+
readonly HEBREW: "B1";
|
|
21
|
+
readonly ARABIC: "B2";
|
|
22
|
+
readonly BALTIC: "BA";
|
|
23
|
+
readonly RUSSIAN: "CC";
|
|
24
|
+
readonly THAI: "DE";
|
|
25
|
+
readonly EASTEUROPE: "EE";
|
|
26
|
+
readonly OEM: "FF";
|
|
27
|
+
};
|
|
28
|
+
export type FontOptions = {
|
|
29
|
+
readonly name: string;
|
|
30
|
+
readonly altName?: string;
|
|
31
|
+
readonly panose1?: string;
|
|
32
|
+
readonly charset?: (typeof CharacterSet)[keyof typeof CharacterSet];
|
|
33
|
+
readonly family?: string;
|
|
34
|
+
readonly notTrueType?: boolean;
|
|
35
|
+
readonly pitch?: string;
|
|
36
|
+
readonly sig?: {
|
|
37
|
+
readonly usb0: string;
|
|
38
|
+
readonly usb1: string;
|
|
39
|
+
readonly usb2: string;
|
|
40
|
+
readonly usb3: string;
|
|
41
|
+
readonly csb0: string;
|
|
42
|
+
readonly csb1: string;
|
|
43
|
+
};
|
|
44
|
+
readonly embedRegular?: IFontRelationshipOptions;
|
|
45
|
+
readonly embedBold?: IFontRelationshipOptions;
|
|
46
|
+
readonly embedItalic?: IFontRelationshipOptions;
|
|
47
|
+
readonly embedBoldItalic?: IFontRelationshipOptions;
|
|
48
|
+
};
|
|
49
|
+
export declare const createFont: ({ name, altName, panose1, charset, family, notTrueType, pitch, sig, embedRegular, embedBold, embedItalic, embedBoldItalic, }: FontOptions) => XmlComponent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CharacterSet } from "./font";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/build/file/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HorizontalPositionAlign, VerticalPositionAlign } from '../../shared/alignment';
|
|
2
2
|
import { HeightRule } from '../../table';
|
|
3
|
-
import {
|
|
3
|
+
import { XmlComponent } from '../../xml-components';
|
|
4
4
|
export declare const DropCapType: {
|
|
5
5
|
readonly NONE: "none";
|
|
6
6
|
readonly DROP: "drop";
|
|
@@ -37,54 +37,19 @@ interface IBaseFrameOptions {
|
|
|
37
37
|
readonly rule?: (typeof HeightRule)[keyof typeof HeightRule];
|
|
38
38
|
}
|
|
39
39
|
export interface IXYFrameOptions extends IBaseFrameOptions {
|
|
40
|
+
readonly type: "absolute";
|
|
40
41
|
readonly position: {
|
|
41
42
|
readonly x: number;
|
|
42
43
|
readonly y: number;
|
|
43
44
|
};
|
|
44
45
|
}
|
|
45
46
|
export interface IAlignmentFrameOptions extends IBaseFrameOptions {
|
|
47
|
+
readonly type: "alignment";
|
|
46
48
|
readonly alignment: {
|
|
47
49
|
readonly x: (typeof HorizontalPositionAlign)[keyof typeof HorizontalPositionAlign];
|
|
48
50
|
readonly y: (typeof VerticalPositionAlign)[keyof typeof VerticalPositionAlign];
|
|
49
51
|
};
|
|
50
52
|
}
|
|
51
53
|
export type IFrameOptions = IXYFrameOptions | IAlignmentFrameOptions;
|
|
52
|
-
export declare
|
|
53
|
-
readonly anchorLock?: boolean;
|
|
54
|
-
readonly dropCap?: (typeof DropCapType)[keyof typeof DropCapType];
|
|
55
|
-
readonly width: number;
|
|
56
|
-
readonly height: number;
|
|
57
|
-
readonly x?: number;
|
|
58
|
-
readonly y?: number;
|
|
59
|
-
readonly wrap?: (typeof FrameWrap)[keyof typeof FrameWrap];
|
|
60
|
-
readonly lines?: number;
|
|
61
|
-
readonly anchorHorizontal?: (typeof FrameAnchorType)[keyof typeof FrameAnchorType];
|
|
62
|
-
readonly anchorVertical?: (typeof FrameAnchorType)[keyof typeof FrameAnchorType];
|
|
63
|
-
readonly spaceHorizontal?: number;
|
|
64
|
-
readonly spaceVertical?: number;
|
|
65
|
-
readonly rule?: (typeof HeightRule)[keyof typeof HeightRule];
|
|
66
|
-
readonly alignmentX?: (typeof HorizontalPositionAlign)[keyof typeof HorizontalPositionAlign];
|
|
67
|
-
readonly alignmentY?: (typeof VerticalPositionAlign)[keyof typeof VerticalPositionAlign];
|
|
68
|
-
}> {
|
|
69
|
-
protected readonly xmlKeys: {
|
|
70
|
-
anchorLock: string;
|
|
71
|
-
dropCap: string;
|
|
72
|
-
width: string;
|
|
73
|
-
height: string;
|
|
74
|
-
x: string;
|
|
75
|
-
y: string;
|
|
76
|
-
anchorHorizontal: string;
|
|
77
|
-
anchorVertical: string;
|
|
78
|
-
spaceHorizontal: string;
|
|
79
|
-
spaceVertical: string;
|
|
80
|
-
rule: string;
|
|
81
|
-
alignmentX: string;
|
|
82
|
-
alignmentY: string;
|
|
83
|
-
lines: string;
|
|
84
|
-
wrap: string;
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
export declare class FrameProperties extends XmlComponent {
|
|
88
|
-
constructor(options: IFrameOptions);
|
|
89
|
-
}
|
|
54
|
+
export declare const createFrameProperties: (options: IFrameOptions) => XmlComponent;
|
|
90
55
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { XmlComponent } from '../../xml-components';
|
|
2
|
-
import { IPageReferenceOptions } from "./pageref
|
|
2
|
+
import { IPageReferenceOptions } from "./pageref";
|
|
3
3
|
export declare class PageReferenceFieldInstruction extends XmlComponent {
|
|
4
4
|
constructor(bookmarkId: string, options?: IPageReferenceOptions);
|
|
5
5
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Run } from "../run";
|
|
2
|
-
|
|
2
|
+
export type IPageReferenceOptions = {
|
|
3
|
+
readonly hyperlink?: boolean;
|
|
4
|
+
readonly useRelativePosition?: boolean;
|
|
5
|
+
};
|
|
3
6
|
export declare class PageReference extends Run {
|
|
4
7
|
constructor(bookmarkId: string, options?: IPageReferenceOptions);
|
|
5
8
|
}
|
|
@@ -43,6 +43,7 @@ export interface IParagraphPropertiesOptions extends IParagraphStylePropertiesOp
|
|
|
43
43
|
readonly frame?: IFrameOptions;
|
|
44
44
|
readonly suppressLineNumbers?: boolean;
|
|
45
45
|
readonly wordWrap?: boolean;
|
|
46
|
+
readonly overflowPunctuation?: boolean;
|
|
46
47
|
readonly scale?: number;
|
|
47
48
|
readonly autoSpaceEastAsianText?: boolean;
|
|
48
49
|
readonly run?: IRunOptions;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { IContext, IXmlableObject } from '../../xml-components';
|
|
3
3
|
import { DocPropertiesOptions } from '../../drawing/doc-properties/doc-properties';
|
|
4
|
+
import { OutlineOptions } from "../../drawing/inline/graphic/graphic-data/pic/shape-properties/outline/outline";
|
|
4
5
|
import { IFloating } from "../../drawing";
|
|
5
6
|
import { IMediaTransformation } from "../../media";
|
|
6
7
|
import { Run } from "../run";
|
|
@@ -9,6 +10,7 @@ export interface IImageOptions {
|
|
|
9
10
|
readonly transformation: IMediaTransformation;
|
|
10
11
|
readonly floating?: IFloating;
|
|
11
12
|
readonly altText?: DocPropertiesOptions;
|
|
13
|
+
readonly outline?: OutlineOptions;
|
|
12
14
|
}
|
|
13
15
|
export declare class ImageRun extends Run {
|
|
14
16
|
private readonly key;
|
|
@@ -15,6 +15,7 @@ export declare const PageNumber: {
|
|
|
15
15
|
readonly CURRENT: "CURRENT";
|
|
16
16
|
readonly TOTAL_PAGES: "TOTAL_PAGES";
|
|
17
17
|
readonly TOTAL_PAGES_IN_SECTION: "TOTAL_PAGES_IN_SECTION";
|
|
18
|
+
readonly CURRENT_SECTION: "SECTION";
|
|
18
19
|
};
|
|
19
20
|
export declare class Run extends XmlComponent {
|
|
20
21
|
protected readonly properties: RunProperties;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { XmlComponent } from '../../xml-components';
|
|
2
|
-
export type RelationshipType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" | "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" | "http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings" | "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" | "http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable" | "http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings" | "http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering" | "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header" | "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer" | "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" | "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" | "http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties" | "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" | "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" | "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes" | "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments";
|
|
2
|
+
export type RelationshipType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" | "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" | "http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings" | "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" | "http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable" | "http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings" | "http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering" | "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header" | "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer" | "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" | "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" | "http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties" | "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" | "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" | "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes" | "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments" | "http://schemas.openxmlformats.org/officeDocument/2006/relationships/font";
|
|
3
3
|
export declare const TargetModeType: {
|
|
4
4
|
readonly EXTERNAL: "External";
|
|
5
5
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IDefaultStylesOptions } from '
|
|
1
|
+
import { IDefaultStylesOptions } from './factory';
|
|
2
2
|
import { BaseXmlComponent, ImportedXmlComponent, XmlComponent } from '../xml-components';
|
|
3
3
|
import { StyleForCharacter, StyleForParagraph } from "./style";
|
|
4
4
|
import { ICharacterStyleOptions } from "./style/character-style";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IgnoreIfEmptyXmlComponent } from '../../xml-components';
|
|
2
|
-
import { WidthType } from '
|
|
2
|
+
import { WidthType } from '..';
|
|
3
3
|
export interface ITableCellMarginOptions {
|
|
4
4
|
readonly marginUnitType?: (typeof WidthType)[keyof typeof WidthType];
|
|
5
5
|
readonly top?: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { XmlComponent } from '../../xml-components';
|
|
2
|
-
import { IRunOptions } from "../../
|
|
2
|
+
import { IRunOptions } from "../../paragraph/run/run";
|
|
3
3
|
import { IChangedAttributesProperties } from "../track-revision";
|
|
4
4
|
interface IDeletedRunOptions extends IRunOptions, IChangedAttributesProperties {
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Element as XmlElement } from "xml-js";
|
|
2
|
-
import { IXmlableObject, XmlComponent } from '
|
|
2
|
+
import { IXmlableObject, XmlComponent } from '.';
|
|
3
3
|
import { IContext } from "./base";
|
|
4
4
|
export declare const convertToXmlComponent: (element: XmlElement) => ImportedXmlComponent | string | undefined;
|
|
5
5
|
export declare class ImportedXmlComponent extends XmlComponent {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AttributeData, AttributePayload, XmlComponent } from '
|
|
1
|
+
import { AttributeData, AttributePayload, XmlComponent } from '.';
|
|
2
2
|
import { PositiveUniversalMeasure } from '../../util/values';
|
|
3
3
|
export declare class OnOffElement extends XmlComponent {
|
|
4
4
|
constructor(name: string, val?: boolean | undefined);
|
|
@@ -11,6 +11,7 @@ export declare class EmptyElement extends XmlComponent {
|
|
|
11
11
|
export declare class StringValueElement extends XmlComponent {
|
|
12
12
|
constructor(name: string, val: string);
|
|
13
13
|
}
|
|
14
|
+
export declare const createStringElement: (name: string, value: string) => XmlComponent;
|
|
14
15
|
export declare class NumberValueElement extends XmlComponent {
|
|
15
16
|
constructor(name: string, val: number);
|
|
16
17
|
}
|
|
@@ -21,7 +22,7 @@ export declare class StringContainer extends XmlComponent {
|
|
|
21
22
|
constructor(name: string, val: string);
|
|
22
23
|
}
|
|
23
24
|
export declare class BuilderElement<T extends AttributeData> extends XmlComponent {
|
|
24
|
-
constructor(
|
|
25
|
+
constructor({ name, attributes, children, }: {
|
|
25
26
|
readonly name: string;
|
|
26
27
|
readonly attributes?: AttributePayload<T>;
|
|
27
28
|
readonly children?: readonly XmlComponent[];
|