pdfdancer-client-typescript 1.0.1 → 1.0.2

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.
Files changed (38) hide show
  1. package/.github/workflows/ci.yml +37 -0
  2. package/README.md +60 -64
  3. package/dist/__tests__/assertions.d.ts +2 -0
  4. package/dist/__tests__/assertions.d.ts.map +1 -0
  5. package/dist/__tests__/assertions.js +11 -0
  6. package/dist/__tests__/assertions.js.map +1 -0
  7. package/dist/client-v1.d.ts +3 -24
  8. package/dist/client-v1.d.ts.map +1 -1
  9. package/dist/client-v1.js +6 -23
  10. package/dist/client-v1.js.map +1 -1
  11. package/dist/exceptions.d.ts +0 -3
  12. package/dist/exceptions.d.ts.map +1 -1
  13. package/dist/exceptions.js +0 -3
  14. package/dist/exceptions.js.map +1 -1
  15. package/dist/models.d.ts +7 -8
  16. package/dist/models.d.ts.map +1 -1
  17. package/dist/models.js +28 -13
  18. package/dist/models.js.map +1 -1
  19. package/dist/paragraph-builder.d.ts +0 -8
  20. package/dist/paragraph-builder.d.ts.map +1 -1
  21. package/dist/paragraph-builder.js +0 -8
  22. package/dist/paragraph-builder.js.map +1 -1
  23. package/example.ts +6 -10
  24. package/fixtures/form-xobject-example.pdf +0 -0
  25. package/jest.config.js +25 -24
  26. package/package.json +1 -1
  27. package/src/__tests__/assertions.ts +12 -0
  28. package/src/__tests__/client-v1.test.ts +6 -6
  29. package/src/__tests__/e2e/form.test.ts +42 -44
  30. package/src/__tests__/e2e/image.test.ts +97 -101
  31. package/src/__tests__/e2e/line.test.ts +115 -127
  32. package/src/__tests__/e2e/page.test.ts +3 -6
  33. package/src/__tests__/e2e/paragraph.test.ts +187 -204
  34. package/src/__tests__/e2e/path.test.ts +12 -16
  35. package/src/client-v1.ts +575 -591
  36. package/src/exceptions.ts +27 -30
  37. package/src/models.ts +382 -355
  38. package/src/paragraph-builder.ts +0 -8
@@ -28,7 +28,6 @@ export class ParagraphBuilder {
28
28
 
29
29
  /**
30
30
  * Set the text content for the paragraph.
31
- * Equivalent to fromString() methods in Python ParagraphBuilder.
32
31
  */
33
32
  fromString(text: string, color?: Color): ParagraphBuilder {
34
33
  if (text === null || text === undefined) {
@@ -48,7 +47,6 @@ export class ParagraphBuilder {
48
47
 
49
48
  /**
50
49
  * Set the font for the paragraph using an existing Font object.
51
- * Equivalent to withFont(Font) in Python ParagraphBuilder.
52
50
  */
53
51
  withFont(font: Font): ParagraphBuilder {
54
52
  if (!font) {
@@ -61,7 +59,6 @@ export class ParagraphBuilder {
61
59
 
62
60
  /**
63
61
  * Set the font for the paragraph using a TTF file.
64
- * Equivalent to withFont(File, double) in Python ParagraphBuilder.
65
62
  */
66
63
  async withFontFile(ttfFile: Uint8Array | File, fontSize: number): Promise<ParagraphBuilder> {
67
64
  if (!ttfFile) {
@@ -78,7 +75,6 @@ export class ParagraphBuilder {
78
75
 
79
76
  /**
80
77
  * Set the line spacing for the paragraph.
81
- * Equivalent to withLineSpacing() in Python ParagraphBuilder.
82
78
  */
83
79
  withLineSpacing(spacing: number): ParagraphBuilder {
84
80
  if (spacing <= 0) {
@@ -91,7 +87,6 @@ export class ParagraphBuilder {
91
87
 
92
88
  /**
93
89
  * Set the text color for the paragraph.
94
- * Equivalent to withColor() in Python ParagraphBuilder.
95
90
  */
96
91
  withColor(color: Color): ParagraphBuilder {
97
92
  if (!color) {
@@ -104,7 +99,6 @@ export class ParagraphBuilder {
104
99
 
105
100
  /**
106
101
  * Set the position for the paragraph.
107
- * Equivalent to withPosition() in Python ParagraphBuilder.
108
102
  */
109
103
  withPosition(position: Position): ParagraphBuilder {
110
104
  if (!position) {
@@ -117,7 +111,6 @@ export class ParagraphBuilder {
117
111
 
118
112
  /**
119
113
  * Build and return the final Paragraph object.
120
- * Equivalent to build() in Python ParagraphBuilder.
121
114
  */
122
115
  build(): Paragraph {
123
116
  // Validate required fields
@@ -144,7 +137,6 @@ export class ParagraphBuilder {
144
137
 
145
138
  /**
146
139
  * Register a TTF font with the client and return a Font object.
147
- * Equivalent to registerTTF() private method in Python ParagraphBuilder.
148
140
  */
149
141
  private async _registerTtf(ttfFile: Uint8Array | File, fontSize: number): Promise<Font> {
150
142
  try {