ts-d2 0.0.1 → 0.0.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.
@@ -0,0 +1,338 @@
1
+ import Proto, { Node, ProtoFont } from 'docframe-types';
2
+
3
+ declare abstract class DocumentElement {
4
+ abstract toDocFrame(): Proto.Node;
5
+ }
6
+ type Content = string | DocumentElement | (DocumentElement | string)[];
7
+
8
+ declare class Text extends DocumentElement {
9
+ constructor(content: string);
10
+ content: string;
11
+ toDocFrame(): Proto.Node;
12
+ }
13
+
14
+ declare abstract class BranchDocumentElement<P = never> extends DocumentElement {
15
+ protected children: DocumentElement[];
16
+ protected _props?: P;
17
+ constructor(children?: Content, props?: P);
18
+ appendChildren(children: DocumentElement[]): void;
19
+ appendChild(child: DocumentElement): void;
20
+ prependChildren(children: DocumentElement[]): void;
21
+ prependChild(child: DocumentElement): void;
22
+ childrenToDocFrame(): Node[];
23
+ set props(props: P | undefined);
24
+ get props(): P | undefined;
25
+ }
26
+
27
+ type AbsoluteMeasureUnit = "pt" | "cm" | "mm" | "in" | "px";
28
+ type RelativeMeasureUnit = "%";
29
+ type MeasureUnit = AbsoluteMeasureUnit | RelativeMeasureUnit;
30
+ declare class Measure$1<Unit = MeasureUnit> {
31
+ readonly value: number;
32
+ readonly unit: Unit;
33
+ static zero: Measure$1<AbsoluteMeasureUnit>;
34
+ constructor(value: number, unit: Unit);
35
+ toDocFrame(): Proto.ProtoMeasure;
36
+ }
37
+ declare class AbsoluteMeasure extends Measure$1<AbsoluteMeasureUnit> {
38
+ }
39
+ type Sides<T> = {
40
+ top?: T;
41
+ right?: T;
42
+ bottom?: T;
43
+ left?: T;
44
+ };
45
+ declare class SideMeasures {
46
+ value: Sides<AbsoluteMeasure>;
47
+ constructor(settings: Sides<AbsoluteMeasure>);
48
+ toDocFrame(): Proto.ProtoSideMeasures;
49
+ }
50
+
51
+ interface TableRowProperties {
52
+ minHeight?: AbsoluteMeasure;
53
+ }
54
+ declare class TableRow extends BranchDocumentElement<TableRowProperties> {
55
+ constructor(content?: Content, props?: TableRowProperties);
56
+ toDocFrame(): Proto.Node;
57
+ }
58
+
59
+ type Measure_AbsoluteMeasure = AbsoluteMeasure;
60
+ declare const Measure_AbsoluteMeasure: typeof AbsoluteMeasure;
61
+ type Measure_SideMeasures = SideMeasures;
62
+ declare const Measure_SideMeasures: typeof SideMeasures;
63
+ type Measure_Sides<T> = Sides<T>;
64
+ declare namespace Measure {
65
+ export { Measure_AbsoluteMeasure as AbsoluteMeasure, Measure$1 as Measure, Measure_SideMeasures as SideMeasures, type Measure_Sides as Sides };
66
+ }
67
+
68
+ declare class HorizontalAlignment {
69
+ readonly value: Proto.ProtoHorizontalAlignment;
70
+ constructor(value: Proto.ProtoHorizontalAlignment);
71
+ toDocFrame(): Proto.ProtoHorizontalAlignment;
72
+ }
73
+ declare class VerticalAlignment {
74
+ readonly value: Proto.ProtoVerticalAlignment;
75
+ constructor(value: Proto.ProtoVerticalAlignment);
76
+ toDocFrame(): Proto.ProtoVerticalAlignment;
77
+ }
78
+
79
+ declare class Color {
80
+ private color;
81
+ static rgb(r: number, g: number, b: number): Color;
82
+ static cmyk(c: number, m: number, y: number, k: number): Color;
83
+ static fromHex(hex: string): Color;
84
+ private constructor();
85
+ toDocFrame(): Proto.ProtoColor;
86
+ }
87
+ declare namespace Colors {
88
+ const white: Color;
89
+ const black: Color;
90
+ }
91
+
92
+ declare class Border {
93
+ width: AbsoluteMeasure;
94
+ color: Color;
95
+ constructor(width: AbsoluteMeasure, color: Color);
96
+ toDocFrame(): Proto.ProtoBorder;
97
+ }
98
+ declare class SideBorders {
99
+ value: Sides<Border>;
100
+ constructor(settings: Sides<Border>);
101
+ toDocFrame(): Proto.ProtoSideBorders;
102
+ }
103
+
104
+ interface TableCellProperties {
105
+ alignment?: HorizontalAlignment;
106
+ backgroundColor?: Color;
107
+ border?: SideBorders;
108
+ margin?: SideMeasures;
109
+ padding?: SideMeasures;
110
+ verticalAlignment?: VerticalAlignment;
111
+ width?: Measure$1;
112
+ }
113
+ declare class TableCell extends BranchDocumentElement<TableCellProperties> {
114
+ constructor(content?: Content, props?: TableCellProperties);
115
+ toDocFrame(): Proto.Node;
116
+ }
117
+
118
+ interface TableSettings {
119
+ width?: Measure$1;
120
+ xOffset?: Measure$1;
121
+ }
122
+ declare class Table extends BranchDocumentElement<TableSettings> {
123
+ constructor(content?: Content, props?: TableSettings);
124
+ toDocFrame(): Proto.Node;
125
+ }
126
+
127
+ declare class SpaceVertically extends DocumentElement {
128
+ space: AbsoluteMeasure;
129
+ constructor(space: AbsoluteMeasure);
130
+ toDocFrame(): Proto.Node;
131
+ }
132
+
133
+ declare class Font {
134
+ private name;
135
+ constructor(name: string);
136
+ toDocFrame(): ProtoFont;
137
+ }
138
+
139
+ interface ParagraphFormatProperties {
140
+ default?: boolean;
141
+ name?: string;
142
+ alignment?: HorizontalAlignment;
143
+ font?: Font;
144
+ fontSize?: AbsoluteMeasure;
145
+ characterWidth?: AbsoluteMeasure;
146
+ characterSpacing?: AbsoluteMeasure;
147
+ lineFeed?: AbsoluteMeasure;
148
+ bold?: boolean;
149
+ italic?: boolean;
150
+ indentionLevel?: number;
151
+ indentionWidth?: AbsoluteMeasure;
152
+ spaceAbove?: AbsoluteMeasure;
153
+ spaceBelow?: AbsoluteMeasure;
154
+ }
155
+ declare class ParagraphFormat {
156
+ props: ParagraphFormatProperties;
157
+ constructor(props: ParagraphFormatProperties);
158
+ toDocFrame(): Proto.IProtoParagraphFormat;
159
+ }
160
+
161
+ interface ParagraphSettings {
162
+ paragraphFormatName?: string;
163
+ overwrite?: ParagraphFormat;
164
+ }
165
+ declare class Paragraph extends BranchDocumentElement<ParagraphSettings> {
166
+ constructor(content?: Content, paragraphFormatName?: string | ParagraphFormat, overwrite?: ParagraphFormat);
167
+ toDocFrame(): Proto.Node;
168
+ }
169
+
170
+ declare class Pagebreak extends DocumentElement {
171
+ toDocFrame(): Proto.Node;
172
+ }
173
+
174
+ declare class PageDefinition {
175
+ width?: AbsoluteMeasure;
176
+ height?: AbsoluteMeasure;
177
+ uuid: string;
178
+ constructor(width?: AbsoluteMeasure, height?: AbsoluteMeasure);
179
+ toDocFrame(): Proto.ProtoPDef;
180
+ }
181
+
182
+ declare class Formatted extends DocumentElement {
183
+ constructor(doctypeContent: string | undefined, htmlContent?: string);
184
+ content: {
185
+ doctype: string | undefined;
186
+ html: string | undefined;
187
+ };
188
+ toDocFrame(): Proto.Node;
189
+ }
190
+
191
+ declare enum OutputFormat {
192
+ PDF = "pdf",
193
+ PNG = "png",
194
+ JPEG = "jpeg",
195
+ HTML = "html",
196
+ PS = "ps",
197
+ TEXT = "text"
198
+ }
199
+ interface OutputParams {
200
+ [OutputFormat.HTML]: {};
201
+ [OutputFormat.PDF]: {};
202
+ [OutputFormat.JPEG]: {};
203
+ [OutputFormat.PS]: {};
204
+ [OutputFormat.TEXT]: {};
205
+ [OutputFormat.PNG]: {
206
+ /**
207
+ * The width of the output in pixels.
208
+ * @default The width of the document in pixels.
209
+ */
210
+ width?: number;
211
+ /**
212
+ * The height of the output in pixels.
213
+ * @default The height of the document in pixels.
214
+ */
215
+ height?: number;
216
+ /**
217
+ * The resolution of the output in pixels per inch.
218
+ * @default 300 dpi.
219
+ */
220
+ dpi?: number;
221
+ };
222
+ }
223
+
224
+ declare class ColumnPositionMode {
225
+ readonly value: Proto.ProtoPositionMode;
226
+ constructor(value: Proto.ProtoPositionMode);
227
+ toDocFrame(): Proto.ProtoPositionMode;
228
+ }
229
+ declare namespace ColumnPosition {
230
+ const Center: ColumnPositionMode;
231
+ const Left: ColumnPositionMode;
232
+ const Folio: ColumnPositionMode;
233
+ const Right: ColumnPositionMode;
234
+ const ReverseFolio: ColumnPositionMode;
235
+ }
236
+ interface ColumnDefinitionProperties {
237
+ width: AbsoluteMeasure;
238
+ position: ColumnPositionMode;
239
+ interColumnSpace: AbsoluteMeasure;
240
+ positionOffset: AbsoluteMeasure;
241
+ }
242
+ declare class ColumnDefinition {
243
+ props: ColumnDefinitionProperties;
244
+ uuid: string;
245
+ constructor(props: ColumnDefinitionProperties);
246
+ toDocFrame(applyImmediate: boolean): Proto.Node[];
247
+ }
248
+
249
+ declare class Footer extends BranchDocumentElement {
250
+ toDocFrame(): Proto.Node;
251
+ }
252
+
253
+ declare class Header extends BranchDocumentElement<never> {
254
+ toDocFrame(): Proto.Node;
255
+ }
256
+
257
+ interface DocumentProperties {
258
+ pageDefinition: PageDefinition;
259
+ columnDefinition: ColumnDefinition;
260
+ defaultHeader?: Header;
261
+ defaultFooter?: Footer;
262
+ paragraphFormats?: Record<string, ParagraphFormat>;
263
+ }
264
+ declare class Document extends BranchDocumentElement<DocumentProperties> {
265
+ paragraphFormats: Record<string, ParagraphFormat>;
266
+ constructor(content?: Content, props?: DocumentProperties);
267
+ getParagraphFormat(name: string): ParagraphFormat | undefined;
268
+ registerParagraphFormat(name: string, pf: ParagraphFormat): void;
269
+ convertTo<Format extends keyof OutputParams>(outputFormat: Format, outputParams?: OutputParams[Format]): Promise<Blob>;
270
+ convertToPDF(outputParams?: OutputParams["pdf"]): Promise<Blob>;
271
+ toDocFrame(): Proto.Node;
272
+ }
273
+
274
+ /**
275
+ * A ReferencePoint is used for elements like barcodes to specify the reference point
276
+ * of an object.
277
+ * Example:
278
+ * When specified reference point "top-left", the top-left point of a barcode is positioned
279
+ * relative to the top-left edge of the current line or page.
280
+ */
281
+ type ReferencePoint = "top-left" | "top-right" | "center" | "bottom-left" | "bottom-right";
282
+
283
+ interface BarcodeProperties {
284
+ type: Proto.ProtoBarcodeType;
285
+ x: AbsoluteMeasure;
286
+ y: AbsoluteMeasure;
287
+ referencePoint: ReferencePoint;
288
+ /**
289
+ * Rotation in degrees, counter-clockwise
290
+ */
291
+ rotation: number;
292
+ width: AbsoluteMeasure;
293
+ height: AbsoluteMeasure;
294
+ data: string;
295
+ positionAbsolute: boolean;
296
+ }
297
+ declare class Barcode extends DocumentElement {
298
+ props: BarcodeProperties;
299
+ constructor(props: BarcodeProperties);
300
+ toDocFrame(): Proto.Node;
301
+ }
302
+
303
+ declare const _default: {
304
+ Border: {
305
+ Border: typeof Border;
306
+ SideBorders: typeof SideBorders;
307
+ };
308
+ Color: {
309
+ Color: typeof Color;
310
+ Colors: typeof Colors;
311
+ };
312
+ Content: {
313
+ Barcode: typeof Barcode;
314
+ ColumnDefinition: typeof ColumnDefinition;
315
+ ColumnPosition: typeof ColumnPosition;
316
+ Document: typeof Document;
317
+ Formatted: typeof Formatted;
318
+ PageDefinition: typeof PageDefinition;
319
+ Pagebreak: typeof Pagebreak;
320
+ Paragraph: typeof Paragraph;
321
+ SpaceVertically: typeof SpaceVertically;
322
+ Table: typeof Table;
323
+ TableCell: typeof TableCell;
324
+ TableRow: typeof TableRow;
325
+ Text: typeof Text;
326
+ };
327
+ Font: {
328
+ Font: typeof Font;
329
+ StandardFonts: {
330
+ Helvetica: Font;
331
+ };
332
+ };
333
+ Measure: typeof Measure;
334
+ OutputFormat: typeof OutputFormat;
335
+ ParagraphFormat: typeof ParagraphFormat;
336
+ };
337
+
338
+ export { _default as default };
@@ -0,0 +1,338 @@
1
+ import Proto, { Node, ProtoFont } from 'docframe-types';
2
+
3
+ declare abstract class DocumentElement {
4
+ abstract toDocFrame(): Proto.Node;
5
+ }
6
+ type Content = string | DocumentElement | (DocumentElement | string)[];
7
+
8
+ declare class Text extends DocumentElement {
9
+ constructor(content: string);
10
+ content: string;
11
+ toDocFrame(): Proto.Node;
12
+ }
13
+
14
+ declare abstract class BranchDocumentElement<P = never> extends DocumentElement {
15
+ protected children: DocumentElement[];
16
+ protected _props?: P;
17
+ constructor(children?: Content, props?: P);
18
+ appendChildren(children: DocumentElement[]): void;
19
+ appendChild(child: DocumentElement): void;
20
+ prependChildren(children: DocumentElement[]): void;
21
+ prependChild(child: DocumentElement): void;
22
+ childrenToDocFrame(): Node[];
23
+ set props(props: P | undefined);
24
+ get props(): P | undefined;
25
+ }
26
+
27
+ type AbsoluteMeasureUnit = "pt" | "cm" | "mm" | "in" | "px";
28
+ type RelativeMeasureUnit = "%";
29
+ type MeasureUnit = AbsoluteMeasureUnit | RelativeMeasureUnit;
30
+ declare class Measure$1<Unit = MeasureUnit> {
31
+ readonly value: number;
32
+ readonly unit: Unit;
33
+ static zero: Measure$1<AbsoluteMeasureUnit>;
34
+ constructor(value: number, unit: Unit);
35
+ toDocFrame(): Proto.ProtoMeasure;
36
+ }
37
+ declare class AbsoluteMeasure extends Measure$1<AbsoluteMeasureUnit> {
38
+ }
39
+ type Sides<T> = {
40
+ top?: T;
41
+ right?: T;
42
+ bottom?: T;
43
+ left?: T;
44
+ };
45
+ declare class SideMeasures {
46
+ value: Sides<AbsoluteMeasure>;
47
+ constructor(settings: Sides<AbsoluteMeasure>);
48
+ toDocFrame(): Proto.ProtoSideMeasures;
49
+ }
50
+
51
+ interface TableRowProperties {
52
+ minHeight?: AbsoluteMeasure;
53
+ }
54
+ declare class TableRow extends BranchDocumentElement<TableRowProperties> {
55
+ constructor(content?: Content, props?: TableRowProperties);
56
+ toDocFrame(): Proto.Node;
57
+ }
58
+
59
+ type Measure_AbsoluteMeasure = AbsoluteMeasure;
60
+ declare const Measure_AbsoluteMeasure: typeof AbsoluteMeasure;
61
+ type Measure_SideMeasures = SideMeasures;
62
+ declare const Measure_SideMeasures: typeof SideMeasures;
63
+ type Measure_Sides<T> = Sides<T>;
64
+ declare namespace Measure {
65
+ export { Measure_AbsoluteMeasure as AbsoluteMeasure, Measure$1 as Measure, Measure_SideMeasures as SideMeasures, type Measure_Sides as Sides };
66
+ }
67
+
68
+ declare class HorizontalAlignment {
69
+ readonly value: Proto.ProtoHorizontalAlignment;
70
+ constructor(value: Proto.ProtoHorizontalAlignment);
71
+ toDocFrame(): Proto.ProtoHorizontalAlignment;
72
+ }
73
+ declare class VerticalAlignment {
74
+ readonly value: Proto.ProtoVerticalAlignment;
75
+ constructor(value: Proto.ProtoVerticalAlignment);
76
+ toDocFrame(): Proto.ProtoVerticalAlignment;
77
+ }
78
+
79
+ declare class Color {
80
+ private color;
81
+ static rgb(r: number, g: number, b: number): Color;
82
+ static cmyk(c: number, m: number, y: number, k: number): Color;
83
+ static fromHex(hex: string): Color;
84
+ private constructor();
85
+ toDocFrame(): Proto.ProtoColor;
86
+ }
87
+ declare namespace Colors {
88
+ const white: Color;
89
+ const black: Color;
90
+ }
91
+
92
+ declare class Border {
93
+ width: AbsoluteMeasure;
94
+ color: Color;
95
+ constructor(width: AbsoluteMeasure, color: Color);
96
+ toDocFrame(): Proto.ProtoBorder;
97
+ }
98
+ declare class SideBorders {
99
+ value: Sides<Border>;
100
+ constructor(settings: Sides<Border>);
101
+ toDocFrame(): Proto.ProtoSideBorders;
102
+ }
103
+
104
+ interface TableCellProperties {
105
+ alignment?: HorizontalAlignment;
106
+ backgroundColor?: Color;
107
+ border?: SideBorders;
108
+ margin?: SideMeasures;
109
+ padding?: SideMeasures;
110
+ verticalAlignment?: VerticalAlignment;
111
+ width?: Measure$1;
112
+ }
113
+ declare class TableCell extends BranchDocumentElement<TableCellProperties> {
114
+ constructor(content?: Content, props?: TableCellProperties);
115
+ toDocFrame(): Proto.Node;
116
+ }
117
+
118
+ interface TableSettings {
119
+ width?: Measure$1;
120
+ xOffset?: Measure$1;
121
+ }
122
+ declare class Table extends BranchDocumentElement<TableSettings> {
123
+ constructor(content?: Content, props?: TableSettings);
124
+ toDocFrame(): Proto.Node;
125
+ }
126
+
127
+ declare class SpaceVertically extends DocumentElement {
128
+ space: AbsoluteMeasure;
129
+ constructor(space: AbsoluteMeasure);
130
+ toDocFrame(): Proto.Node;
131
+ }
132
+
133
+ declare class Font {
134
+ private name;
135
+ constructor(name: string);
136
+ toDocFrame(): ProtoFont;
137
+ }
138
+
139
+ interface ParagraphFormatProperties {
140
+ default?: boolean;
141
+ name?: string;
142
+ alignment?: HorizontalAlignment;
143
+ font?: Font;
144
+ fontSize?: AbsoluteMeasure;
145
+ characterWidth?: AbsoluteMeasure;
146
+ characterSpacing?: AbsoluteMeasure;
147
+ lineFeed?: AbsoluteMeasure;
148
+ bold?: boolean;
149
+ italic?: boolean;
150
+ indentionLevel?: number;
151
+ indentionWidth?: AbsoluteMeasure;
152
+ spaceAbove?: AbsoluteMeasure;
153
+ spaceBelow?: AbsoluteMeasure;
154
+ }
155
+ declare class ParagraphFormat {
156
+ props: ParagraphFormatProperties;
157
+ constructor(props: ParagraphFormatProperties);
158
+ toDocFrame(): Proto.IProtoParagraphFormat;
159
+ }
160
+
161
+ interface ParagraphSettings {
162
+ paragraphFormatName?: string;
163
+ overwrite?: ParagraphFormat;
164
+ }
165
+ declare class Paragraph extends BranchDocumentElement<ParagraphSettings> {
166
+ constructor(content?: Content, paragraphFormatName?: string | ParagraphFormat, overwrite?: ParagraphFormat);
167
+ toDocFrame(): Proto.Node;
168
+ }
169
+
170
+ declare class Pagebreak extends DocumentElement {
171
+ toDocFrame(): Proto.Node;
172
+ }
173
+
174
+ declare class PageDefinition {
175
+ width?: AbsoluteMeasure;
176
+ height?: AbsoluteMeasure;
177
+ uuid: string;
178
+ constructor(width?: AbsoluteMeasure, height?: AbsoluteMeasure);
179
+ toDocFrame(): Proto.ProtoPDef;
180
+ }
181
+
182
+ declare class Formatted extends DocumentElement {
183
+ constructor(doctypeContent: string | undefined, htmlContent?: string);
184
+ content: {
185
+ doctype: string | undefined;
186
+ html: string | undefined;
187
+ };
188
+ toDocFrame(): Proto.Node;
189
+ }
190
+
191
+ declare enum OutputFormat {
192
+ PDF = "pdf",
193
+ PNG = "png",
194
+ JPEG = "jpeg",
195
+ HTML = "html",
196
+ PS = "ps",
197
+ TEXT = "text"
198
+ }
199
+ interface OutputParams {
200
+ [OutputFormat.HTML]: {};
201
+ [OutputFormat.PDF]: {};
202
+ [OutputFormat.JPEG]: {};
203
+ [OutputFormat.PS]: {};
204
+ [OutputFormat.TEXT]: {};
205
+ [OutputFormat.PNG]: {
206
+ /**
207
+ * The width of the output in pixels.
208
+ * @default The width of the document in pixels.
209
+ */
210
+ width?: number;
211
+ /**
212
+ * The height of the output in pixels.
213
+ * @default The height of the document in pixels.
214
+ */
215
+ height?: number;
216
+ /**
217
+ * The resolution of the output in pixels per inch.
218
+ * @default 300 dpi.
219
+ */
220
+ dpi?: number;
221
+ };
222
+ }
223
+
224
+ declare class ColumnPositionMode {
225
+ readonly value: Proto.ProtoPositionMode;
226
+ constructor(value: Proto.ProtoPositionMode);
227
+ toDocFrame(): Proto.ProtoPositionMode;
228
+ }
229
+ declare namespace ColumnPosition {
230
+ const Center: ColumnPositionMode;
231
+ const Left: ColumnPositionMode;
232
+ const Folio: ColumnPositionMode;
233
+ const Right: ColumnPositionMode;
234
+ const ReverseFolio: ColumnPositionMode;
235
+ }
236
+ interface ColumnDefinitionProperties {
237
+ width: AbsoluteMeasure;
238
+ position: ColumnPositionMode;
239
+ interColumnSpace: AbsoluteMeasure;
240
+ positionOffset: AbsoluteMeasure;
241
+ }
242
+ declare class ColumnDefinition {
243
+ props: ColumnDefinitionProperties;
244
+ uuid: string;
245
+ constructor(props: ColumnDefinitionProperties);
246
+ toDocFrame(applyImmediate: boolean): Proto.Node[];
247
+ }
248
+
249
+ declare class Footer extends BranchDocumentElement {
250
+ toDocFrame(): Proto.Node;
251
+ }
252
+
253
+ declare class Header extends BranchDocumentElement<never> {
254
+ toDocFrame(): Proto.Node;
255
+ }
256
+
257
+ interface DocumentProperties {
258
+ pageDefinition: PageDefinition;
259
+ columnDefinition: ColumnDefinition;
260
+ defaultHeader?: Header;
261
+ defaultFooter?: Footer;
262
+ paragraphFormats?: Record<string, ParagraphFormat>;
263
+ }
264
+ declare class Document extends BranchDocumentElement<DocumentProperties> {
265
+ paragraphFormats: Record<string, ParagraphFormat>;
266
+ constructor(content?: Content, props?: DocumentProperties);
267
+ getParagraphFormat(name: string): ParagraphFormat | undefined;
268
+ registerParagraphFormat(name: string, pf: ParagraphFormat): void;
269
+ convertTo<Format extends keyof OutputParams>(outputFormat: Format, outputParams?: OutputParams[Format]): Promise<Blob>;
270
+ convertToPDF(outputParams?: OutputParams["pdf"]): Promise<Blob>;
271
+ toDocFrame(): Proto.Node;
272
+ }
273
+
274
+ /**
275
+ * A ReferencePoint is used for elements like barcodes to specify the reference point
276
+ * of an object.
277
+ * Example:
278
+ * When specified reference point "top-left", the top-left point of a barcode is positioned
279
+ * relative to the top-left edge of the current line or page.
280
+ */
281
+ type ReferencePoint = "top-left" | "top-right" | "center" | "bottom-left" | "bottom-right";
282
+
283
+ interface BarcodeProperties {
284
+ type: Proto.ProtoBarcodeType;
285
+ x: AbsoluteMeasure;
286
+ y: AbsoluteMeasure;
287
+ referencePoint: ReferencePoint;
288
+ /**
289
+ * Rotation in degrees, counter-clockwise
290
+ */
291
+ rotation: number;
292
+ width: AbsoluteMeasure;
293
+ height: AbsoluteMeasure;
294
+ data: string;
295
+ positionAbsolute: boolean;
296
+ }
297
+ declare class Barcode extends DocumentElement {
298
+ props: BarcodeProperties;
299
+ constructor(props: BarcodeProperties);
300
+ toDocFrame(): Proto.Node;
301
+ }
302
+
303
+ declare const _default: {
304
+ Border: {
305
+ Border: typeof Border;
306
+ SideBorders: typeof SideBorders;
307
+ };
308
+ Color: {
309
+ Color: typeof Color;
310
+ Colors: typeof Colors;
311
+ };
312
+ Content: {
313
+ Barcode: typeof Barcode;
314
+ ColumnDefinition: typeof ColumnDefinition;
315
+ ColumnPosition: typeof ColumnPosition;
316
+ Document: typeof Document;
317
+ Formatted: typeof Formatted;
318
+ PageDefinition: typeof PageDefinition;
319
+ Pagebreak: typeof Pagebreak;
320
+ Paragraph: typeof Paragraph;
321
+ SpaceVertically: typeof SpaceVertically;
322
+ Table: typeof Table;
323
+ TableCell: typeof TableCell;
324
+ TableRow: typeof TableRow;
325
+ Text: typeof Text;
326
+ };
327
+ Font: {
328
+ Font: typeof Font;
329
+ StandardFonts: {
330
+ Helvetica: Font;
331
+ };
332
+ };
333
+ Measure: typeof Measure;
334
+ OutputFormat: typeof OutputFormat;
335
+ ParagraphFormat: typeof ParagraphFormat;
336
+ };
337
+
338
+ export { _default as default };