@alpha2-sh/editor 0.0.0 → 0.1.0
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 +107 -1
- package/dist/browser/bridge.d.ts +44 -0
- package/dist/browser/bridge.js +2176 -0
- package/dist/browser/extensions-worker-entry.js +3 -0
- package/dist/browser/extensions-worker.d.ts +46 -0
- package/dist/browser/extensions-worker.js +149 -0
- package/dist/browser/hash-worker-entry.d.ts +1 -0
- package/dist/browser/hash-worker-entry.js +3 -0
- package/dist/browser/hash-worker.d.ts +24 -0
- package/dist/browser/hash-worker.js +87 -0
- package/dist/browser/index.d.ts +11 -0
- package/dist/browser/index.js +9 -0
- package/dist/browser/jobs.d.ts +82 -0
- package/dist/browser/jobs.js +291 -0
- package/dist/browser/resources.d.ts +40 -0
- package/dist/browser/resources.js +83 -0
- package/dist/browser/runtime/assets.d.ts +233 -0
- package/dist/browser/runtime/assets.js +633 -0
- package/dist/browser/runtime/audio.d.ts +60 -0
- package/dist/browser/runtime/audio.js +549 -0
- package/dist/browser/runtime/budget.d.ts +11 -0
- package/dist/browser/runtime/budget.js +26 -0
- package/dist/browser/runtime/caption-fonts.d.ts +34 -0
- package/dist/browser/runtime/caption-fonts.js +69 -0
- package/dist/browser/runtime/color.d.ts +7 -0
- package/dist/browser/runtime/color.js +12 -0
- package/dist/browser/runtime/engine.d.ts +91 -0
- package/dist/browser/runtime/engine.js +352 -0
- package/dist/browser/runtime/export-audio.d.ts +23 -0
- package/dist/browser/runtime/export-audio.js +75 -0
- package/dist/browser/runtime/exporter.d.ts +140 -0
- package/dist/browser/runtime/exporter.js +751 -0
- package/dist/browser/runtime/extension-import.d.ts +196 -0
- package/dist/browser/runtime/extension-import.js +521 -0
- package/dist/browser/runtime/fingerprint.d.ts +57 -0
- package/dist/browser/runtime/fingerprint.js +157 -0
- package/dist/browser/runtime/generators.d.ts +188 -0
- package/dist/browser/runtime/generators.js +173 -0
- package/dist/browser/runtime/locks.d.ts +32 -0
- package/dist/browser/runtime/locks.js +86 -0
- package/dist/browser/runtime/output.d.ts +87 -0
- package/dist/browser/runtime/output.js +230 -0
- package/dist/browser/runtime/preview-utils.d.ts +3 -0
- package/dist/browser/runtime/preview-utils.js +49 -0
- package/dist/browser/runtime/proxies.d.ts +72 -0
- package/dist/browser/runtime/proxies.js +369 -0
- package/dist/browser/runtime/proxy-storage.d.ts +59 -0
- package/dist/browser/runtime/proxy-storage.js +119 -0
- package/dist/browser/runtime/sources.d.ts +82 -0
- package/dist/browser/runtime/sources.js +819 -0
- package/dist/browser/runtime/staging.d.ts +10 -0
- package/dist/browser/runtime/staging.js +32 -0
- package/dist/browser/runtime/still.d.ts +21 -0
- package/dist/browser/runtime/still.js +52 -0
- package/dist/browser/runtime/wasm.d.ts +9 -0
- package/dist/browser/runtime/wasm.js +20 -0
- package/dist/browser/types.d.ts +549 -0
- package/dist/browser/types.js +1 -0
- package/dist/browser/worker-entry.d.ts +1 -0
- package/dist/browser/worker-entry.js +2 -0
- package/dist/browser/worker.d.ts +24 -0
- package/dist/browser/worker.js +239 -0
- package/dist/core/captions.d.ts +34 -0
- package/dist/core/captions.js +108 -0
- package/dist/core/clip-time.d.ts +31 -0
- package/dist/core/clip-time.js +125 -0
- package/dist/core/commands.d.ts +413 -0
- package/dist/core/commands.js +1118 -0
- package/dist/core/compositions.d.ts +234 -0
- package/dist/core/compositions.js +851 -0
- package/dist/core/document.d.ts +245 -0
- package/dist/core/document.js +683 -0
- package/dist/core/keyframes.d.ts +82 -0
- package/dist/core/keyframes.js +153 -0
- package/dist/core/presets.d.ts +64 -0
- package/dist/core/presets.js +241 -0
- package/dist/core/session.d.ts +150 -0
- package/dist/core/session.js +541 -0
- package/dist/core/text.d.ts +17 -0
- package/dist/core/text.js +17 -0
- package/dist/core/time.d.ts +19 -0
- package/dist/core/time.js +39 -0
- package/dist/core/timeline-index.d.ts +44 -0
- package/dist/core/timeline-index.js +59 -0
- package/dist/core/transitions.d.ts +20 -0
- package/dist/core/transitions.js +118 -0
- package/dist/core/validated.d.ts +23 -0
- package/dist/core/validated.js +52 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +11 -0
- package/dist/native-client/index.d.ts +131 -0
- package/dist/native-client/index.js +354 -0
- package/dist/ports/index.d.ts +146 -0
- package/dist/ports/index.js +1 -0
- package/dist/react/index.d.ts +37 -0
- package/dist/react/index.js +94 -0
- package/package.json +69 -8
- /package/{index.js → dist/browser/extensions-worker-entry.d.ts} +0 -0
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether the start of a file could be an SVG, a GIF, an animated WebP, an APNG, a Lottie or
|
|
3
|
+
* dotLottie, or an OpenEXR image.
|
|
4
|
+
*/
|
|
5
|
+
export function mayBeExtension(head: any): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* The most bytes the engine reads of a file that could be one of the document formats a provider
|
|
8
|
+
* parses whole, by its start, with what the file is called: a dotLottie package (a ZIP,
|
|
9
|
+
* `MAX_PROVIDER_DOCUMENT_BYTES`), a Lottie animation (a JSON object, `MAX_LOTTIE_DOCUMENT_BYTES`)
|
|
10
|
+
* or an SVG (XML, `MAX_SVG_DOCUMENT_BYTES`); `null` for any other file. A larger file is refused
|
|
11
|
+
* before it is read.
|
|
12
|
+
*/
|
|
13
|
+
export function providerDocumentLimit(head: any): {
|
|
14
|
+
limit: number;
|
|
15
|
+
what: string;
|
|
16
|
+
} | null;
|
|
17
|
+
/** The duration of a provider's timing in seconds, or 0 for a still. */
|
|
18
|
+
export function timingSeconds(timing: any): number;
|
|
19
|
+
/**
|
|
20
|
+
* A small preview of a rendered frame (premultiplied, sRGB RGBA8 or linear half floats) as an image
|
|
21
|
+
* URL, {@link THUMBNAIL_WIDTH} wide at most. Only one pixel per thumbnail pixel is converted.
|
|
22
|
+
*/
|
|
23
|
+
export function thumbnailOf(frame: any): Promise<{
|
|
24
|
+
dataUrl: any;
|
|
25
|
+
width: number;
|
|
26
|
+
height: number;
|
|
27
|
+
}>;
|
|
28
|
+
/**
|
|
29
|
+
* The provider a relinked file opens with: the defaults {@link stageProviderFile} staged it with,
|
|
30
|
+
* carrying the choices the project `recorded` for that source where the new file still offers them.
|
|
31
|
+
* A package's animation stays while the package has it; an OpenEXR still's primaries stay while the
|
|
32
|
+
* file is one whose primaries can be chosen.
|
|
33
|
+
*/
|
|
34
|
+
export function keepProviderChoices(recorded: any, staged: any, report: any): any;
|
|
35
|
+
/**
|
|
36
|
+
* What import reads of a file with the provider module `extensions`: the provider that claims its
|
|
37
|
+
* `bytes`, what probing found, and a thumbnail of its first frame; `null` when no provider claims
|
|
38
|
+
* them. The source is opened as import records it, so a file that probes but does not open is
|
|
39
|
+
* refused here.
|
|
40
|
+
*
|
|
41
|
+
* @throws When a provider claims the bytes and cannot read them.
|
|
42
|
+
*/
|
|
43
|
+
export function readProviderFile(extensions: any, bytes: any): Promise<{
|
|
44
|
+
report: any;
|
|
45
|
+
provider: {
|
|
46
|
+
format: any;
|
|
47
|
+
} | {
|
|
48
|
+
animation?: any;
|
|
49
|
+
format: string;
|
|
50
|
+
};
|
|
51
|
+
thumbnail: {
|
|
52
|
+
dataUrl: any;
|
|
53
|
+
width: number;
|
|
54
|
+
height: number;
|
|
55
|
+
};
|
|
56
|
+
} | null>;
|
|
57
|
+
/**
|
|
58
|
+
* The diagnostics an SVG's report gives when it is opened with `fonts`, the stack its text draws
|
|
59
|
+
* with: which of its text no font draws (`missing_font`).
|
|
60
|
+
*/
|
|
61
|
+
export function svgDiagnostics(extensions: any, provider: any, bytes: any, fonts: any): any;
|
|
62
|
+
/**
|
|
63
|
+
* Stages a file a provider claimed, from what {@link readProviderFile} read of it: a still SVG is
|
|
64
|
+
* an image source, an animation a video source of one cycle (repetition is the clip's).
|
|
65
|
+
*/
|
|
66
|
+
export function stageProviderFile(file: any, { report, provider, thumbnail }: {
|
|
67
|
+
report: any;
|
|
68
|
+
provider: any;
|
|
69
|
+
thumbnail: any;
|
|
70
|
+
}, fingerprint: any): {
|
|
71
|
+
dispose(): void;
|
|
72
|
+
fingerprint?: any;
|
|
73
|
+
runtime: {
|
|
74
|
+
report: any;
|
|
75
|
+
id: `${string}-${string}-${string}-${string}-${string}`;
|
|
76
|
+
kind: string;
|
|
77
|
+
name: any;
|
|
78
|
+
file: any;
|
|
79
|
+
provider: any;
|
|
80
|
+
width: any;
|
|
81
|
+
height: any;
|
|
82
|
+
duration: number;
|
|
83
|
+
hasAudio: boolean;
|
|
84
|
+
fit: string;
|
|
85
|
+
thumbnail: any;
|
|
86
|
+
};
|
|
87
|
+
description: {
|
|
88
|
+
id: `${string}-${string}-${string}-${string}-${string}`;
|
|
89
|
+
kind: string;
|
|
90
|
+
name: any;
|
|
91
|
+
type: any;
|
|
92
|
+
size: any;
|
|
93
|
+
lastModified: any;
|
|
94
|
+
width: any;
|
|
95
|
+
height: any;
|
|
96
|
+
duration: number;
|
|
97
|
+
provider: any;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* How numbered files make one image sequence, from their names alone: the frame number each name
|
|
102
|
+
* ends with, before its extension, fixes the order. Answers the first and last numbers, how many
|
|
103
|
+
* frames the sequence has (every number between them), how many of those no file has, and the first
|
|
104
|
+
* few of them; or, when the names cannot make a sequence, why: a name without a number, a number
|
|
105
|
+
* listed twice, a number past 2^53 - 1 (a project document cannot hold it exactly), or more numbers
|
|
106
|
+
* between the first and last than a sequence may have. Nothing here walks the numbers between them.
|
|
107
|
+
*
|
|
108
|
+
* @param {readonly string[]} names
|
|
109
|
+
* @returns {{ ok: true, first: number, last: number, frames: number, missing: number, gaps: number[] } | { ok: false, code: string, message: string }}
|
|
110
|
+
*/
|
|
111
|
+
export function sequenceNumbering(names: readonly string[]): {
|
|
112
|
+
ok: true;
|
|
113
|
+
first: number;
|
|
114
|
+
last: number;
|
|
115
|
+
frames: number;
|
|
116
|
+
missing: number;
|
|
117
|
+
gaps: number[];
|
|
118
|
+
} | {
|
|
119
|
+
ok: false;
|
|
120
|
+
code: string;
|
|
121
|
+
message: string;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Stages numbered PNGs or OpenEXR images as one image sequence at `frameRate`. The numbers fix the
|
|
125
|
+
* order and the first frame; a gap is refused unless `missing` says to hold or blank it, and every
|
|
126
|
+
* frame must be the first one's format and size. `openExr(file)` answers what the provider module
|
|
127
|
+
* makes of an OpenEXR sequence's first frame (see {@link exrFirstFrame}): its thumbnail and report.
|
|
128
|
+
* `id` names the source (a relink stages under the asset's own), a new one by default.
|
|
129
|
+
*/
|
|
130
|
+
export function stageSequence(files: any, { frameRate, missing, openExr, id }: {
|
|
131
|
+
frameRate: any;
|
|
132
|
+
missing?: string | undefined;
|
|
133
|
+
openExr: any;
|
|
134
|
+
id?: `${string}-${string}-${string}-${string}-${string}` | undefined;
|
|
135
|
+
}): Promise<{
|
|
136
|
+
runtime: {
|
|
137
|
+
report?: any;
|
|
138
|
+
id: `${string}-${string}-${string}-${string}-${string}`;
|
|
139
|
+
kind: string;
|
|
140
|
+
name: string;
|
|
141
|
+
provider: {
|
|
142
|
+
format: string;
|
|
143
|
+
frames: any[];
|
|
144
|
+
frame_rate: any;
|
|
145
|
+
start_number: number;
|
|
146
|
+
missing: string;
|
|
147
|
+
};
|
|
148
|
+
frameFiles: Map<any, any>;
|
|
149
|
+
width: number;
|
|
150
|
+
height: number;
|
|
151
|
+
frameRate: number;
|
|
152
|
+
duration: number;
|
|
153
|
+
hasAudio: boolean;
|
|
154
|
+
fit: string;
|
|
155
|
+
thumbnail: any;
|
|
156
|
+
};
|
|
157
|
+
name: string;
|
|
158
|
+
description: {
|
|
159
|
+
id: `${string}-${string}-${string}-${string}-${string}`;
|
|
160
|
+
kind: string;
|
|
161
|
+
name: string;
|
|
162
|
+
width: number;
|
|
163
|
+
height: number;
|
|
164
|
+
duration: number;
|
|
165
|
+
provider: {
|
|
166
|
+
format: string;
|
|
167
|
+
frames: any[];
|
|
168
|
+
frame_rate: any;
|
|
169
|
+
start_number: number;
|
|
170
|
+
missing: string;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
fingerprint: {
|
|
174
|
+
streams: {
|
|
175
|
+
video: {
|
|
176
|
+
width: number;
|
|
177
|
+
height: number;
|
|
178
|
+
frame_rate: any;
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
duration_ticks: number;
|
|
182
|
+
};
|
|
183
|
+
dispose(): void;
|
|
184
|
+
}>;
|
|
185
|
+
/**
|
|
186
|
+
* An OpenEXR frame's thumbnail, sampled from the frame the provider module `extensions` renders at
|
|
187
|
+
* its own size from `bytes`, and what the provider reports of it.
|
|
188
|
+
*/
|
|
189
|
+
export function exrFirstFrame(extensions: any, bytes: any): Promise<{
|
|
190
|
+
thumbnail: {
|
|
191
|
+
dataUrl: any;
|
|
192
|
+
width: number;
|
|
193
|
+
height: number;
|
|
194
|
+
};
|
|
195
|
+
report: any;
|
|
196
|
+
}>;
|