@syncfusion/ej2-docx-renderer 0.0.0-stage → 35.2.15
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 +2 -2
- package/base.d.ts +4 -0
- package/base.js +4 -0
- package/dist/ej2-docx-renderer.umd.min.js +2 -0
- package/dist/ej2-docx-renderer.umd.min.js.map +1 -0
- package/dist/es6/ej2-docx-renderer.es2015.js +52432 -0
- package/dist/es6/ej2-docx-renderer.es2015.js.map +1 -0
- package/dist/es6/ej2-docx-renderer.es5.js +54425 -0
- package/dist/es6/ej2-docx-renderer.es5.js.map +1 -0
- package/dist/global/ej2-docx-renderer.min.js +2 -0
- package/dist/global/ej2-docx-renderer.min.js.map +1 -0
- package/dist/global/index.d.ts +5 -0
- package/format.d.ts +4 -0
- package/format.js +4 -0
- package/helper.d.ts +4 -0
- package/helper.js +4 -0
- package/index.d.ts +4 -0
- package/index.js +4 -0
- package/license +10 -0
- package/list.d.ts +4 -0
- package/list.js +4 -0
- package/package.json +26 -4
- package/parser.d.ts +4 -0
- package/parser.js +4 -0
- package/src/base/constants.d.ts +2 -0
- package/src/base/constants.js +2 -0
- package/src/base/dictionary.d.ts +52 -0
- package/src/base/dictionary.js +137 -0
- package/src/base/index.d.ts +9 -0
- package/src/base/index.js +9 -0
- package/src/base/keywords.d.ts +422 -0
- package/src/base/keywords.js +422 -0
- package/src/base/types.d.ts +2590 -0
- package/src/base/types.js +1056 -0
- package/src/base/unique-format.d.ts +87 -0
- package/src/base/unique-format.js +858 -0
- package/src/base/unique-formats.d.ts +32 -0
- package/src/base/unique-formats.js +87 -0
- package/src/document-canvas.d.ts +61 -0
- package/src/document-canvas.js +221 -0
- package/src/docx-renderer.d.ts +941 -0
- package/src/docx-renderer.js +2251 -0
- package/src/format/border.d.ts +53 -0
- package/src/format/border.js +600 -0
- package/src/format/borders.d.ts +44 -0
- package/src/format/borders.js +314 -0
- package/src/format/cell-format.d.ts +42 -0
- package/src/format/cell-format.js +309 -0
- package/src/format/character-format.d.ts +152 -0
- package/src/format/character-format.js +1224 -0
- package/src/format/index.d.ts +14 -0
- package/src/format/index.js +14 -0
- package/src/format/list-format.d.ts +32 -0
- package/src/format/list-format.js +238 -0
- package/src/format/paragraph-format.d.ts +103 -0
- package/src/format/paragraph-format.js +854 -0
- package/src/format/row-format.d.ts +119 -0
- package/src/format/row-format.js +545 -0
- package/src/format/section-format.d.ts +89 -0
- package/src/format/section-format.js +689 -0
- package/src/format/shading.d.ts +24 -0
- package/src/format/shading.js +137 -0
- package/src/format/style.d.ts +106 -0
- package/src/format/style.js +286 -0
- package/src/format/table-format.d.ts +51 -0
- package/src/format/table-format.js +395 -0
- package/src/global.js +1 -0
- package/src/helper/document-editor-helper.d.ts +515 -0
- package/src/helper/document-editor-helper.js +1302 -0
- package/src/helper/document-editor-settings.d.ts +293 -0
- package/src/helper/document-editor-settings.js +94 -0
- package/src/helper/index.d.ts +5 -0
- package/src/helper/index.js +5 -0
- package/src/helper/layout-helper-methods.d.ts +539 -0
- package/src/helper/layout-helper-methods.js +1065 -0
- package/src/helper/renderer-hooks.d.ts +74 -0
- package/src/helper/renderer-hooks.js +14 -0
- package/src/helper/revision-helper-methods.d.ts +199 -0
- package/src/helper/revision-helper-methods.js +362 -0
- package/src/index.d.ts +18 -0
- package/src/index.js +18 -0
- package/src/layout-helper.d.ts +190 -0
- package/src/layout-helper.js +1368 -0
- package/src/layout.d.ts +779 -0
- package/src/layout.js +17232 -0
- package/src/list/abstract-list.d.ts +25 -0
- package/src/list/abstract-list.js +67 -0
- package/src/list/index.d.ts +7 -0
- package/src/list/index.js +7 -0
- package/src/list/level-override.d.ts +22 -0
- package/src/list/level-override.js +43 -0
- package/src/list/list-level.d.ts +57 -0
- package/src/list/list-level.js +249 -0
- package/src/list/list.d.ts +30 -0
- package/src/list/list.js +100 -0
- package/src/page.d.ts +4155 -0
- package/src/page.js +11342 -0
- package/src/parser/index.d.ts +1 -0
- package/src/parser/index.js +1 -0
- package/src/parser/sfdt-reader.d.ts +254 -0
- package/src/parser/sfdt-reader.js +4569 -0
- package/src/render.d.ts +226 -0
- package/src/render.js +4222 -0
- package/src/text-helper.d.ts +144 -0
- package/src/text-helper.js +1079 -0
- package/src/text-helpers/index.d.ts +2 -0
- package/src/text-helpers/index.js +2 -0
- package/src/text-helpers/optimized.d.ts +45 -0
- package/src/text-helpers/optimized.js +121 -0
- package/src/text-helpers/regular.d.ts +37 -0
- package/src/text-helpers/regular.js +93 -0
- package/src/themes/font-scheme.d.ts +28 -0
- package/src/themes/font-scheme.js +107 -0
- package/src/themes/index.d.ts +6 -0
- package/src/themes/index.js +6 -0
- package/src/themes/major-minor-font-scheme.d.ts +14 -0
- package/src/themes/major-minor-font-scheme.js +45 -0
- package/src/themes/themes.d.ts +11 -0
- package/src/themes/themes.js +31 -0
- package/src/utility/index.d.ts +1 -0
- package/src/utility/index.js +1 -0
- package/src/utility/path-util.d.ts +133 -0
- package/src/utility/path-util.js +639 -0
- package/text-helpers.d.ts +4 -0
- package/text-helpers.js +4 -0
- package/themes.d.ts +4 -0
- package/themes.js +4 -0
- package/utility.d.ts +4 -0
- package/utility.js +4 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { WUniqueFormat } from './unique-format';
|
|
2
|
+
import { Dictionary } from './dictionary';
|
|
3
|
+
/**
|
|
4
|
+
* @private
|
|
5
|
+
*/
|
|
6
|
+
export declare class WUniqueFormats {
|
|
7
|
+
/**
|
|
8
|
+
* @private
|
|
9
|
+
*/
|
|
10
|
+
items: WUniqueFormat[];
|
|
11
|
+
constructor();
|
|
12
|
+
/**
|
|
13
|
+
* @private
|
|
14
|
+
*/
|
|
15
|
+
addUniqueFormat(format: Dictionary<number, object>, type: number): WUniqueFormat;
|
|
16
|
+
/**
|
|
17
|
+
* @private
|
|
18
|
+
*/
|
|
19
|
+
updateUniqueFormat(uniqueFormat: WUniqueFormat, property: string, value: object): WUniqueFormat;
|
|
20
|
+
/**
|
|
21
|
+
* @private
|
|
22
|
+
*/
|
|
23
|
+
remove(uniqueFormat: WUniqueFormat): void;
|
|
24
|
+
/**
|
|
25
|
+
* @private
|
|
26
|
+
*/
|
|
27
|
+
clear(): void;
|
|
28
|
+
/**
|
|
29
|
+
* @private
|
|
30
|
+
*/
|
|
31
|
+
destroy(): void;
|
|
32
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import { isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
3
|
+
import { WUniqueFormat } from './unique-format';
|
|
4
|
+
/**
|
|
5
|
+
* @private
|
|
6
|
+
*/
|
|
7
|
+
var WUniqueFormats = /** @class */ (function () {
|
|
8
|
+
function WUniqueFormats() {
|
|
9
|
+
this.items = [];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @private
|
|
13
|
+
*/
|
|
14
|
+
WUniqueFormats.prototype.addUniqueFormat = function (format, type) {
|
|
15
|
+
var matchedFormat = undefined;
|
|
16
|
+
for (var i = 0; i < this.items.length; i++) {
|
|
17
|
+
if (this.items[i].isEqual(format, undefined, undefined)) {
|
|
18
|
+
matchedFormat = this.items[i];
|
|
19
|
+
break;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
if (isNullOrUndefined(matchedFormat)) {
|
|
23
|
+
matchedFormat = new WUniqueFormat(type);
|
|
24
|
+
matchedFormat.propertiesHash = format;
|
|
25
|
+
matchedFormat.referenceCount = 1;
|
|
26
|
+
this.items.push(matchedFormat);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
matchedFormat.referenceCount++;
|
|
30
|
+
}
|
|
31
|
+
return matchedFormat;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* @private
|
|
35
|
+
*/
|
|
36
|
+
WUniqueFormats.prototype.updateUniqueFormat = function (uniqueFormat, property, value) {
|
|
37
|
+
var matchedFormat = undefined;
|
|
38
|
+
for (var i = 0; i < this.items.length; i++) {
|
|
39
|
+
if (this.items[i].isEqual(uniqueFormat.propertiesHash, property, value)) {
|
|
40
|
+
matchedFormat = this.items[i];
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (isNullOrUndefined(matchedFormat)) {
|
|
45
|
+
matchedFormat = new WUniqueFormat(uniqueFormat.uniqueFormatType);
|
|
46
|
+
matchedFormat.cloneItems(uniqueFormat, property, value, uniqueFormat.uniqueFormatType);
|
|
47
|
+
matchedFormat.referenceCount = 1;
|
|
48
|
+
this.items.push(matchedFormat);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
matchedFormat.referenceCount++;
|
|
52
|
+
}
|
|
53
|
+
this.remove(uniqueFormat);
|
|
54
|
+
return matchedFormat;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* @private
|
|
58
|
+
*/
|
|
59
|
+
WUniqueFormats.prototype.remove = function (uniqueFormat) {
|
|
60
|
+
uniqueFormat.referenceCount--;
|
|
61
|
+
if (uniqueFormat.referenceCount <= 0) {
|
|
62
|
+
this.items.splice(this.items.indexOf(uniqueFormat), 1);
|
|
63
|
+
uniqueFormat.destroy();
|
|
64
|
+
uniqueFormat = undefined;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* @private
|
|
69
|
+
*/
|
|
70
|
+
WUniqueFormats.prototype.clear = function () {
|
|
71
|
+
if (isNullOrUndefined(this.items)) {
|
|
72
|
+
for (var i = 0; i < this.items.length; i++) {
|
|
73
|
+
this.items[i].destroy();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
this.items = [];
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* @private
|
|
80
|
+
*/
|
|
81
|
+
WUniqueFormats.prototype.destroy = function () {
|
|
82
|
+
this.clear();
|
|
83
|
+
this.items = undefined;
|
|
84
|
+
};
|
|
85
|
+
return WUniqueFormats;
|
|
86
|
+
}());
|
|
87
|
+
export { WUniqueFormats };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @private
|
|
3
|
+
*/
|
|
4
|
+
export declare class DocumentCanvasElement {
|
|
5
|
+
/** Gets or sets the height of a canvas element on a document. */
|
|
6
|
+
height: number;
|
|
7
|
+
/** Gets or sets the width of a canvas element on a document. */
|
|
8
|
+
width: number;
|
|
9
|
+
style: CSSStyleDeclaration;
|
|
10
|
+
private context;
|
|
11
|
+
constructor();
|
|
12
|
+
/**
|
|
13
|
+
* @param {string} contextId - Specifies the type of context to create, 2d or webgl.
|
|
14
|
+
* @param {CanvasRenderingContext2DSettings} options - Specifies the type of context to create, 2d or webgl.
|
|
15
|
+
* @private
|
|
16
|
+
* @returns {CanvasRenderingContext2D} - Returns the canvas rendering context 2D.
|
|
17
|
+
*/
|
|
18
|
+
getContext(contextId: '2d', options?: CanvasRenderingContext2DSettings): DocumentCanvasRenderingContext2D;
|
|
19
|
+
/**
|
|
20
|
+
* @param {string} type - Specifies the type of image to return.
|
|
21
|
+
* @param {any} quality - A Number between 0 and 1 indicating the image quality to use for image formats that use lossy compression.
|
|
22
|
+
* @private
|
|
23
|
+
* @returns {string} - Returns the data URL containing a representation of the image in the format specified by the type parameter.
|
|
24
|
+
*/
|
|
25
|
+
toDataURL(type?: string, quality?: any): string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* @private
|
|
29
|
+
*/
|
|
30
|
+
export declare class DocumentCanvasRenderingContext2D {
|
|
31
|
+
renderedPath: string;
|
|
32
|
+
globalAlpha: number;
|
|
33
|
+
globalCompositeOperation: any;
|
|
34
|
+
fillStyle: string;
|
|
35
|
+
strokeStyle: string;
|
|
36
|
+
direction: CanvasDirection;
|
|
37
|
+
font: string;
|
|
38
|
+
textAlign: CanvasTextAlign;
|
|
39
|
+
textBaseline: CanvasTextBaseline;
|
|
40
|
+
lineWidth: number;
|
|
41
|
+
lineCap: number;
|
|
42
|
+
drawImage(image: CanvasImageSource, sx: number, sy: number, sw: number, sh: number, dx?: number, dy?: number, dw?: number, dh?: number): void;
|
|
43
|
+
beginPath(): void;
|
|
44
|
+
clip(fillRule?: CanvasFillRule): void;
|
|
45
|
+
fill(fillRule?: CanvasFillRule): void;
|
|
46
|
+
stroke(): void;
|
|
47
|
+
closePath(): void;
|
|
48
|
+
lineTo(x: number, y: number): void;
|
|
49
|
+
moveTo(x: number, y: number): void;
|
|
50
|
+
rect(x: number, y: number, w: number, h: number): void;
|
|
51
|
+
setLineDash(segments: number[]): void;
|
|
52
|
+
clearRect(x: number, y: number, w: number, h: number): void;
|
|
53
|
+
fillRect(x: number, y: number, w: number, h: number): void;
|
|
54
|
+
strokeRect(x: number, y: number, w: number, h: number): void;
|
|
55
|
+
restore(): void;
|
|
56
|
+
save(): void;
|
|
57
|
+
fillText(text: string, x: number, y: number, maxWidth?: number): void;
|
|
58
|
+
measureText(text: string): any;
|
|
59
|
+
strokeText(text: string, x: number, y: number, maxWidth?: number): void;
|
|
60
|
+
scale(x: number, y: number): void;
|
|
61
|
+
}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
var GLOBAL_ALPHA = 'GA';
|
|
2
|
+
var GLOBAL_COMPOSITE_OPERATION = 'GCP';
|
|
3
|
+
var FILL_STYLE = 'FS';
|
|
4
|
+
var STROKE_STYLE = 'SS';
|
|
5
|
+
var DIRECTION = 'Dir';
|
|
6
|
+
var FONT = 'Fn';
|
|
7
|
+
var TEXT_ALIGN = 'TA';
|
|
8
|
+
var TEXT_BASE_LINE = 'TBL';
|
|
9
|
+
var LINE_WIDTH = 'LW';
|
|
10
|
+
var LINE_CAP = 'LC';
|
|
11
|
+
var MAX_WIDTH = 'MW';
|
|
12
|
+
var BEGIN_PATH = 'BP';
|
|
13
|
+
var CLOSE_PATH = 'CP';
|
|
14
|
+
var CLIP = 'Cl';
|
|
15
|
+
var FILL = 'Fl';
|
|
16
|
+
var STROKE = 'Stk';
|
|
17
|
+
var LINE_TO = 'LT';
|
|
18
|
+
var MOVE_TO = 'MT';
|
|
19
|
+
var SEGMENTS = 'Sgm';
|
|
20
|
+
var RECT = 'Rt';
|
|
21
|
+
var CLEAR_RECT = 'CR';
|
|
22
|
+
var FILL_RECT = 'FR';
|
|
23
|
+
var STROKE_RECT = 'SR';
|
|
24
|
+
var RESTORE = 'RES';
|
|
25
|
+
var SAVE = 'S';
|
|
26
|
+
var FILL_TEXT = 'FT';
|
|
27
|
+
var STROKE_TEXT = 'ST';
|
|
28
|
+
var SCALE = 'SC';
|
|
29
|
+
/**
|
|
30
|
+
* @private
|
|
31
|
+
*/
|
|
32
|
+
var DocumentCanvasElement = /** @class */ (function () {
|
|
33
|
+
function DocumentCanvasElement() {
|
|
34
|
+
this.style = {};
|
|
35
|
+
this.context = new DocumentCanvasRenderingContext2D();
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* @param {string} contextId - Specifies the type of context to create, 2d or webgl.
|
|
39
|
+
* @param {CanvasRenderingContext2DSettings} options - Specifies the type of context to create, 2d or webgl.
|
|
40
|
+
* @private
|
|
41
|
+
* @returns {CanvasRenderingContext2D} - Returns the canvas rendering context 2D.
|
|
42
|
+
*/
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
44
|
+
DocumentCanvasElement.prototype.getContext = function (contextId, options) {
|
|
45
|
+
return this.context;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* @param {string} type - Specifies the type of image to return.
|
|
49
|
+
* @param {any} quality - A Number between 0 and 1 indicating the image quality to use for image formats that use lossy compression.
|
|
50
|
+
* @private
|
|
51
|
+
* @returns {string} - Returns the data URL containing a representation of the image in the format specified by the type parameter.
|
|
52
|
+
*/
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
54
|
+
DocumentCanvasElement.prototype.toDataURL = function (type, quality) {
|
|
55
|
+
return this.context.renderedPath;
|
|
56
|
+
};
|
|
57
|
+
return DocumentCanvasElement;
|
|
58
|
+
}());
|
|
59
|
+
export { DocumentCanvasElement };
|
|
60
|
+
/**
|
|
61
|
+
* @private
|
|
62
|
+
*/
|
|
63
|
+
var DocumentCanvasRenderingContext2D = /** @class */ (function () {
|
|
64
|
+
function DocumentCanvasRenderingContext2D() {
|
|
65
|
+
this.renderedPath = '';
|
|
66
|
+
}
|
|
67
|
+
Object.defineProperty(DocumentCanvasRenderingContext2D.prototype, "globalAlpha", {
|
|
68
|
+
set: function (value) {
|
|
69
|
+
this.renderedPath += (GLOBAL_ALPHA + ':' + value + ';');
|
|
70
|
+
},
|
|
71
|
+
enumerable: true,
|
|
72
|
+
configurable: true
|
|
73
|
+
});
|
|
74
|
+
Object.defineProperty(DocumentCanvasRenderingContext2D.prototype, "globalCompositeOperation", {
|
|
75
|
+
set: function (value) {
|
|
76
|
+
this.renderedPath += (GLOBAL_COMPOSITE_OPERATION + ':' + value + ';');
|
|
77
|
+
},
|
|
78
|
+
enumerable: true,
|
|
79
|
+
configurable: true
|
|
80
|
+
});
|
|
81
|
+
Object.defineProperty(DocumentCanvasRenderingContext2D.prototype, "fillStyle", {
|
|
82
|
+
set: function (value) {
|
|
83
|
+
this.renderedPath += (FILL_STYLE + ':' + value + ';');
|
|
84
|
+
},
|
|
85
|
+
enumerable: true,
|
|
86
|
+
configurable: true
|
|
87
|
+
});
|
|
88
|
+
Object.defineProperty(DocumentCanvasRenderingContext2D.prototype, "strokeStyle", {
|
|
89
|
+
set: function (value) {
|
|
90
|
+
this.renderedPath += (STROKE_STYLE + ':' + value + ';');
|
|
91
|
+
},
|
|
92
|
+
enumerable: true,
|
|
93
|
+
configurable: true
|
|
94
|
+
});
|
|
95
|
+
Object.defineProperty(DocumentCanvasRenderingContext2D.prototype, "direction", {
|
|
96
|
+
set: function (value) {
|
|
97
|
+
this.renderedPath += (DIRECTION + ':' + value + ';');
|
|
98
|
+
},
|
|
99
|
+
enumerable: true,
|
|
100
|
+
configurable: true
|
|
101
|
+
});
|
|
102
|
+
Object.defineProperty(DocumentCanvasRenderingContext2D.prototype, "font", {
|
|
103
|
+
set: function (value) {
|
|
104
|
+
this.renderedPath += (FONT + ':' + value + ';');
|
|
105
|
+
},
|
|
106
|
+
enumerable: true,
|
|
107
|
+
configurable: true
|
|
108
|
+
});
|
|
109
|
+
Object.defineProperty(DocumentCanvasRenderingContext2D.prototype, "textAlign", {
|
|
110
|
+
set: function (value) {
|
|
111
|
+
this.renderedPath += (TEXT_ALIGN + ':' + value + ';');
|
|
112
|
+
},
|
|
113
|
+
enumerable: true,
|
|
114
|
+
configurable: true
|
|
115
|
+
});
|
|
116
|
+
Object.defineProperty(DocumentCanvasRenderingContext2D.prototype, "textBaseline", {
|
|
117
|
+
set: function (value) {
|
|
118
|
+
this.renderedPath += (TEXT_BASE_LINE + ':' + value + ';');
|
|
119
|
+
},
|
|
120
|
+
enumerable: true,
|
|
121
|
+
configurable: true
|
|
122
|
+
});
|
|
123
|
+
Object.defineProperty(DocumentCanvasRenderingContext2D.prototype, "lineWidth", {
|
|
124
|
+
set: function (value) {
|
|
125
|
+
this.renderedPath += (LINE_WIDTH + ':' + value + ';');
|
|
126
|
+
},
|
|
127
|
+
enumerable: true,
|
|
128
|
+
configurable: true
|
|
129
|
+
});
|
|
130
|
+
Object.defineProperty(DocumentCanvasRenderingContext2D.prototype, "lineCap", {
|
|
131
|
+
set: function (value) {
|
|
132
|
+
this.renderedPath += (LINE_CAP + ':' + value + ';');
|
|
133
|
+
},
|
|
134
|
+
enumerable: true,
|
|
135
|
+
configurable: true
|
|
136
|
+
});
|
|
137
|
+
DocumentCanvasRenderingContext2D.prototype.drawImage = function (image, sx, sy, sw, sh, dx, dy, dw, dh) {
|
|
138
|
+
this.renderedPath += (LINE_CAP + ':' + image.src + ';');
|
|
139
|
+
this.renderedPath += ('sx:' + sx + ';');
|
|
140
|
+
this.renderedPath += ('sy:' + sy + ';');
|
|
141
|
+
this.renderedPath += ('sw:' + sw + ';');
|
|
142
|
+
this.renderedPath += ('sh:' + sh + ';');
|
|
143
|
+
if (dx) {
|
|
144
|
+
this.renderedPath += ('dx:' + dx + ';');
|
|
145
|
+
}
|
|
146
|
+
if (dy) {
|
|
147
|
+
this.renderedPath += ('dy:' + dy + ';');
|
|
148
|
+
}
|
|
149
|
+
if (dw) {
|
|
150
|
+
this.renderedPath += ('dw:' + dw + ';');
|
|
151
|
+
}
|
|
152
|
+
if (dh) {
|
|
153
|
+
this.renderedPath += ('dh:' + dh + ';');
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
DocumentCanvasRenderingContext2D.prototype.beginPath = function () {
|
|
157
|
+
this.renderedPath += (BEGIN_PATH + ';');
|
|
158
|
+
};
|
|
159
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
160
|
+
DocumentCanvasRenderingContext2D.prototype.clip = function (fillRule) {
|
|
161
|
+
this.renderedPath += (CLIP + ';');
|
|
162
|
+
};
|
|
163
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
164
|
+
DocumentCanvasRenderingContext2D.prototype.fill = function (fillRule) {
|
|
165
|
+
this.renderedPath += (FILL + ';');
|
|
166
|
+
};
|
|
167
|
+
DocumentCanvasRenderingContext2D.prototype.stroke = function () {
|
|
168
|
+
this.renderedPath += (STROKE + ';');
|
|
169
|
+
};
|
|
170
|
+
DocumentCanvasRenderingContext2D.prototype.closePath = function () {
|
|
171
|
+
this.renderedPath += (CLOSE_PATH + ';');
|
|
172
|
+
};
|
|
173
|
+
DocumentCanvasRenderingContext2D.prototype.lineTo = function (x, y) {
|
|
174
|
+
this.renderedPath += (LINE_TO + ':' + 'x:' + x + ';' + 'y:' + y + ';');
|
|
175
|
+
};
|
|
176
|
+
DocumentCanvasRenderingContext2D.prototype.moveTo = function (x, y) {
|
|
177
|
+
this.renderedPath += (MOVE_TO + ':' + 'x:' + x + ';' + 'y:' + y + ';');
|
|
178
|
+
};
|
|
179
|
+
DocumentCanvasRenderingContext2D.prototype.rect = function (x, y, w, h) {
|
|
180
|
+
this.renderedPath += (RECT + ':' + 'x:' + x + ';' + 'y:' + y + ';' + 'w:' + w + ';' + 'h:' + h + ';');
|
|
181
|
+
};
|
|
182
|
+
DocumentCanvasRenderingContext2D.prototype.setLineDash = function (segments) {
|
|
183
|
+
this.renderedPath += (SEGMENTS + ':' + segments.toString() + ';');
|
|
184
|
+
};
|
|
185
|
+
DocumentCanvasRenderingContext2D.prototype.clearRect = function (x, y, w, h) {
|
|
186
|
+
this.renderedPath += (CLEAR_RECT + ':' + 'x:' + x + ';' + 'y:' + y + ';' + 'w:' + w + ';' + 'h:' + h + ';');
|
|
187
|
+
};
|
|
188
|
+
DocumentCanvasRenderingContext2D.prototype.fillRect = function (x, y, w, h) {
|
|
189
|
+
this.renderedPath += (FILL_RECT + ':' + 'x:' + x + ';' + 'y:' + y + ';' + 'w:' + w + ';' + 'h:' + h + ';');
|
|
190
|
+
};
|
|
191
|
+
DocumentCanvasRenderingContext2D.prototype.strokeRect = function (x, y, w, h) {
|
|
192
|
+
this.renderedPath += (STROKE_RECT + ':' + 'x:' + x + ';' + 'y:' + y + ';' + 'w:' + w + ';' + 'h:' + h + ';');
|
|
193
|
+
};
|
|
194
|
+
DocumentCanvasRenderingContext2D.prototype.restore = function () {
|
|
195
|
+
this.renderedPath += (RESTORE + ';');
|
|
196
|
+
};
|
|
197
|
+
DocumentCanvasRenderingContext2D.prototype.save = function () {
|
|
198
|
+
this.renderedPath += (SAVE + ';');
|
|
199
|
+
};
|
|
200
|
+
DocumentCanvasRenderingContext2D.prototype.fillText = function (text, x, y, maxWidth) {
|
|
201
|
+
this.renderedPath += (FILL_TEXT + ':' + text + ';' + 'x:' + x + ';' + 'y:' + y + ';');
|
|
202
|
+
if (maxWidth) {
|
|
203
|
+
this.renderedPath += (MAX_WIDTH + ':' + maxWidth + ';');
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
207
|
+
DocumentCanvasRenderingContext2D.prototype.measureText = function (text) {
|
|
208
|
+
return { width: 30 };
|
|
209
|
+
};
|
|
210
|
+
DocumentCanvasRenderingContext2D.prototype.strokeText = function (text, x, y, maxWidth) {
|
|
211
|
+
this.renderedPath += (STROKE_TEXT + ':' + text + ';' + 'x:' + x + ';' + 'y:' + y + ';');
|
|
212
|
+
if (maxWidth) {
|
|
213
|
+
this.renderedPath += (MAX_WIDTH + ':' + maxWidth + ';');
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
DocumentCanvasRenderingContext2D.prototype.scale = function (x, y) {
|
|
217
|
+
this.renderedPath += (SCALE + ':' + 'x:' + x + ';' + 'y:' + y + ';');
|
|
218
|
+
};
|
|
219
|
+
return DocumentCanvasRenderingContext2D;
|
|
220
|
+
}());
|
|
221
|
+
export { DocumentCanvasRenderingContext2D };
|