@oscharko-dev/keiko 0.2.0-beta.0 → 0.2.0-beta.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.
- package/README.md +6 -5
- package/dist/ui/csp-hashes.json +20 -20
- package/dist/ui/static/404.html +1 -1
- package/dist/ui/static/_next/static/chunks/{422-70c16ea4b1f77f2e.js → 923-4141696576191bc0.js} +1 -1
- package/dist/ui/static/_next/static/chunks/app/_not-found/page-03d642dcd0f15b52.js +1 -0
- package/dist/ui/static/_next/static/chunks/app/launch/page-c725ff0c02b50663.js +1 -0
- package/dist/ui/static/_next/static/chunks/app/layout-aadefe615729db05.js +1 -0
- package/dist/ui/static/_next/static/chunks/app/local-knowledge/capsule/{page-0dc74e194a1f0092.js → page-4a7f242906e19a07.js} +1 -1
- package/dist/ui/static/_next/static/chunks/app/local-knowledge/page-3361769b8964e659.js +1 -0
- package/dist/ui/static/_next/static/chunks/app/memoriaviva/consolidation/{page-dc6c6bd180bc47a3.js → page-44b3f4fa3e10085f.js} +1 -1
- package/dist/ui/static/_next/static/chunks/app/memoriaviva/detail/{page-659e308e68ab2b1e.js → page-0cdfb3eeb659daeb.js} +1 -1
- package/dist/ui/static/_next/static/chunks/app/memoriaviva/{page-d6ba78f54207b69f.js → page-e78e0cd2876fec41.js} +1 -1
- package/dist/ui/static/_next/static/chunks/app/memoriaviva/review-queue/page-e32fe86466827484.js +1 -0
- package/dist/ui/static/_next/static/chunks/app/page-9ad91065d05ddfa0.js +1 -0
- package/dist/ui/static/_next/static/chunks/{main-app-5b043f6c611974ae.js → main-app-b52a8fa1d8127a5f.js} +1 -1
- package/dist/ui/static/apple-touch-icon.png +0 -0
- package/dist/ui/static/favicon.ico +0 -0
- package/dist/ui/static/icon-192-maskable.png +0 -0
- package/dist/ui/static/icon-192.png +0 -0
- package/dist/ui/static/icon-512-maskable.png +0 -0
- package/dist/ui/static/icon-512.png +0 -0
- package/dist/ui/static/index.html +1 -1
- package/dist/ui/static/index.txt +3 -3
- package/dist/ui/static/launch.html +1 -1
- package/dist/ui/static/launch.txt +3 -3
- package/dist/ui/static/local-knowledge/capsule.html +1 -1
- package/dist/ui/static/local-knowledge/capsule.txt +2 -2
- package/dist/ui/static/local-knowledge.html +1 -1
- package/dist/ui/static/local-knowledge.txt +2 -2
- package/dist/ui/static/memoriaviva/consolidation.html +1 -1
- package/dist/ui/static/memoriaviva/consolidation.txt +2 -2
- package/dist/ui/static/memoriaviva/detail.html +1 -1
- package/dist/ui/static/memoriaviva/detail.txt +2 -2
- package/dist/ui/static/memoriaviva/review-queue.html +1 -1
- package/dist/ui/static/memoriaviva/review-queue.txt +2 -2
- package/dist/ui/static/memoriaviva.html +1 -1
- package/dist/ui/static/memoriaviva.txt +2 -2
- package/node_modules/@oscharko-dev/keiko-cli/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-cli/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/index.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/index.js +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-evaluations/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-evaluations/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-evidence/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-evidence/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-harness/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-harness/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/parsers/pdf-parser.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/parsers/pdf-parser.js +2 -2
- package/node_modules/@oscharko-dev/keiko-local-knowledge/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-capture/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-consolidation/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-governance/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-retrieval/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-vault/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-quality-intelligence/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-sdk/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-sdk/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-security/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-security/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-server/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-tools/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-tools/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-verification/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-verification/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-workflows/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-workflows/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/package.json +1 -1
- package/package.json +4 -3
- package/dist/ui/static/_next/static/chunks/app/_not-found/page-c4d800f366186be0.js +0 -1
- package/dist/ui/static/_next/static/chunks/app/launch/page-08afd1a052e7662c.js +0 -1
- package/dist/ui/static/_next/static/chunks/app/layout-0f75a39edc90325d.js +0 -1
- package/dist/ui/static/_next/static/chunks/app/local-knowledge/page-48bd57c5e542349e.js +0 -1
- package/dist/ui/static/_next/static/chunks/app/memoriaviva/review-queue/page-7186cd8b22efc78b.js +0 -1
- package/dist/ui/static/_next/static/chunks/app/page-f8386b8e05b3db03.js +0 -1
- package/node_modules/@napi-rs/canvas/LICENSE +0 -21
- package/node_modules/@napi-rs/canvas/README.md +0 -448
- package/node_modules/@napi-rs/canvas/geometry.js +0 -873
- package/node_modules/@napi-rs/canvas/index.d.ts +0 -1097
- package/node_modules/@napi-rs/canvas/index.js +0 -196
- package/node_modules/@napi-rs/canvas/js-binding.js +0 -464
- package/node_modules/@napi-rs/canvas/load-image.js +0 -156
- package/node_modules/@napi-rs/canvas/node-canvas.d.ts +0 -216
- package/node_modules/@napi-rs/canvas/node-canvas.js +0 -379
- package/node_modules/@napi-rs/canvas/package.json +0 -179
- package/node_modules/@napi-rs/canvas-linux-x64-gnu/README.md +0 -3
- package/node_modules/@napi-rs/canvas-linux-x64-gnu/package.json +0 -47
- package/node_modules/@napi-rs/canvas-linux-x64-gnu/skia.linux-x64-gnu.node +0 -0
- package/node_modules/@napi-rs/canvas-linux-x64-musl/README.md +0 -3
- package/node_modules/@napi-rs/canvas-linux-x64-musl/package.json +0 -47
- package/node_modules/@napi-rs/canvas-linux-x64-musl/skia.linux-x64-musl.node +0 -0
- /package/dist/ui/static/_next/static/{IZjQES_2JaG9qZ7_fkEPl → BNiyfCos3TiM2QdurajIZ}/_buildManifest.js +0 -0
- /package/dist/ui/static/_next/static/{IZjQES_2JaG9qZ7_fkEPl → BNiyfCos3TiM2QdurajIZ}/_ssgManifest.js +0 -0
|
@@ -1,1097 +0,0 @@
|
|
|
1
|
-
import { ReadableStream } from 'node:stream/web'
|
|
2
|
-
|
|
3
|
-
// Clear all type of caches in Skia
|
|
4
|
-
export function clearAllCache(): void
|
|
5
|
-
|
|
6
|
-
interface CanvasRenderingContext2D
|
|
7
|
-
extends CanvasCompositing,
|
|
8
|
-
CanvasDrawPath,
|
|
9
|
-
CanvasFillStrokeStyles,
|
|
10
|
-
CanvasFilters,
|
|
11
|
-
CanvasImageData,
|
|
12
|
-
CanvasImageSmoothing,
|
|
13
|
-
CanvasPath,
|
|
14
|
-
CanvasPathDrawingStyles,
|
|
15
|
-
CanvasRect,
|
|
16
|
-
CanvasSettings,
|
|
17
|
-
CanvasShadowStyles,
|
|
18
|
-
CanvasState,
|
|
19
|
-
CanvasText,
|
|
20
|
-
CanvasTextDrawingStyles,
|
|
21
|
-
CanvasTransform,
|
|
22
|
-
CanvasPDFAnnotations { }
|
|
23
|
-
|
|
24
|
-
interface CanvasState {
|
|
25
|
-
isContextLost(): boolean
|
|
26
|
-
reset(): void
|
|
27
|
-
restore(): void
|
|
28
|
-
save(): void
|
|
29
|
-
}
|
|
30
|
-
interface CanvasShadowStyles {
|
|
31
|
-
shadowBlur: number
|
|
32
|
-
shadowColor: string
|
|
33
|
-
shadowOffsetX: number
|
|
34
|
-
shadowOffsetY: number
|
|
35
|
-
}
|
|
36
|
-
interface CanvasRenderingContext2DSettings {
|
|
37
|
-
alpha?: boolean
|
|
38
|
-
colorSpace?: PredefinedColorSpace
|
|
39
|
-
desynchronized?: boolean
|
|
40
|
-
willReadFrequently?: boolean
|
|
41
|
-
}
|
|
42
|
-
interface CanvasSettings {
|
|
43
|
-
getContextAttributes(): CanvasRenderingContext2DSettings
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
interface CanvasRect {
|
|
47
|
-
clearRect(x: number, y: number, w: number, h: number): void
|
|
48
|
-
fillRect(x: number, y: number, w: number, h: number): void
|
|
49
|
-
strokeRect(x: number, y: number, w: number, h: number): void
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
interface TextMetrics {
|
|
53
|
-
readonly actualBoundingBoxAscent: number
|
|
54
|
-
readonly actualBoundingBoxDescent: number
|
|
55
|
-
readonly actualBoundingBoxLeft: number
|
|
56
|
-
readonly actualBoundingBoxRight: number
|
|
57
|
-
readonly alphabeticBaseline: number
|
|
58
|
-
readonly emHeightAscent: number
|
|
59
|
-
readonly emHeightDescent: number
|
|
60
|
-
readonly fontBoundingBoxAscent: number
|
|
61
|
-
readonly fontBoundingBoxDescent: number
|
|
62
|
-
readonly hangingBaseline: number
|
|
63
|
-
readonly ideographicBaseline: number
|
|
64
|
-
readonly width: number
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
interface CanvasText {
|
|
68
|
-
fillText(text: string, x: number, y: number, maxWidth?: number): void
|
|
69
|
-
measureText(text: string): TextMetrics
|
|
70
|
-
strokeText(text: string, x: number, y: number, maxWidth?: number): void
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
type CanvasLineCap = 'butt' | 'round' | 'square'
|
|
74
|
-
type CanvasLineJoin = 'bevel' | 'miter' | 'round'
|
|
75
|
-
|
|
76
|
-
interface CanvasPathDrawingStyles {
|
|
77
|
-
lineCap: CanvasLineCap
|
|
78
|
-
lineDashOffset: number
|
|
79
|
-
lineJoin: CanvasLineJoin
|
|
80
|
-
lineWidth: number
|
|
81
|
-
miterLimit: number
|
|
82
|
-
getLineDash(): number[]
|
|
83
|
-
setLineDash(segments: number[]): void
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
interface CanvasPath {
|
|
87
|
-
arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise?: boolean): void
|
|
88
|
-
arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void
|
|
89
|
-
bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void
|
|
90
|
-
closePath(): void
|
|
91
|
-
ellipse(
|
|
92
|
-
x: number,
|
|
93
|
-
y: number,
|
|
94
|
-
radiusX: number,
|
|
95
|
-
radiusY: number,
|
|
96
|
-
rotation: number,
|
|
97
|
-
startAngle: number,
|
|
98
|
-
endAngle: number,
|
|
99
|
-
counterclockwise?: boolean,
|
|
100
|
-
): void
|
|
101
|
-
lineTo(x: number, y: number): void
|
|
102
|
-
moveTo(x: number, y: number): void
|
|
103
|
-
quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void
|
|
104
|
-
rect(x: number, y: number, w: number, h: number): void
|
|
105
|
-
roundRect(x: number, y: number, w: number, h: number, radii?: number | DOMPointInit | (number | DOMPointInit)[]): void
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
type ImageSmoothingQuality = 'high' | 'low' | 'medium'
|
|
109
|
-
|
|
110
|
-
interface CanvasImageSmoothing {
|
|
111
|
-
imageSmoothingEnabled: boolean
|
|
112
|
-
imageSmoothingQuality: ImageSmoothingQuality
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
interface CanvasTransform {
|
|
116
|
-
resetTransform(): void
|
|
117
|
-
rotate(angle: number): void
|
|
118
|
-
scale(x: number, y: number): void
|
|
119
|
-
setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void
|
|
120
|
-
setTransform(transform?: DOMMatrix2DInit): void
|
|
121
|
-
transform(a: number, b: number, c: number, d: number, e: number, f: number): void
|
|
122
|
-
translate(x: number, y: number): void
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
interface CanvasPDFAnnotations {
|
|
126
|
-
/**
|
|
127
|
-
* Create a clickable URL link annotation in a PDF document.
|
|
128
|
-
* This is only effective when used with PDF documents.
|
|
129
|
-
* @param left - Left coordinate of the link rectangle
|
|
130
|
-
* @param top - Top coordinate of the link rectangle
|
|
131
|
-
* @param right - Right coordinate of the link rectangle
|
|
132
|
-
* @param bottom - Bottom coordinate of the link rectangle
|
|
133
|
-
* @param url - The URL to link to
|
|
134
|
-
*/
|
|
135
|
-
annotateLinkUrl(left: number, top: number, right: number, bottom: number, url: string): void
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Create a named destination at a specific point in a PDF document.
|
|
139
|
-
* This destination can be used as a target for internal links.
|
|
140
|
-
* @param x - X coordinate of the destination point
|
|
141
|
-
* @param y - Y coordinate of the destination point
|
|
142
|
-
* @param name - Name identifier for the destination
|
|
143
|
-
*/
|
|
144
|
-
annotateNamedDestination(x: number, y: number, name: string): void
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Create a link to a named destination within the PDF document.
|
|
148
|
-
* This is only effective when used with PDF documents.
|
|
149
|
-
* @param left - Left coordinate of the link rectangle
|
|
150
|
-
* @param top - Top coordinate of the link rectangle
|
|
151
|
-
* @param right - Right coordinate of the link rectangle
|
|
152
|
-
* @param bottom - Bottom coordinate of the link rectangle
|
|
153
|
-
* @param name - Name of the destination to link to
|
|
154
|
-
*/
|
|
155
|
-
annotateLinkToDestination(left: number, top: number, right: number, bottom: number, name: string): void
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
type PredefinedColorSpace = 'display-p3' | 'srgb'
|
|
159
|
-
|
|
160
|
-
interface ImageDataSettings {
|
|
161
|
-
colorSpace?: PredefinedColorSpace
|
|
162
|
-
}
|
|
163
|
-
interface CanvasImageData {
|
|
164
|
-
createImageData(sw: number, sh: number, settings?: ImageDataSettings): ImageData
|
|
165
|
-
createImageData(imagedata: ImageData): ImageData
|
|
166
|
-
getImageData(sx: number, sy: number, sw: number, sh: number, settings?: ImageDataSettings): ImageData
|
|
167
|
-
putImageData(imagedata: ImageData, dx: number, dy: number): void
|
|
168
|
-
putImageData(
|
|
169
|
-
imagedata: ImageData,
|
|
170
|
-
dx: number,
|
|
171
|
-
dy: number,
|
|
172
|
-
dirtyX: number,
|
|
173
|
-
dirtyY: number,
|
|
174
|
-
dirtyWidth: number,
|
|
175
|
-
dirtyHeight: number,
|
|
176
|
-
): void
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
type CanvasDirection = 'inherit' | 'ltr' | 'rtl'
|
|
180
|
-
type CanvasFontKerning = 'auto' | 'none' | 'normal'
|
|
181
|
-
type CanvasFontStretch =
|
|
182
|
-
| 'condensed'
|
|
183
|
-
| 'expanded'
|
|
184
|
-
| 'extra-condensed'
|
|
185
|
-
| 'extra-expanded'
|
|
186
|
-
| 'normal'
|
|
187
|
-
| 'semi-condensed'
|
|
188
|
-
| 'semi-expanded'
|
|
189
|
-
| 'ultra-condensed'
|
|
190
|
-
| 'ultra-expanded'
|
|
191
|
-
type CanvasFontVariantCaps =
|
|
192
|
-
| 'all-petite-caps'
|
|
193
|
-
| 'all-small-caps'
|
|
194
|
-
| 'normal'
|
|
195
|
-
| 'petite-caps'
|
|
196
|
-
| 'small-caps'
|
|
197
|
-
| 'titling-caps'
|
|
198
|
-
| 'unicase'
|
|
199
|
-
type CanvasTextAlign = 'center' | 'end' | 'left' | 'right' | 'start'
|
|
200
|
-
type CanvasTextBaseline = 'alphabetic' | 'bottom' | 'hanging' | 'ideographic' | 'middle' | 'top'
|
|
201
|
-
type CanvasTextRendering = 'auto' | 'geometricPrecision' | 'optimizeLegibility' | 'optimizeSpeed'
|
|
202
|
-
|
|
203
|
-
interface CanvasTextDrawingStyles {
|
|
204
|
-
direction: CanvasDirection
|
|
205
|
-
font: string
|
|
206
|
-
fontKerning: CanvasFontKerning
|
|
207
|
-
fontStretch: CanvasFontStretch
|
|
208
|
-
fontVariantCaps: CanvasFontVariantCaps
|
|
209
|
-
letterSpacing: string
|
|
210
|
-
textAlign: CanvasTextAlign
|
|
211
|
-
textBaseline: CanvasTextBaseline
|
|
212
|
-
textRendering: CanvasTextRendering
|
|
213
|
-
wordSpacing: string
|
|
214
|
-
fontVariationSettings: string
|
|
215
|
-
lang: string
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
interface CanvasFilters {
|
|
219
|
-
filter: string
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
interface CanvasFillStrokeStyles {
|
|
223
|
-
fillStyle: string | CanvasGradient | CanvasPattern
|
|
224
|
-
strokeStyle: string | CanvasGradient | CanvasPattern
|
|
225
|
-
createConicGradient(startAngle: number, x: number, y: number): CanvasGradient
|
|
226
|
-
createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient
|
|
227
|
-
createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
type CanvasFillRule = 'evenodd' | 'nonzero'
|
|
231
|
-
|
|
232
|
-
interface CanvasDrawPath {
|
|
233
|
-
beginPath(): void
|
|
234
|
-
clip(fillRule?: CanvasFillRule): void
|
|
235
|
-
clip(path: Path2D, fillRule?: CanvasFillRule): void
|
|
236
|
-
fill(fillRule?: CanvasFillRule): void
|
|
237
|
-
fill(path: Path2D, fillRule?: CanvasFillRule): void
|
|
238
|
-
isPointInPath(x: number, y: number, fillRule?: CanvasFillRule): boolean
|
|
239
|
-
isPointInPath(path: Path2D, x: number, y: number, fillRule?: CanvasFillRule): boolean
|
|
240
|
-
isPointInStroke(x: number, y: number): boolean
|
|
241
|
-
isPointInStroke(path: Path2D, x: number, y: number): boolean
|
|
242
|
-
stroke(): void
|
|
243
|
-
stroke(path: Path2D): void
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
type GlobalCompositeOperation =
|
|
247
|
-
| 'color'
|
|
248
|
-
| 'color-burn'
|
|
249
|
-
| 'color-dodge'
|
|
250
|
-
| 'copy'
|
|
251
|
-
| 'darken'
|
|
252
|
-
| 'destination-atop'
|
|
253
|
-
| 'destination-in'
|
|
254
|
-
| 'destination-out'
|
|
255
|
-
| 'destination-over'
|
|
256
|
-
| 'difference'
|
|
257
|
-
| 'exclusion'
|
|
258
|
-
| 'hard-light'
|
|
259
|
-
| 'hue'
|
|
260
|
-
| 'lighten'
|
|
261
|
-
| 'lighter'
|
|
262
|
-
| 'luminosity'
|
|
263
|
-
| 'multiply'
|
|
264
|
-
| 'overlay'
|
|
265
|
-
| 'saturation'
|
|
266
|
-
| 'screen'
|
|
267
|
-
| 'soft-light'
|
|
268
|
-
| 'source-atop'
|
|
269
|
-
| 'source-in'
|
|
270
|
-
| 'source-out'
|
|
271
|
-
| 'source-over'
|
|
272
|
-
| 'xor'
|
|
273
|
-
|
|
274
|
-
interface CanvasCompositing {
|
|
275
|
-
globalAlpha: number
|
|
276
|
-
globalCompositeOperation: GlobalCompositeOperation
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
interface DOMPointInit {
|
|
280
|
-
w?: number
|
|
281
|
-
x?: number
|
|
282
|
-
y?: number
|
|
283
|
-
z?: number
|
|
284
|
-
}
|
|
285
|
-
interface CanvasPattern {
|
|
286
|
-
setTransform(transform?: DOMMatrix2DInit): void
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
interface CanvasGradient {
|
|
290
|
-
addColorStop(offset: number, color: string): void
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
interface DOMRectInit {
|
|
294
|
-
height?: number
|
|
295
|
-
width?: number
|
|
296
|
-
x?: number
|
|
297
|
-
y?: number
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
interface DOMMatrixInit extends DOMMatrix2DInit {
|
|
301
|
-
is2D?: boolean
|
|
302
|
-
m13?: number
|
|
303
|
-
m14?: number
|
|
304
|
-
m23?: number
|
|
305
|
-
m24?: number
|
|
306
|
-
m31?: number
|
|
307
|
-
m32?: number
|
|
308
|
-
m33?: number
|
|
309
|
-
m34?: number
|
|
310
|
-
m43?: number
|
|
311
|
-
m44?: number
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
// ----------- added types
|
|
315
|
-
|
|
316
|
-
export interface DOMMatrix2DInit {
|
|
317
|
-
a: number
|
|
318
|
-
b: number
|
|
319
|
-
c: number
|
|
320
|
-
d: number
|
|
321
|
-
e: number
|
|
322
|
-
f: number
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
interface DOMMatrixReadOnly {
|
|
326
|
-
readonly a: number
|
|
327
|
-
readonly b: number
|
|
328
|
-
readonly c: number
|
|
329
|
-
readonly d: number
|
|
330
|
-
readonly e: number
|
|
331
|
-
readonly f: number
|
|
332
|
-
readonly is2D: boolean
|
|
333
|
-
readonly isIdentity: boolean
|
|
334
|
-
readonly m11: number
|
|
335
|
-
readonly m12: number
|
|
336
|
-
readonly m13: number
|
|
337
|
-
readonly m14: number
|
|
338
|
-
readonly m21: number
|
|
339
|
-
readonly m22: number
|
|
340
|
-
readonly m23: number
|
|
341
|
-
readonly m24: number
|
|
342
|
-
readonly m31: number
|
|
343
|
-
readonly m32: number
|
|
344
|
-
readonly m33: number
|
|
345
|
-
readonly m34: number
|
|
346
|
-
readonly m41: number
|
|
347
|
-
readonly m42: number
|
|
348
|
-
readonly m43: number
|
|
349
|
-
readonly m44: number
|
|
350
|
-
flipX(): DOMMatrix
|
|
351
|
-
flipY(): DOMMatrix
|
|
352
|
-
inverse(): DOMMatrix
|
|
353
|
-
multiply(other?: DOMMatrixInit): DOMMatrix
|
|
354
|
-
rotate(rotX?: number, rotY?: number, rotZ?: number): DOMMatrix
|
|
355
|
-
rotateAxisAngle(x?: number, y?: number, z?: number, angle?: number): DOMMatrix
|
|
356
|
-
rotateFromVector(x?: number, y?: number): DOMMatrix
|
|
357
|
-
scale(
|
|
358
|
-
scaleX?: number,
|
|
359
|
-
scaleY?: number,
|
|
360
|
-
scaleZ?: number,
|
|
361
|
-
originX?: number,
|
|
362
|
-
originY?: number,
|
|
363
|
-
originZ?: number,
|
|
364
|
-
): DOMMatrix
|
|
365
|
-
scale3d(scale?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix
|
|
366
|
-
skewX(sx?: number): DOMMatrix
|
|
367
|
-
skewY(sy?: number): DOMMatrix
|
|
368
|
-
toFloat32Array(): Float32Array
|
|
369
|
-
toFloat64Array(): Float64Array
|
|
370
|
-
transformPoint(point?: DOMPointInit): DOMPoint
|
|
371
|
-
translate(tx?: number, ty?: number, tz?: number): DOMMatrix
|
|
372
|
-
toString(): string
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
export interface DOMMatrix extends DOMMatrixReadOnly {
|
|
376
|
-
a: number
|
|
377
|
-
b: number
|
|
378
|
-
c: number
|
|
379
|
-
d: number
|
|
380
|
-
e: number
|
|
381
|
-
f: number
|
|
382
|
-
m11: number
|
|
383
|
-
m12: number
|
|
384
|
-
m13: number
|
|
385
|
-
m14: number
|
|
386
|
-
m21: number
|
|
387
|
-
m22: number
|
|
388
|
-
m23: number
|
|
389
|
-
m24: number
|
|
390
|
-
m31: number
|
|
391
|
-
m32: number
|
|
392
|
-
m33: number
|
|
393
|
-
m34: number
|
|
394
|
-
m41: number
|
|
395
|
-
m42: number
|
|
396
|
-
m43: number
|
|
397
|
-
m44: number
|
|
398
|
-
invertSelf(): DOMMatrix
|
|
399
|
-
multiplySelf(other?: DOMMatrixInit): DOMMatrix
|
|
400
|
-
preMultiplySelf(other?: DOMMatrixInit): DOMMatrix
|
|
401
|
-
rotateAxisAngleSelf(x?: number, y?: number, z?: number, angle?: number): DOMMatrix
|
|
402
|
-
rotateFromVectorSelf(x?: number, y?: number): DOMMatrix
|
|
403
|
-
rotateSelf(rotX?: number, rotY?: number, rotZ?: number): DOMMatrix
|
|
404
|
-
scale3dSelf(scale?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix
|
|
405
|
-
scaleSelf(
|
|
406
|
-
scaleX?: number,
|
|
407
|
-
scaleY?: number,
|
|
408
|
-
scaleZ?: number,
|
|
409
|
-
originX?: number,
|
|
410
|
-
originY?: number,
|
|
411
|
-
originZ?: number,
|
|
412
|
-
): DOMMatrix
|
|
413
|
-
setMatrixValue(transformList: string): DOMMatrix
|
|
414
|
-
skewXSelf(sx?: number): DOMMatrix
|
|
415
|
-
skewYSelf(sy?: number): DOMMatrix
|
|
416
|
-
translateSelf(tx?: number, ty?: number, tz?: number): DOMMatrix
|
|
417
|
-
toJSON(): { [K in OmitNeverOfMatrix]: DOMMatrix[K] }
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
type OmitMatrixMethod = { [K in keyof DOMMatrix]: DOMMatrix[K] extends (...args: any[]) => any ? never : K }
|
|
421
|
-
|
|
422
|
-
type OmitNeverOfMatrix = OmitMatrixMethod[keyof OmitMatrixMethod]
|
|
423
|
-
|
|
424
|
-
export const DOMMatrix: {
|
|
425
|
-
prototype: DOMMatrix
|
|
426
|
-
new(init?: string | number[]): DOMMatrix
|
|
427
|
-
fromFloat32Array(array32: Float32Array): DOMMatrix
|
|
428
|
-
fromFloat64Array(array64: Float64Array): DOMMatrix
|
|
429
|
-
fromMatrix(other?: DOMMatrixInit): DOMMatrix
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
interface DOMRectReadOnly {
|
|
433
|
-
readonly bottom: number
|
|
434
|
-
readonly height: number
|
|
435
|
-
readonly left: number
|
|
436
|
-
readonly right: number
|
|
437
|
-
readonly top: number
|
|
438
|
-
readonly width: number
|
|
439
|
-
readonly x: number
|
|
440
|
-
readonly y: number
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
export interface DOMRect extends DOMRectReadOnly {
|
|
444
|
-
height: number
|
|
445
|
-
width: number
|
|
446
|
-
x: number
|
|
447
|
-
y: number
|
|
448
|
-
toJSON(): Omit<this, 'toJSON' | 'fromRect'>
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
export const DOMRect: {
|
|
452
|
-
prototype: DOMRect
|
|
453
|
-
new(x?: number, y?: number, width?: number, height?: number): DOMRect
|
|
454
|
-
fromRect(other?: DOMRectInit): DOMRect
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
interface DOMPointReadOnly {
|
|
458
|
-
readonly w: number
|
|
459
|
-
readonly x: number
|
|
460
|
-
readonly y: number
|
|
461
|
-
readonly z: number
|
|
462
|
-
matrixTransform(matrix?: DOMMatrixInit): DOMPoint
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
export interface DOMPoint extends DOMPointReadOnly {
|
|
466
|
-
w: number
|
|
467
|
-
x: number
|
|
468
|
-
y: number
|
|
469
|
-
z: number
|
|
470
|
-
toJSON(): Omit<DOMPoint, 'matrixTransform' | 'toJSON'>
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
export const DOMPoint: {
|
|
474
|
-
prototype: DOMPoint
|
|
475
|
-
new(x?: number, y?: number, z?: number, w?: number): DOMPoint
|
|
476
|
-
fromPoint(other?: DOMPointInit): DOMPoint
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
export class ImageData {
|
|
480
|
-
/**
|
|
481
|
-
* Returns the one-dimensional array containing the data in RGBA order, as integers in the range 0 to 255.
|
|
482
|
-
*/
|
|
483
|
-
readonly data: Uint8ClampedArray
|
|
484
|
-
/**
|
|
485
|
-
* Returns the actual dimensions of the data in the ImageData object, in pixels.
|
|
486
|
-
*/
|
|
487
|
-
readonly height: number
|
|
488
|
-
/**
|
|
489
|
-
* Returns the actual dimensions of the data in the ImageData object, in pixels.
|
|
490
|
-
*/
|
|
491
|
-
readonly width: number
|
|
492
|
-
|
|
493
|
-
constructor(sw: number, sh: number, attr?: { colorSpace?: ColorSpace })
|
|
494
|
-
constructor(imageData: ImageData, attr?: { colorSpace?: ColorSpace })
|
|
495
|
-
constructor(data: Uint8ClampedArray | Uint16Array | Float16Array | Float32Array, sw: number, sh?: number)
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
export class Image {
|
|
499
|
-
constructor()
|
|
500
|
-
// attrs only affects SVG
|
|
501
|
-
constructor(width: number, height: number, attrs?: { colorSpace?: ColorSpace })
|
|
502
|
-
width: number
|
|
503
|
-
height: number
|
|
504
|
-
readonly naturalWidth: number
|
|
505
|
-
readonly naturalHeight: number
|
|
506
|
-
readonly complete: boolean
|
|
507
|
-
readonly currentSrc: string | null
|
|
508
|
-
alt: string
|
|
509
|
-
// the src can be a Uint8Array or a string
|
|
510
|
-
// if it's a string, it can be a file path, a data URL, a remote URL, or a SVG string
|
|
511
|
-
src: Uint8Array | string
|
|
512
|
-
onload?(): void
|
|
513
|
-
onerror?(err: Error): void
|
|
514
|
-
decode(): Promise<void>
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
export class Path2D {
|
|
518
|
-
constructor(path?: Path2D | string)
|
|
519
|
-
|
|
520
|
-
addPath(path: Path2D, transform?: DOMMatrix2DInit): void
|
|
521
|
-
arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void
|
|
522
|
-
arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void
|
|
523
|
-
bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void
|
|
524
|
-
closePath(): void
|
|
525
|
-
ellipse(
|
|
526
|
-
x: number,
|
|
527
|
-
y: number,
|
|
528
|
-
radiusX: number,
|
|
529
|
-
radiusY: number,
|
|
530
|
-
rotation: number,
|
|
531
|
-
startAngle: number,
|
|
532
|
-
endAngle: number,
|
|
533
|
-
anticlockwise?: boolean,
|
|
534
|
-
): void
|
|
535
|
-
lineTo(x: number, y: number): void
|
|
536
|
-
moveTo(x: number, y: number): void
|
|
537
|
-
quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void
|
|
538
|
-
rect(x: number, y: number, w: number, h: number): void
|
|
539
|
-
roundRect(x: number, y: number, w: number, h: number, radii?: number | number[]): void
|
|
540
|
-
|
|
541
|
-
// PathKit methods
|
|
542
|
-
op(path: Path2D, operation: PathOp): Path2D
|
|
543
|
-
toSVGString(): string
|
|
544
|
-
getFillType(): FillType
|
|
545
|
-
getFillTypeString(): string
|
|
546
|
-
setFillType(type: FillType): void
|
|
547
|
-
simplify(): Path2D
|
|
548
|
-
asWinding(): Path2D
|
|
549
|
-
stroke(stroke?: StrokeOptions): Path2D
|
|
550
|
-
transform(transform: DOMMatrix2DInit): Path2D
|
|
551
|
-
getBounds(): [left: number, top: number, right: number, bottom: number]
|
|
552
|
-
computeTightBounds(): [left: number, top: number, right: number, bottom: number]
|
|
553
|
-
trim(start: number, end: number, isComplement?: boolean): Path2D
|
|
554
|
-
dash(on: number, off: number, phase: number): Path2D
|
|
555
|
-
round(radius: number): Path2D
|
|
556
|
-
equals(path: Path2D): boolean
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
export interface StrokeOptions {
|
|
560
|
-
width?: number
|
|
561
|
-
miterLimit?: number
|
|
562
|
-
cap?: StrokeCap
|
|
563
|
-
join?: StrokeJoin
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
export interface SKRSContext2D extends CanvasRenderingContext2D {
|
|
567
|
-
canvas: Canvas
|
|
568
|
-
/**
|
|
569
|
-
* @param startAngle The angle at which to begin the gradient, in radians. Angle measurements start vertically above the centre and move around clockwise.
|
|
570
|
-
* @param x The x-axis coordinate of the centre of the gradient.
|
|
571
|
-
* @param y The y-axis coordinate of the centre of the gradient.
|
|
572
|
-
*/
|
|
573
|
-
createConicGradient(startAngle: number, x: number, y: number): CanvasGradient
|
|
574
|
-
drawImage(image: Image | Canvas, dx: number, dy: number): void
|
|
575
|
-
drawImage(image: Image | Canvas, dx: number, dy: number, dw: number, dh: number): void
|
|
576
|
-
drawImage(
|
|
577
|
-
image: Image | Canvas,
|
|
578
|
-
sx: number,
|
|
579
|
-
sy: number,
|
|
580
|
-
sw: number,
|
|
581
|
-
sh: number,
|
|
582
|
-
dx: number,
|
|
583
|
-
dy: number,
|
|
584
|
-
dw: number,
|
|
585
|
-
dh: number,
|
|
586
|
-
): void
|
|
587
|
-
/**
|
|
588
|
-
* Draw another canvas, preserving vector graphics when possible.
|
|
589
|
-
* When the source canvas has recorded operations, this method preserves the
|
|
590
|
-
* SkPicture representation without rasterization, which can be faster than
|
|
591
|
-
* drawImage. Falls back to bitmap rendering if no picture is available.
|
|
592
|
-
*/
|
|
593
|
-
drawCanvas(canvas: Canvas, dx: number, dy: number): void
|
|
594
|
-
drawCanvas(canvas: Canvas, dx: number, dy: number, dWidth: number, dHeight: number): void
|
|
595
|
-
drawCanvas(
|
|
596
|
-
canvas: Canvas,
|
|
597
|
-
sx: number,
|
|
598
|
-
sy: number,
|
|
599
|
-
sWidth: number,
|
|
600
|
-
sHeight: number,
|
|
601
|
-
dx: number,
|
|
602
|
-
dy: number,
|
|
603
|
-
dWidth: number,
|
|
604
|
-
dHeight: number,
|
|
605
|
-
): void
|
|
606
|
-
createPattern(
|
|
607
|
-
image: Image | ImageData | Canvas | SvgCanvas,
|
|
608
|
-
repeat: 'repeat' | 'repeat-x' | 'repeat-y' | 'no-repeat' | null,
|
|
609
|
-
): CanvasPattern
|
|
610
|
-
getContextAttributes(): { alpha: boolean; desynchronized: boolean }
|
|
611
|
-
getTransform(): DOMMatrix
|
|
612
|
-
|
|
613
|
-
letterSpacing: string
|
|
614
|
-
wordSpacing: string
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
export type ColorSpace = 'srgb' | 'display-p3'
|
|
618
|
-
|
|
619
|
-
export interface ContextAttributes {
|
|
620
|
-
alpha?: boolean
|
|
621
|
-
colorSpace?: ColorSpace
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
export interface SvgCanvas {
|
|
625
|
-
width: number
|
|
626
|
-
height: number
|
|
627
|
-
getContext(contextType: '2d', contextAttributes?: ContextAttributes): SKRSContext2D
|
|
628
|
-
|
|
629
|
-
getContent(): Buffer
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
export interface AvifConfig {
|
|
633
|
-
/** 0-100 scale, 100 is lossless */
|
|
634
|
-
quality?: number
|
|
635
|
-
/** 0-100 scale */
|
|
636
|
-
alphaQuality?: number
|
|
637
|
-
/** rav1e preset 1 (slow) 10 (fast but crappy), default is 4 */
|
|
638
|
-
speed?: number
|
|
639
|
-
/** How many threads should be used (0 = match core count) */
|
|
640
|
-
threads?: number
|
|
641
|
-
/** set to '4:2:0' to use chroma subsampling, default '4:4:4' */
|
|
642
|
-
chromaSubsampling?: ChromaSubsampling
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
/** GIF encoding configuration for single-frame encoding */
|
|
646
|
-
export interface GifConfig {
|
|
647
|
-
/**
|
|
648
|
-
* Quality for NeuQuant color quantization (1-30, lower = slower but better quality)
|
|
649
|
-
* @default 10
|
|
650
|
-
*/
|
|
651
|
-
quality?: number
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
/** Configuration for the GIF encoder (animated GIFs) */
|
|
655
|
-
export interface GifEncoderConfig {
|
|
656
|
-
/**
|
|
657
|
-
* Loop count: 0 = infinite loop, positive number = finite loops
|
|
658
|
-
* @default 0 (infinite)
|
|
659
|
-
*/
|
|
660
|
-
repeat?: number
|
|
661
|
-
/**
|
|
662
|
-
* Quality for NeuQuant color quantization (1-30, lower = slower but better quality)
|
|
663
|
-
* @default 10
|
|
664
|
-
*/
|
|
665
|
-
quality?: number
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
/** Configuration for individual GIF frames */
|
|
669
|
-
export interface GifFrameConfig {
|
|
670
|
-
/**
|
|
671
|
-
* Frame delay in milliseconds
|
|
672
|
-
* @default 100
|
|
673
|
-
*/
|
|
674
|
-
delay?: number
|
|
675
|
-
/** Disposal method for this frame */
|
|
676
|
-
disposal?: GifDisposal
|
|
677
|
-
/** Transparent color index (0-255), if the frame has transparency */
|
|
678
|
-
transparent?: number
|
|
679
|
-
/** X offset of this frame within the canvas */
|
|
680
|
-
left?: number
|
|
681
|
-
/** Y offset of this frame within the canvas */
|
|
682
|
-
top?: number
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
/** GIF frame disposal method */
|
|
686
|
-
export enum GifDisposal {
|
|
687
|
-
/** Keep the frame visible (default) */
|
|
688
|
-
Keep = 0,
|
|
689
|
-
/** Clear the frame area to the background color */
|
|
690
|
-
Background = 1,
|
|
691
|
-
/** Restore to the previous frame */
|
|
692
|
-
Previous = 2,
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
/**
|
|
696
|
-
* GIF Encoder for creating animated GIFs.
|
|
697
|
-
* Implements `Disposable` interface for use with the `using` keyword (ES2024).
|
|
698
|
-
*
|
|
699
|
-
* @example
|
|
700
|
-
* ```typescript
|
|
701
|
-
* // Basic usage
|
|
702
|
-
* const encoder = new GifEncoder(100, 100, { repeat: 0, quality: 10 });
|
|
703
|
-
* encoder.addFrame(rgbaData, 100, 100, { delay: 100 });
|
|
704
|
-
* encoder.addFrame(rgbaData2, 100, 100, { delay: 100 });
|
|
705
|
-
* const buffer = encoder.finish();
|
|
706
|
-
*
|
|
707
|
-
* // With `using` keyword (automatic cleanup)
|
|
708
|
-
* {
|
|
709
|
-
* using encoder = new GifEncoder(100, 100);
|
|
710
|
-
* encoder.addFrame(frame1, 100, 100, { delay: 100 });
|
|
711
|
-
* const buffer = encoder.finish();
|
|
712
|
-
* } // encoder automatically disposed
|
|
713
|
-
* ```
|
|
714
|
-
*/
|
|
715
|
-
export class GifEncoder implements Disposable {
|
|
716
|
-
/**
|
|
717
|
-
* Create a new GIF encoder with the specified dimensions
|
|
718
|
-
* @param width - Width of the GIF canvas in pixels
|
|
719
|
-
* @param height - Height of the GIF canvas in pixels
|
|
720
|
-
* @param config - Optional encoder configuration
|
|
721
|
-
*/
|
|
722
|
-
constructor(width: number, height: number, config?: GifEncoderConfig)
|
|
723
|
-
|
|
724
|
-
/** Width of the GIF canvas */
|
|
725
|
-
readonly width: number
|
|
726
|
-
/** Height of the GIF canvas */
|
|
727
|
-
readonly height: number
|
|
728
|
-
/** Number of frames added so far */
|
|
729
|
-
readonly frameCount: number
|
|
730
|
-
|
|
731
|
-
/**
|
|
732
|
-
* Add a frame from RGBA pixel data
|
|
733
|
-
* @param data - RGBA pixel data (must be width * height * 4 bytes)
|
|
734
|
-
* @param width - Width of the frame in pixels
|
|
735
|
-
* @param height - Height of the frame in pixels
|
|
736
|
-
* @param config - Optional frame configuration
|
|
737
|
-
*/
|
|
738
|
-
addFrame(data: Uint8Array, width: number, height: number, config?: GifFrameConfig): void
|
|
739
|
-
|
|
740
|
-
/**
|
|
741
|
-
* Finish encoding and return the GIF data.
|
|
742
|
-
* Clears all accumulated frames after encoding.
|
|
743
|
-
* @throws Error if no frames have been added
|
|
744
|
-
*/
|
|
745
|
-
finish(): Buffer
|
|
746
|
-
|
|
747
|
-
/**
|
|
748
|
-
* Dispose of the encoder, clearing all accumulated frames without encoding.
|
|
749
|
-
* Called automatically when using the `using` keyword.
|
|
750
|
-
*/
|
|
751
|
-
dispose(): void
|
|
752
|
-
|
|
753
|
-
/**
|
|
754
|
-
* Symbol.dispose implementation for ES2024 Explicit Resource Management.
|
|
755
|
-
* Allows using `using encoder = new GifEncoder(...)` syntax.
|
|
756
|
-
*/
|
|
757
|
-
[Symbol.dispose](): void
|
|
758
|
-
}
|
|
759
|
-
/**
|
|
760
|
-
* https://en.wikipedia.org/wiki/Chroma_subsampling#Types_of_sampling_and_subsampling
|
|
761
|
-
* https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Video_concepts
|
|
762
|
-
*/
|
|
763
|
-
export enum ChromaSubsampling {
|
|
764
|
-
/**
|
|
765
|
-
* Each of the three Y'CbCr components has the same sample rate, thus there is no chroma subsampling. This scheme is sometimes used in high-end film scanners and cinematic post-production.
|
|
766
|
-
* Note that "4:4:4" may instead be wrongly referring to R'G'B' color space, which implicitly also does not have any chroma subsampling (except in JPEG R'G'B' can be subsampled).
|
|
767
|
-
* Formats such as HDCAM SR can record 4:4:4 R'G'B' over dual-link HD-SDI.
|
|
768
|
-
*/
|
|
769
|
-
Yuv444 = 0,
|
|
770
|
-
/**
|
|
771
|
-
* The two chroma components are sampled at half the horizontal sample rate of luma: the horizontal chroma resolution is halved. This reduces the bandwidth of an uncompressed video signal by one-third.
|
|
772
|
-
* Many high-end digital video formats and interfaces use this scheme:
|
|
773
|
-
* - [AVC-Intra 100](https://en.wikipedia.org/wiki/AVC-Intra)
|
|
774
|
-
* - [Digital Betacam](https://en.wikipedia.org/wiki/Betacam#Digital_Betacam)
|
|
775
|
-
* - [Betacam SX](https://en.wikipedia.org/wiki/Betacam#Betacam_SX)
|
|
776
|
-
* - [DVCPRO50](https://en.wikipedia.org/wiki/DV#DVCPRO) and [DVCPRO HD](https://en.wikipedia.org/wiki/DV#DVCPRO_HD)
|
|
777
|
-
* - [Digital-S](https://en.wikipedia.org/wiki/Digital-S)
|
|
778
|
-
* - [CCIR 601](https://en.wikipedia.org/wiki/Rec._601) / [Serial Digital Interface](https://en.wikipedia.org/wiki/Serial_digital_interface) / [D1](https://en.wikipedia.org/wiki/D-1_(Sony))
|
|
779
|
-
* - [ProRes (HQ, 422, LT, and Proxy)](https://en.wikipedia.org/wiki/Apple_ProRes)
|
|
780
|
-
* - [XDCAM HD422](https://en.wikipedia.org/wiki/XDCAM)
|
|
781
|
-
* - [Canon MXF HD422](https://en.wikipedia.org/wiki/Canon_XF-300)
|
|
782
|
-
*/
|
|
783
|
-
Yuv422 = 1,
|
|
784
|
-
/**
|
|
785
|
-
* n 4:2:0, the horizontal sampling is doubled compared to 4:1:1,
|
|
786
|
-
* but as the **Cb** and **Cr** channels are only sampled on each alternate line in this scheme, the vertical resolution is halved.
|
|
787
|
-
* The data rate is thus the same.
|
|
788
|
-
* This fits reasonably well with the PAL color encoding system, since this has only half the vertical chrominance resolution of [NTSC](https://en.wikipedia.org/wiki/NTSC).
|
|
789
|
-
* It would also fit extremely well with the [SECAM](https://en.wikipedia.org/wiki/SECAM) color encoding system,
|
|
790
|
-
* since like that format, 4:2:0 only stores and transmits one color channel per line (the other channel being recovered from the previous line).
|
|
791
|
-
* However, little equipment has actually been produced that outputs a SECAM analogue video signal.
|
|
792
|
-
* In general, SECAM territories either have to use a PAL-capable display or a [transcoder](https://en.wikipedia.org/wiki/Transcoding) to convert the PAL signal to SECAM for display.
|
|
793
|
-
*/
|
|
794
|
-
Yuv420 = 2,
|
|
795
|
-
/**
|
|
796
|
-
* What if the chroma subsampling model is 4:0:0?
|
|
797
|
-
* That says to use every pixel of luma data, but that each row has 0 chroma samples applied to it. The resulting image, then, is comprised solely of the luminance data—a greyscale image.
|
|
798
|
-
*/
|
|
799
|
-
Yuv400 = 3,
|
|
800
|
-
}
|
|
801
|
-
|
|
802
|
-
export interface ConvertToBlobOptions {
|
|
803
|
-
mime?: string
|
|
804
|
-
quality?: number
|
|
805
|
-
}
|
|
806
|
-
|
|
807
|
-
export class Canvas {
|
|
808
|
-
constructor(width: number, height: number, flag?: SvgExportFlag)
|
|
809
|
-
|
|
810
|
-
width: number
|
|
811
|
-
height: number
|
|
812
|
-
getContext(contextType: '2d', contextAttributes?: ContextAttributes): SKRSContext2D
|
|
813
|
-
encodeSync(format: 'webp' | 'jpeg', quality?: number): Buffer
|
|
814
|
-
encodeSync(format: 'png'): Buffer
|
|
815
|
-
encodeSync(format: 'avif', cfg?: AvifConfig): Buffer
|
|
816
|
-
encodeSync(format: 'gif', quality?: number): Buffer
|
|
817
|
-
encode(format: 'webp' | 'jpeg', quality?: number): Promise<Buffer>
|
|
818
|
-
encode(format: 'png'): Promise<Buffer>
|
|
819
|
-
encode(format: 'avif', cfg?: AvifConfig): Promise<Buffer>
|
|
820
|
-
encode(format: 'gif', quality?: number): Promise<Buffer>
|
|
821
|
-
encodeStream(format: 'webp' | 'jpeg', quality?: number): ReadableStream<Buffer>
|
|
822
|
-
encodeStream(format: 'png'): ReadableStream<Buffer>
|
|
823
|
-
toBuffer(mime: 'image/png'): Buffer
|
|
824
|
-
toBuffer(mime: 'image/jpeg' | 'image/webp', quality?: number): Buffer
|
|
825
|
-
toBuffer(mime: 'image/avif', cfg?: AvifConfig): Buffer
|
|
826
|
-
toBuffer(mime: 'image/gif', quality?: number): Buffer
|
|
827
|
-
// raw pixels
|
|
828
|
-
data(): Buffer
|
|
829
|
-
toDataURL(mime?: 'image/png'): string
|
|
830
|
-
toDataURL(mime: 'image/jpeg' | 'image/webp', quality?: number): string
|
|
831
|
-
toDataURL(mime: 'image/gif', quality?: number): string
|
|
832
|
-
toDataURL(mime?: 'image/jpeg' | 'image/webp' | 'image/png' | 'image/gif', quality?: number): string
|
|
833
|
-
toDataURL(mime?: 'image/avif', cfg?: AvifConfig): string
|
|
834
|
-
|
|
835
|
-
toDataURLAsync(mime?: 'image/png'): Promise<string>
|
|
836
|
-
toDataURLAsync(mime: 'image/jpeg' | 'image/webp', quality?: number): Promise<string>
|
|
837
|
-
toDataURLAsync(mime: 'image/gif', quality?: number): Promise<string>
|
|
838
|
-
toDataURLAsync(mime?: 'image/jpeg' | 'image/webp' | 'image/png' | 'image/gif', quality?: number): Promise<string>
|
|
839
|
-
toDataURLAsync(mime?: 'image/avif', cfg?: AvifConfig): Promise<string>
|
|
840
|
-
|
|
841
|
-
toBlob(callback: (blob: Blob | null) => void, mime?: string, quality?: number): void
|
|
842
|
-
convertToBlob(options?: ConvertToBlobOptions): Promise<Blob>
|
|
843
|
-
}
|
|
844
|
-
|
|
845
|
-
export function createCanvas(width: number, height: number): Canvas
|
|
846
|
-
|
|
847
|
-
export function createCanvas(width: number, height: number, svgExportFlag: SvgExportFlag): SvgCanvas
|
|
848
|
-
|
|
849
|
-
export declare class FontKey {
|
|
850
|
-
// make it a unique type
|
|
851
|
-
private readonly key: symbol
|
|
852
|
-
readonly typefaceId: number
|
|
853
|
-
}
|
|
854
|
-
|
|
855
|
-
export interface FontVariationAxis {
|
|
856
|
-
/** OpenType tag as a 32-bit integer (e.g., 0x77676874 for 'wght') */
|
|
857
|
-
tag: number
|
|
858
|
-
/** Current value for this axis */
|
|
859
|
-
value: number
|
|
860
|
-
/** Minimum value for this axis */
|
|
861
|
-
min: number
|
|
862
|
-
/** Maximum value for this axis */
|
|
863
|
-
max: number
|
|
864
|
-
/** Default value for this axis */
|
|
865
|
-
def: number
|
|
866
|
-
/** Whether this axis should be hidden from UI */
|
|
867
|
-
hidden: boolean
|
|
868
|
-
}
|
|
869
|
-
|
|
870
|
-
interface IGlobalFonts {
|
|
871
|
-
readonly families: { family: string; styles: { weight: number; width: string; style: string }[] }[]
|
|
872
|
-
// return FontKey if succeeded, null if failed
|
|
873
|
-
register(font: Buffer, nameAlias?: string): FontKey | null
|
|
874
|
-
// absolute path - returns FontKey if succeeded, null if failed
|
|
875
|
-
registerFromPath(path: string, nameAlias?: string): FontKey | null
|
|
876
|
-
has(name: string): boolean
|
|
877
|
-
loadFontsFromDir(path: string): number
|
|
878
|
-
/**
|
|
879
|
-
* Set an alias for a font family.
|
|
880
|
-
* @param fontName The original font family name
|
|
881
|
-
* @param alias The alias name to set
|
|
882
|
-
* @returns true if the alias was set successfully, false if the font family doesn't exist
|
|
883
|
-
*/
|
|
884
|
-
setAlias(fontName: string, alias: string): boolean
|
|
885
|
-
remove(key: FontKey): boolean
|
|
886
|
-
/**
|
|
887
|
-
* Remove multiple fonts by their keys in a single operation.
|
|
888
|
-
* More efficient than calling remove() multiple times as it triggers only one rebuild.
|
|
889
|
-
* @param fontKeys Array of FontKey objects to remove
|
|
890
|
-
* @returns Number of fonts successfully removed
|
|
891
|
-
*/
|
|
892
|
-
removeBatch(fontKeys: FontKey[]): number
|
|
893
|
-
/**
|
|
894
|
-
* Remove ALL registered fonts.
|
|
895
|
-
* @returns Number of fonts removed
|
|
896
|
-
*/
|
|
897
|
-
removeAll(): number
|
|
898
|
-
/**
|
|
899
|
-
* Get variation axes for a specific font instance
|
|
900
|
-
* @param familyName The font family name
|
|
901
|
-
* @param weight Font weight (100-900)
|
|
902
|
-
* @param width Font width/stretch value
|
|
903
|
-
* @param slant Font slant (0 = upright, 1 = italic, 2 = oblique)
|
|
904
|
-
* @returns Array of variation axes or empty array if not a variable font
|
|
905
|
-
*/
|
|
906
|
-
getVariationAxes(familyName: string, weight: number, width: number, slant: number): FontVariationAxis[]
|
|
907
|
-
/**
|
|
908
|
-
* Check if a font has variable font capabilities
|
|
909
|
-
* @param familyName The font family name
|
|
910
|
-
* @param weight Font weight (100-900)
|
|
911
|
-
* @param width Font width/stretch value
|
|
912
|
-
* @param slant Font slant (0 = upright, 1 = italic, 2 = oblique)
|
|
913
|
-
* @returns true if the font is a variable font
|
|
914
|
-
*/
|
|
915
|
-
hasVariations(familyName: string, weight: number, width: number, slant: number): boolean
|
|
916
|
-
}
|
|
917
|
-
|
|
918
|
-
export const GlobalFonts: IGlobalFonts
|
|
919
|
-
|
|
920
|
-
export enum PathOp {
|
|
921
|
-
Difference = 0, // subtract the op path from the first path
|
|
922
|
-
Intersect = 1, // intersect the two paths
|
|
923
|
-
Union = 2, // union (inclusive-or) the two paths
|
|
924
|
-
Xor = 3, // exclusive-or the two paths
|
|
925
|
-
ReverseDifference = 4, // subtract the first path from the op path
|
|
926
|
-
}
|
|
927
|
-
|
|
928
|
-
export enum FillType {
|
|
929
|
-
Winding = 0,
|
|
930
|
-
EvenOdd = 1,
|
|
931
|
-
InverseWinding = 2,
|
|
932
|
-
InverseEvenOdd = 3,
|
|
933
|
-
}
|
|
934
|
-
|
|
935
|
-
export enum StrokeJoin {
|
|
936
|
-
Miter = 0,
|
|
937
|
-
Round = 1,
|
|
938
|
-
Bevel = 2,
|
|
939
|
-
}
|
|
940
|
-
|
|
941
|
-
export enum StrokeCap {
|
|
942
|
-
Butt = 0,
|
|
943
|
-
Round = 1,
|
|
944
|
-
Square = 2,
|
|
945
|
-
}
|
|
946
|
-
|
|
947
|
-
export enum SvgExportFlag {
|
|
948
|
-
ConvertTextToPaths = 0x01,
|
|
949
|
-
NoPrettyXML = 0x02,
|
|
950
|
-
RelativePathEncoding = 0x04,
|
|
951
|
-
}
|
|
952
|
-
|
|
953
|
-
export function convertSVGTextToPath(svg: Buffer | string): Buffer
|
|
954
|
-
|
|
955
|
-
export interface LoadImageOptions {
|
|
956
|
-
alt?: string
|
|
957
|
-
maxRedirects?: number
|
|
958
|
-
requestOptions?: import('http').RequestOptions
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
export function loadImage(
|
|
962
|
-
source: string | URL | Buffer | ArrayBufferLike | Uint8Array | Image | import('stream').Readable,
|
|
963
|
-
options?: LoadImageOptions,
|
|
964
|
-
): Promise<Image>
|
|
965
|
-
|
|
966
|
-
export interface PDFMetadata {
|
|
967
|
-
/// The document's title
|
|
968
|
-
title?: string
|
|
969
|
-
/// The name of the person who created the document
|
|
970
|
-
author?: string
|
|
971
|
-
/// The subject of the document
|
|
972
|
-
subject?: string
|
|
973
|
-
/// Keywords associated with the document
|
|
974
|
-
keywords?: string
|
|
975
|
-
/// The product that created the original document
|
|
976
|
-
creator?: string
|
|
977
|
-
/// The product that is converting this document to PDF (defaults to "Skia/PDF")
|
|
978
|
-
producer?: string
|
|
979
|
-
/// The DPI for rasterization (default: 72.0)
|
|
980
|
-
rasterDPI?: number
|
|
981
|
-
/// Encoding quality: 0-100 for lossy JPEG, 101 for lossless (default: 101)
|
|
982
|
-
encodingQuality?: number
|
|
983
|
-
/// Whether to conform to PDF/A-2b standard (default: false)
|
|
984
|
-
pdfa?: boolean
|
|
985
|
-
/// Compression level: -1 (default), 0 (none), 1 (low/fast), 6 (average), 9 (high/slow)
|
|
986
|
-
compressionLevel?: number
|
|
987
|
-
}
|
|
988
|
-
|
|
989
|
-
export interface Rect {
|
|
990
|
-
left: number
|
|
991
|
-
top: number
|
|
992
|
-
right: number
|
|
993
|
-
bottom: number
|
|
994
|
-
}
|
|
995
|
-
|
|
996
|
-
export declare class PDFDocument {
|
|
997
|
-
constructor(metadata?: PDFMetadata | undefined | null)
|
|
998
|
-
beginPage(width: number, height: number, rect?: Rect | undefined | null): CanvasRenderingContext2D
|
|
999
|
-
endPage(): void
|
|
1000
|
-
close(): Buffer
|
|
1001
|
-
}
|
|
1002
|
-
|
|
1003
|
-
export interface LottieAnimationOptions {
|
|
1004
|
-
/** Base path for resolving external resources (images, fonts) */
|
|
1005
|
-
resourcePath?: string
|
|
1006
|
-
}
|
|
1007
|
-
|
|
1008
|
-
export interface LottieRenderRect {
|
|
1009
|
-
x: number
|
|
1010
|
-
y: number
|
|
1011
|
-
width: number
|
|
1012
|
-
height: number
|
|
1013
|
-
}
|
|
1014
|
-
|
|
1015
|
-
/**
|
|
1016
|
-
* Lottie animation class for loading and rendering Lottie JSON files.
|
|
1017
|
-
*
|
|
1018
|
-
* @example
|
|
1019
|
-
* ```typescript
|
|
1020
|
-
* import { LottieAnimation, createCanvas } from '@napi-rs/canvas'
|
|
1021
|
-
*
|
|
1022
|
-
* const animation = LottieAnimation.loadFromFile('./animation.json')
|
|
1023
|
-
* const canvas = createCanvas(animation.width, animation.height)
|
|
1024
|
-
* const ctx = canvas.getContext('2d')
|
|
1025
|
-
*
|
|
1026
|
-
* // Render frame 0
|
|
1027
|
-
* animation.seekFrame(0)
|
|
1028
|
-
* animation.render(ctx)
|
|
1029
|
-
*
|
|
1030
|
-
* // Save to PNG
|
|
1031
|
-
* const buffer = canvas.toBuffer('image/png')
|
|
1032
|
-
* ```
|
|
1033
|
-
*/
|
|
1034
|
-
export declare class LottieAnimation {
|
|
1035
|
-
/**
|
|
1036
|
-
* Load animation from JSON string or Buffer
|
|
1037
|
-
* @param data - JSON string or Buffer containing Lottie animation data
|
|
1038
|
-
* @param options - Optional configuration
|
|
1039
|
-
*/
|
|
1040
|
-
static loadFromData(data: string | Buffer, options?: LottieAnimationOptions): LottieAnimation
|
|
1041
|
-
|
|
1042
|
-
/**
|
|
1043
|
-
* Load animation from file path
|
|
1044
|
-
* External assets are resolved relative to the file's directory
|
|
1045
|
-
* @param path - Path to the Lottie JSON file
|
|
1046
|
-
*/
|
|
1047
|
-
static loadFromFile(path: string): LottieAnimation
|
|
1048
|
-
|
|
1049
|
-
/** Animation duration in seconds */
|
|
1050
|
-
readonly duration: number
|
|
1051
|
-
|
|
1052
|
-
/** Frame rate (frames per second) */
|
|
1053
|
-
readonly fps: number
|
|
1054
|
-
|
|
1055
|
-
/** Total frame count */
|
|
1056
|
-
readonly frames: number
|
|
1057
|
-
|
|
1058
|
-
/** Animation width in pixels */
|
|
1059
|
-
readonly width: number
|
|
1060
|
-
|
|
1061
|
-
/** Animation height in pixels */
|
|
1062
|
-
readonly height: number
|
|
1063
|
-
|
|
1064
|
-
/** Lottie format version string */
|
|
1065
|
-
readonly version: string
|
|
1066
|
-
|
|
1067
|
-
/** Animation in-point (start frame) */
|
|
1068
|
-
readonly inPoint: number
|
|
1069
|
-
|
|
1070
|
-
/** Animation out-point (end frame) */
|
|
1071
|
-
readonly outPoint: number
|
|
1072
|
-
|
|
1073
|
-
/**
|
|
1074
|
-
* Seek to normalized position
|
|
1075
|
-
* @param t - Position between 0.0 (start) and 1.0 (end)
|
|
1076
|
-
*/
|
|
1077
|
-
seek(t: number): void
|
|
1078
|
-
|
|
1079
|
-
/**
|
|
1080
|
-
* Seek to specific frame index
|
|
1081
|
-
* @param frame - Frame index (0 = first frame)
|
|
1082
|
-
*/
|
|
1083
|
-
seekFrame(frame: number): void
|
|
1084
|
-
|
|
1085
|
-
/**
|
|
1086
|
-
* Seek to specific time in seconds
|
|
1087
|
-
* @param seconds - Time in seconds from start
|
|
1088
|
-
*/
|
|
1089
|
-
seekTime(seconds: number): void
|
|
1090
|
-
|
|
1091
|
-
/**
|
|
1092
|
-
* Render current frame to canvas context
|
|
1093
|
-
* @param ctx - Canvas 2D rendering context
|
|
1094
|
-
* @param dst - Optional destination rectangle for scaling/positioning
|
|
1095
|
-
*/
|
|
1096
|
-
render(ctx: CanvasRenderingContext2D, dst?: LottieRenderRect): void
|
|
1097
|
-
}
|