pdfdancer-client-typescript 1.0.1
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/.eslintrc.js +19 -0
- package/README.md +267 -0
- package/dist/__tests__/e2e/test-helpers.d.ts +32 -0
- package/dist/__tests__/e2e/test-helpers.d.ts.map +1 -0
- package/dist/__tests__/e2e/test-helpers.js +157 -0
- package/dist/__tests__/e2e/test-helpers.js.map +1 -0
- package/dist/client-v1.d.ts +169 -0
- package/dist/client-v1.d.ts.map +1 -0
- package/dist/client-v1.js +558 -0
- package/dist/client-v1.js.map +1 -0
- package/dist/exceptions.d.ts +43 -0
- package/dist/exceptions.d.ts.map +1 -0
- package/dist/exceptions.js +66 -0
- package/dist/exceptions.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -0
- package/dist/models.d.ts +216 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +427 -0
- package/dist/models.js.map +1 -0
- package/dist/paragraph-builder.d.ts +67 -0
- package/dist/paragraph-builder.d.ts.map +1 -0
- package/dist/paragraph-builder.js +160 -0
- package/dist/paragraph-builder.js.map +1 -0
- package/example.ts +103 -0
- package/fixtures/DancingScript-Regular.ttf +0 -0
- package/fixtures/JetBrainsMono-Regular.ttf +0 -0
- package/fixtures/ObviouslyAwesome.pdf +0 -0
- package/fixtures/README.md +25 -0
- package/fixtures/basic-paths.pdf +0 -0
- package/fixtures/logo-80.png +0 -0
- package/fixtures/mixed-form-types.pdf +0 -0
- package/jest.config.js +26 -0
- package/package.json +38 -0
- package/scripts/release.js +91 -0
- package/scripts/test-release.js +59 -0
- package/src/__tests__/client-v1.test.ts +111 -0
- package/src/__tests__/e2e/form.test.ts +51 -0
- package/src/__tests__/e2e/image.test.ts +108 -0
- package/src/__tests__/e2e/line.test.ts +134 -0
- package/src/__tests__/e2e/page.test.ts +45 -0
- package/src/__tests__/e2e/paragraph.test.ts +210 -0
- package/src/__tests__/e2e/path.test.ts +72 -0
- package/src/__tests__/e2e/test-helpers.ts +132 -0
- package/src/client-v1.ts +673 -0
- package/src/exceptions.ts +67 -0
- package/src/index.ts +34 -0
- package/src/models.ts +476 -0
- package/src/paragraph-builder.ts +184 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Exception classes for the PDFDancer TypeScript client.
|
|
4
|
+
* Mirrors the Python client exception hierarchy.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ValidationException = exports.SessionException = exports.HttpClientException = exports.FontNotFoundException = exports.PdfDancerException = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* Base exception for all PDFDancer client errors.
|
|
10
|
+
* Equivalent to PdfDancerException in the Python client.
|
|
11
|
+
*/
|
|
12
|
+
class PdfDancerException extends Error {
|
|
13
|
+
constructor(message, cause) {
|
|
14
|
+
super(message);
|
|
15
|
+
this.name = 'PdfDancerException';
|
|
16
|
+
this.cause = cause;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.PdfDancerException = PdfDancerException;
|
|
20
|
+
/**
|
|
21
|
+
* Exception raised when a required font is not found or available.
|
|
22
|
+
* Equivalent to FontNotFoundException in the Python client.
|
|
23
|
+
*/
|
|
24
|
+
class FontNotFoundException extends PdfDancerException {
|
|
25
|
+
constructor(message) {
|
|
26
|
+
super(`Font not found: ${message}`);
|
|
27
|
+
this.name = 'FontNotFoundException';
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.FontNotFoundException = FontNotFoundException;
|
|
31
|
+
/**
|
|
32
|
+
* Exception raised for HTTP client errors during API communication.
|
|
33
|
+
* Wraps fetch exceptions and HTTP errors from the API.
|
|
34
|
+
*/
|
|
35
|
+
class HttpClientException extends PdfDancerException {
|
|
36
|
+
constructor(message, response, cause) {
|
|
37
|
+
super(message, cause);
|
|
38
|
+
this.name = 'HttpClientException';
|
|
39
|
+
this.response = response;
|
|
40
|
+
this.statusCode = response?.status;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.HttpClientException = HttpClientException;
|
|
44
|
+
/**
|
|
45
|
+
* Exception raised for session-related errors.
|
|
46
|
+
* Occurs when session creation fails or session is invalid.
|
|
47
|
+
*/
|
|
48
|
+
class SessionException extends PdfDancerException {
|
|
49
|
+
constructor(message, cause) {
|
|
50
|
+
super(message, cause);
|
|
51
|
+
this.name = 'SessionException';
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.SessionException = SessionException;
|
|
55
|
+
/**
|
|
56
|
+
* Exception raised for input validation errors.
|
|
57
|
+
* Equivalent to ValidationException in the Python client.
|
|
58
|
+
*/
|
|
59
|
+
class ValidationException extends PdfDancerException {
|
|
60
|
+
constructor(message) {
|
|
61
|
+
super(message);
|
|
62
|
+
this.name = 'ValidationException';
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.ValidationException = ValidationException;
|
|
66
|
+
//# sourceMappingURL=exceptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exceptions.js","sourceRoot":"","sources":["../src/exceptions.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;GAGG;AACH,MAAa,kBAAmB,SAAQ,KAAK;IAG3C,YAAY,OAAe,EAAE,KAAa;QACxC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF;AARD,gDAQC;AAED;;;GAGG;AACH,MAAa,qBAAsB,SAAQ,kBAAkB;IAC3D,YAAY,OAAe;QACzB,KAAK,CAAC,mBAAmB,OAAO,EAAE,CAAC,CAAC;QACpC,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACtC,CAAC;CACF;AALD,sDAKC;AAED;;;GAGG;AACH,MAAa,mBAAoB,SAAQ,kBAAkB;IAIzD,YAAY,OAAe,EAAE,QAAmB,EAAE,KAAa;QAC7D,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACtB,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;QAClC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,UAAU,GAAG,QAAQ,EAAE,MAAM,CAAC;IACrC,CAAC;CACF;AAVD,kDAUC;AAED;;;GAGG;AACH,MAAa,gBAAiB,SAAQ,kBAAkB;IACtD,YAAY,OAAe,EAAE,KAAa;QACxC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACtB,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;IACjC,CAAC;CACF;AALD,4CAKC;AAED;;;GAGG;AACH,MAAa,mBAAoB,SAAQ,kBAAkB;IACzD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF;AALD,kDAKC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PDFDancer TypeScript Client
|
|
3
|
+
*
|
|
4
|
+
* A TypeScript client library for the PDFDancer PDF manipulation API.
|
|
5
|
+
* Provides a clean, TypeScript interface for PDF operations that closely
|
|
6
|
+
* mirrors the Python client structure and functionality.
|
|
7
|
+
*/
|
|
8
|
+
export { ClientV1 } from './client-v1';
|
|
9
|
+
export { ParagraphBuilder } from './paragraph-builder';
|
|
10
|
+
export { PdfDancerException, FontNotFoundException, ValidationException, HttpClientException, SessionException } from './exceptions';
|
|
11
|
+
export { ObjectRef, Position, ObjectType, Font, Color, Image, BoundingRect, Paragraph, PositionMode, ShapeType, Point } from './models';
|
|
12
|
+
export declare const VERSION = "1.0.0";
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,SAAS,EACT,QAAQ,EACR,UAAU,EACV,IAAI,EACJ,KAAK,EACL,KAAK,EACL,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,SAAS,EACT,KAAK,EACN,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,OAAO,UAAU,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* PDFDancer TypeScript Client
|
|
4
|
+
*
|
|
5
|
+
* A TypeScript client library for the PDFDancer PDF manipulation API.
|
|
6
|
+
* Provides a clean, TypeScript interface for PDF operations that closely
|
|
7
|
+
* mirrors the Python client structure and functionality.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.VERSION = exports.ShapeType = exports.PositionMode = exports.Paragraph = exports.BoundingRect = exports.Image = exports.Color = exports.Font = exports.ObjectType = exports.Position = exports.ObjectRef = exports.SessionException = exports.HttpClientException = exports.ValidationException = exports.FontNotFoundException = exports.PdfDancerException = exports.ParagraphBuilder = exports.ClientV1 = void 0;
|
|
11
|
+
var client_v1_1 = require("./client-v1");
|
|
12
|
+
Object.defineProperty(exports, "ClientV1", { enumerable: true, get: function () { return client_v1_1.ClientV1; } });
|
|
13
|
+
var paragraph_builder_1 = require("./paragraph-builder");
|
|
14
|
+
Object.defineProperty(exports, "ParagraphBuilder", { enumerable: true, get: function () { return paragraph_builder_1.ParagraphBuilder; } });
|
|
15
|
+
var exceptions_1 = require("./exceptions");
|
|
16
|
+
Object.defineProperty(exports, "PdfDancerException", { enumerable: true, get: function () { return exceptions_1.PdfDancerException; } });
|
|
17
|
+
Object.defineProperty(exports, "FontNotFoundException", { enumerable: true, get: function () { return exceptions_1.FontNotFoundException; } });
|
|
18
|
+
Object.defineProperty(exports, "ValidationException", { enumerable: true, get: function () { return exceptions_1.ValidationException; } });
|
|
19
|
+
Object.defineProperty(exports, "HttpClientException", { enumerable: true, get: function () { return exceptions_1.HttpClientException; } });
|
|
20
|
+
Object.defineProperty(exports, "SessionException", { enumerable: true, get: function () { return exceptions_1.SessionException; } });
|
|
21
|
+
var models_1 = require("./models");
|
|
22
|
+
Object.defineProperty(exports, "ObjectRef", { enumerable: true, get: function () { return models_1.ObjectRef; } });
|
|
23
|
+
Object.defineProperty(exports, "Position", { enumerable: true, get: function () { return models_1.Position; } });
|
|
24
|
+
Object.defineProperty(exports, "ObjectType", { enumerable: true, get: function () { return models_1.ObjectType; } });
|
|
25
|
+
Object.defineProperty(exports, "Font", { enumerable: true, get: function () { return models_1.Font; } });
|
|
26
|
+
Object.defineProperty(exports, "Color", { enumerable: true, get: function () { return models_1.Color; } });
|
|
27
|
+
Object.defineProperty(exports, "Image", { enumerable: true, get: function () { return models_1.Image; } });
|
|
28
|
+
Object.defineProperty(exports, "BoundingRect", { enumerable: true, get: function () { return models_1.BoundingRect; } });
|
|
29
|
+
Object.defineProperty(exports, "Paragraph", { enumerable: true, get: function () { return models_1.Paragraph; } });
|
|
30
|
+
Object.defineProperty(exports, "PositionMode", { enumerable: true, get: function () { return models_1.PositionMode; } });
|
|
31
|
+
Object.defineProperty(exports, "ShapeType", { enumerable: true, get: function () { return models_1.ShapeType; } });
|
|
32
|
+
exports.VERSION = "1.0.0";
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,yCAAuC;AAA9B,qGAAA,QAAQ,OAAA;AACjB,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA;AAEzB,2CAMsB;AALpB,gHAAA,kBAAkB,OAAA;AAClB,mHAAA,qBAAqB,OAAA;AACrB,iHAAA,mBAAmB,OAAA;AACnB,iHAAA,mBAAmB,OAAA;AACnB,8GAAA,gBAAgB,OAAA;AAGlB,mCAYkB;AAXhB,mGAAA,SAAS,OAAA;AACT,kGAAA,QAAQ,OAAA;AACR,oGAAA,UAAU,OAAA;AACV,8FAAA,IAAI,OAAA;AACJ,+FAAA,KAAK,OAAA;AACL,+FAAA,KAAK,OAAA;AACL,sGAAA,YAAY,OAAA;AACZ,mGAAA,SAAS,OAAA;AACT,sGAAA,YAAY,OAAA;AACZ,mGAAA,SAAS,OAAA;AAIE,QAAA,OAAO,GAAG,OAAO,CAAC"}
|
package/dist/models.d.ts
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model classes for the PDFDancer TypeScript client.
|
|
3
|
+
* Closely mirrors the Python model classes with TypeScript conventions.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Object type enumeration matching the Python ObjectType.
|
|
7
|
+
*/
|
|
8
|
+
export declare enum ObjectType {
|
|
9
|
+
IMAGE = "IMAGE",
|
|
10
|
+
FORM = "FORM",
|
|
11
|
+
PATH = "PATH",
|
|
12
|
+
PARAGRAPH = "PARAGRAPH",
|
|
13
|
+
TEXT_LINE = "TEXT_LINE",
|
|
14
|
+
PAGE = "PAGE"
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Defines how position matching should be performed when searching for objects.
|
|
18
|
+
*/
|
|
19
|
+
export declare enum PositionMode {
|
|
20
|
+
INTERSECT = "INTERSECT",// Objects that intersect with the specified position area
|
|
21
|
+
CONTAINS = "CONTAINS"
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Defines the geometric shape type used for position specification.
|
|
25
|
+
*/
|
|
26
|
+
export declare enum ShapeType {
|
|
27
|
+
POINT = "POINT",// Single point coordinate
|
|
28
|
+
LINE = "LINE",// Linear shape between two points
|
|
29
|
+
CIRCLE = "CIRCLE",// Circular area with radius
|
|
30
|
+
RECT = "RECT"
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Represents a 2D point with x and y coordinates.
|
|
34
|
+
*/
|
|
35
|
+
export interface Point {
|
|
36
|
+
x: number;
|
|
37
|
+
y: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Represents a bounding rectangle with position and dimensions.
|
|
41
|
+
* Matches the Python BoundingRect class.
|
|
42
|
+
*/
|
|
43
|
+
export declare class BoundingRect {
|
|
44
|
+
x: number;
|
|
45
|
+
y: number;
|
|
46
|
+
width: number;
|
|
47
|
+
height: number;
|
|
48
|
+
constructor(x: number, y: number, width: number, height: number);
|
|
49
|
+
getX(): number;
|
|
50
|
+
getY(): number;
|
|
51
|
+
getWidth(): number;
|
|
52
|
+
getHeight(): number;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Represents spatial positioning and location information for PDF objects.
|
|
56
|
+
* Closely mirrors the Python Position class with TypeScript conventions.
|
|
57
|
+
*/
|
|
58
|
+
export declare class Position {
|
|
59
|
+
pageIndex?: number | undefined;
|
|
60
|
+
shape?: ShapeType | undefined;
|
|
61
|
+
mode?: PositionMode | undefined;
|
|
62
|
+
boundingRect?: BoundingRect | undefined;
|
|
63
|
+
textStartsWith?: string | undefined;
|
|
64
|
+
constructor(pageIndex?: number | undefined, shape?: ShapeType | undefined, mode?: PositionMode | undefined, boundingRect?: BoundingRect | undefined, textStartsWith?: string | undefined);
|
|
65
|
+
/**
|
|
66
|
+
* Creates a position specification for an entire page.
|
|
67
|
+
* Equivalent to Position.fromPageIndex() in Python.
|
|
68
|
+
*/
|
|
69
|
+
static fromPageIndex(pageIndex: number): Position;
|
|
70
|
+
/**
|
|
71
|
+
* Creates a position specification for specific coordinates on a page.
|
|
72
|
+
* Equivalent to Position.onPageCoordinates() in Python.
|
|
73
|
+
*/
|
|
74
|
+
static onPageCoordinates(pageIndex: number, x: number, y: number): Position;
|
|
75
|
+
/**
|
|
76
|
+
* Sets the position to a specific point location.
|
|
77
|
+
* Equivalent to Position.set() in Python.
|
|
78
|
+
*/
|
|
79
|
+
setPoint(point: Point): void;
|
|
80
|
+
/**
|
|
81
|
+
* Move the position horizontally by the specified offset.
|
|
82
|
+
*/
|
|
83
|
+
moveX(xOffset: number): Position;
|
|
84
|
+
/**
|
|
85
|
+
* Move the position vertically by the specified offset.
|
|
86
|
+
*/
|
|
87
|
+
moveY(yOffset: number): Position;
|
|
88
|
+
/**
|
|
89
|
+
* Returns the X coordinate of this position.
|
|
90
|
+
*/
|
|
91
|
+
getX(): number | undefined;
|
|
92
|
+
/**
|
|
93
|
+
* Returns the Y coordinate of this position.
|
|
94
|
+
*/
|
|
95
|
+
getY(): number | undefined;
|
|
96
|
+
/**
|
|
97
|
+
* Creates a copy of this position.
|
|
98
|
+
*/
|
|
99
|
+
copy(): Position;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Lightweight reference to a PDF object providing identity and type information.
|
|
103
|
+
* Mirrors the Python ObjectRef class exactly.
|
|
104
|
+
*/
|
|
105
|
+
export declare class ObjectRef {
|
|
106
|
+
internalId: string;
|
|
107
|
+
position: Position;
|
|
108
|
+
type: ObjectType;
|
|
109
|
+
constructor(internalId: string, position: Position, type: ObjectType);
|
|
110
|
+
getInternalId(): string;
|
|
111
|
+
getPosition(): Position;
|
|
112
|
+
setPosition(position: Position): void;
|
|
113
|
+
getType(): ObjectType;
|
|
114
|
+
toDict(): Record<string, any>;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Represents an RGB color with optional alpha channel, values from 0-255.
|
|
118
|
+
*/
|
|
119
|
+
export declare class Color {
|
|
120
|
+
r: number;
|
|
121
|
+
g: number;
|
|
122
|
+
b: number;
|
|
123
|
+
a: number;
|
|
124
|
+
constructor(r: number, g: number, b: number, a?: number);
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Represents a font with name and size.
|
|
128
|
+
*/
|
|
129
|
+
export declare class Font {
|
|
130
|
+
name: string;
|
|
131
|
+
size: number;
|
|
132
|
+
constructor(name: string, size: number);
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Represents an image object in a PDF document.
|
|
136
|
+
* Matches the Python Image class structure.
|
|
137
|
+
*/
|
|
138
|
+
export declare class Image {
|
|
139
|
+
position?: Position | undefined;
|
|
140
|
+
format?: string | undefined;
|
|
141
|
+
width?: number | undefined;
|
|
142
|
+
height?: number | undefined;
|
|
143
|
+
data?: Uint8Array | undefined;
|
|
144
|
+
constructor(position?: Position | undefined, format?: string | undefined, width?: number | undefined, height?: number | undefined, data?: Uint8Array | undefined);
|
|
145
|
+
getPosition(): Position | undefined;
|
|
146
|
+
setPosition(position: Position): void;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Represents a paragraph of text in a PDF document.
|
|
150
|
+
* Structure mirrors the Python Paragraph class.
|
|
151
|
+
*/
|
|
152
|
+
export declare class Paragraph {
|
|
153
|
+
position?: Position | undefined;
|
|
154
|
+
textLines?: string[] | undefined;
|
|
155
|
+
font?: Font | undefined;
|
|
156
|
+
color?: Color | undefined;
|
|
157
|
+
lineSpacing: number;
|
|
158
|
+
constructor(position?: Position | undefined, textLines?: string[] | undefined, font?: Font | undefined, color?: Color | undefined, lineSpacing?: number);
|
|
159
|
+
getPosition(): Position | undefined;
|
|
160
|
+
setPosition(position: Position): void;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Request object for find operations.
|
|
164
|
+
*/
|
|
165
|
+
export declare class FindRequest {
|
|
166
|
+
objectType?: ObjectType | undefined;
|
|
167
|
+
position?: Position | undefined;
|
|
168
|
+
hint?: string | undefined;
|
|
169
|
+
constructor(objectType?: ObjectType | undefined, position?: Position | undefined, hint?: string | undefined);
|
|
170
|
+
toDict(): Record<string, any>;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Request object for delete operations.
|
|
174
|
+
*/
|
|
175
|
+
export declare class DeleteRequest {
|
|
176
|
+
objectRef: ObjectRef;
|
|
177
|
+
constructor(objectRef: ObjectRef);
|
|
178
|
+
toDict(): Record<string, any>;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Request object for move operations.
|
|
182
|
+
*/
|
|
183
|
+
export declare class MoveRequest {
|
|
184
|
+
objectRef: ObjectRef;
|
|
185
|
+
position: Position;
|
|
186
|
+
constructor(objectRef: ObjectRef, position: Position);
|
|
187
|
+
toDict(): Record<string, any>;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Request object for add operations.
|
|
191
|
+
*/
|
|
192
|
+
export declare class AddRequest {
|
|
193
|
+
pdfObject: Image | Paragraph;
|
|
194
|
+
constructor(pdfObject: Image | Paragraph);
|
|
195
|
+
toDict(): Record<string, any>;
|
|
196
|
+
private objectToDict;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Request object for modify operations.
|
|
200
|
+
*/
|
|
201
|
+
export declare class ModifyRequest {
|
|
202
|
+
objectRef: ObjectRef;
|
|
203
|
+
newObject: Image | Paragraph;
|
|
204
|
+
constructor(objectRef: ObjectRef, newObject: Image | Paragraph);
|
|
205
|
+
toDict(): Record<string, any>;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Request object for text modification operations.
|
|
209
|
+
*/
|
|
210
|
+
export declare class ModifyTextRequest {
|
|
211
|
+
objectRef: ObjectRef;
|
|
212
|
+
newText: string;
|
|
213
|
+
constructor(objectRef: ObjectRef, newText: string);
|
|
214
|
+
toDict(): Record<string, any>;
|
|
215
|
+
}
|
|
216
|
+
//# sourceMappingURL=models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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