@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.
Files changed (98) hide show
  1. package/README.md +107 -1
  2. package/dist/browser/bridge.d.ts +44 -0
  3. package/dist/browser/bridge.js +2176 -0
  4. package/dist/browser/extensions-worker-entry.js +3 -0
  5. package/dist/browser/extensions-worker.d.ts +46 -0
  6. package/dist/browser/extensions-worker.js +149 -0
  7. package/dist/browser/hash-worker-entry.d.ts +1 -0
  8. package/dist/browser/hash-worker-entry.js +3 -0
  9. package/dist/browser/hash-worker.d.ts +24 -0
  10. package/dist/browser/hash-worker.js +87 -0
  11. package/dist/browser/index.d.ts +11 -0
  12. package/dist/browser/index.js +9 -0
  13. package/dist/browser/jobs.d.ts +82 -0
  14. package/dist/browser/jobs.js +291 -0
  15. package/dist/browser/resources.d.ts +40 -0
  16. package/dist/browser/resources.js +83 -0
  17. package/dist/browser/runtime/assets.d.ts +233 -0
  18. package/dist/browser/runtime/assets.js +633 -0
  19. package/dist/browser/runtime/audio.d.ts +60 -0
  20. package/dist/browser/runtime/audio.js +549 -0
  21. package/dist/browser/runtime/budget.d.ts +11 -0
  22. package/dist/browser/runtime/budget.js +26 -0
  23. package/dist/browser/runtime/caption-fonts.d.ts +34 -0
  24. package/dist/browser/runtime/caption-fonts.js +69 -0
  25. package/dist/browser/runtime/color.d.ts +7 -0
  26. package/dist/browser/runtime/color.js +12 -0
  27. package/dist/browser/runtime/engine.d.ts +91 -0
  28. package/dist/browser/runtime/engine.js +352 -0
  29. package/dist/browser/runtime/export-audio.d.ts +23 -0
  30. package/dist/browser/runtime/export-audio.js +75 -0
  31. package/dist/browser/runtime/exporter.d.ts +140 -0
  32. package/dist/browser/runtime/exporter.js +751 -0
  33. package/dist/browser/runtime/extension-import.d.ts +196 -0
  34. package/dist/browser/runtime/extension-import.js +521 -0
  35. package/dist/browser/runtime/fingerprint.d.ts +57 -0
  36. package/dist/browser/runtime/fingerprint.js +157 -0
  37. package/dist/browser/runtime/generators.d.ts +188 -0
  38. package/dist/browser/runtime/generators.js +173 -0
  39. package/dist/browser/runtime/locks.d.ts +32 -0
  40. package/dist/browser/runtime/locks.js +86 -0
  41. package/dist/browser/runtime/output.d.ts +87 -0
  42. package/dist/browser/runtime/output.js +230 -0
  43. package/dist/browser/runtime/preview-utils.d.ts +3 -0
  44. package/dist/browser/runtime/preview-utils.js +49 -0
  45. package/dist/browser/runtime/proxies.d.ts +72 -0
  46. package/dist/browser/runtime/proxies.js +369 -0
  47. package/dist/browser/runtime/proxy-storage.d.ts +59 -0
  48. package/dist/browser/runtime/proxy-storage.js +119 -0
  49. package/dist/browser/runtime/sources.d.ts +82 -0
  50. package/dist/browser/runtime/sources.js +819 -0
  51. package/dist/browser/runtime/staging.d.ts +10 -0
  52. package/dist/browser/runtime/staging.js +32 -0
  53. package/dist/browser/runtime/still.d.ts +21 -0
  54. package/dist/browser/runtime/still.js +52 -0
  55. package/dist/browser/runtime/wasm.d.ts +9 -0
  56. package/dist/browser/runtime/wasm.js +20 -0
  57. package/dist/browser/types.d.ts +549 -0
  58. package/dist/browser/types.js +1 -0
  59. package/dist/browser/worker-entry.d.ts +1 -0
  60. package/dist/browser/worker-entry.js +2 -0
  61. package/dist/browser/worker.d.ts +24 -0
  62. package/dist/browser/worker.js +239 -0
  63. package/dist/core/captions.d.ts +34 -0
  64. package/dist/core/captions.js +108 -0
  65. package/dist/core/clip-time.d.ts +31 -0
  66. package/dist/core/clip-time.js +125 -0
  67. package/dist/core/commands.d.ts +413 -0
  68. package/dist/core/commands.js +1118 -0
  69. package/dist/core/compositions.d.ts +234 -0
  70. package/dist/core/compositions.js +851 -0
  71. package/dist/core/document.d.ts +245 -0
  72. package/dist/core/document.js +683 -0
  73. package/dist/core/keyframes.d.ts +82 -0
  74. package/dist/core/keyframes.js +153 -0
  75. package/dist/core/presets.d.ts +64 -0
  76. package/dist/core/presets.js +241 -0
  77. package/dist/core/session.d.ts +150 -0
  78. package/dist/core/session.js +541 -0
  79. package/dist/core/text.d.ts +17 -0
  80. package/dist/core/text.js +17 -0
  81. package/dist/core/time.d.ts +19 -0
  82. package/dist/core/time.js +39 -0
  83. package/dist/core/timeline-index.d.ts +44 -0
  84. package/dist/core/timeline-index.js +59 -0
  85. package/dist/core/transitions.d.ts +20 -0
  86. package/dist/core/transitions.js +118 -0
  87. package/dist/core/validated.d.ts +23 -0
  88. package/dist/core/validated.js +52 -0
  89. package/dist/index.d.ts +12 -0
  90. package/dist/index.js +11 -0
  91. package/dist/native-client/index.d.ts +131 -0
  92. package/dist/native-client/index.js +354 -0
  93. package/dist/ports/index.d.ts +146 -0
  94. package/dist/ports/index.js +1 -0
  95. package/dist/react/index.d.ts +37 -0
  96. package/dist/react/index.js +94 -0
  97. package/package.json +69 -8
  98. /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
+ }>;