@alpha2-sh/editor 0.0.0-stage → 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 (99) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +108 -2
  3. package/dist/browser/bridge.d.ts +44 -0
  4. package/dist/browser/bridge.js +2176 -0
  5. package/dist/browser/extensions-worker-entry.d.ts +1 -0
  6. package/dist/browser/extensions-worker-entry.js +3 -0
  7. package/dist/browser/extensions-worker.d.ts +46 -0
  8. package/dist/browser/extensions-worker.js +149 -0
  9. package/dist/browser/hash-worker-entry.d.ts +1 -0
  10. package/dist/browser/hash-worker-entry.js +3 -0
  11. package/dist/browser/hash-worker.d.ts +24 -0
  12. package/dist/browser/hash-worker.js +87 -0
  13. package/dist/browser/index.d.ts +11 -0
  14. package/dist/browser/index.js +9 -0
  15. package/dist/browser/jobs.d.ts +82 -0
  16. package/dist/browser/jobs.js +291 -0
  17. package/dist/browser/resources.d.ts +40 -0
  18. package/dist/browser/resources.js +83 -0
  19. package/dist/browser/runtime/assets.d.ts +233 -0
  20. package/dist/browser/runtime/assets.js +633 -0
  21. package/dist/browser/runtime/audio.d.ts +60 -0
  22. package/dist/browser/runtime/audio.js +549 -0
  23. package/dist/browser/runtime/budget.d.ts +11 -0
  24. package/dist/browser/runtime/budget.js +26 -0
  25. package/dist/browser/runtime/caption-fonts.d.ts +34 -0
  26. package/dist/browser/runtime/caption-fonts.js +69 -0
  27. package/dist/browser/runtime/color.d.ts +7 -0
  28. package/dist/browser/runtime/color.js +12 -0
  29. package/dist/browser/runtime/engine.d.ts +91 -0
  30. package/dist/browser/runtime/engine.js +352 -0
  31. package/dist/browser/runtime/export-audio.d.ts +23 -0
  32. package/dist/browser/runtime/export-audio.js +75 -0
  33. package/dist/browser/runtime/exporter.d.ts +140 -0
  34. package/dist/browser/runtime/exporter.js +751 -0
  35. package/dist/browser/runtime/extension-import.d.ts +196 -0
  36. package/dist/browser/runtime/extension-import.js +521 -0
  37. package/dist/browser/runtime/fingerprint.d.ts +57 -0
  38. package/dist/browser/runtime/fingerprint.js +157 -0
  39. package/dist/browser/runtime/generators.d.ts +188 -0
  40. package/dist/browser/runtime/generators.js +173 -0
  41. package/dist/browser/runtime/locks.d.ts +32 -0
  42. package/dist/browser/runtime/locks.js +86 -0
  43. package/dist/browser/runtime/output.d.ts +87 -0
  44. package/dist/browser/runtime/output.js +230 -0
  45. package/dist/browser/runtime/preview-utils.d.ts +3 -0
  46. package/dist/browser/runtime/preview-utils.js +49 -0
  47. package/dist/browser/runtime/proxies.d.ts +72 -0
  48. package/dist/browser/runtime/proxies.js +369 -0
  49. package/dist/browser/runtime/proxy-storage.d.ts +59 -0
  50. package/dist/browser/runtime/proxy-storage.js +119 -0
  51. package/dist/browser/runtime/sources.d.ts +82 -0
  52. package/dist/browser/runtime/sources.js +819 -0
  53. package/dist/browser/runtime/staging.d.ts +10 -0
  54. package/dist/browser/runtime/staging.js +32 -0
  55. package/dist/browser/runtime/still.d.ts +21 -0
  56. package/dist/browser/runtime/still.js +52 -0
  57. package/dist/browser/runtime/wasm.d.ts +9 -0
  58. package/dist/browser/runtime/wasm.js +20 -0
  59. package/dist/browser/types.d.ts +549 -0
  60. package/dist/browser/types.js +1 -0
  61. package/dist/browser/worker-entry.d.ts +1 -0
  62. package/dist/browser/worker-entry.js +2 -0
  63. package/dist/browser/worker.d.ts +24 -0
  64. package/dist/browser/worker.js +239 -0
  65. package/dist/core/captions.d.ts +34 -0
  66. package/dist/core/captions.js +108 -0
  67. package/dist/core/clip-time.d.ts +31 -0
  68. package/dist/core/clip-time.js +125 -0
  69. package/dist/core/commands.d.ts +413 -0
  70. package/dist/core/commands.js +1118 -0
  71. package/dist/core/compositions.d.ts +234 -0
  72. package/dist/core/compositions.js +851 -0
  73. package/dist/core/document.d.ts +245 -0
  74. package/dist/core/document.js +683 -0
  75. package/dist/core/keyframes.d.ts +82 -0
  76. package/dist/core/keyframes.js +153 -0
  77. package/dist/core/presets.d.ts +64 -0
  78. package/dist/core/presets.js +241 -0
  79. package/dist/core/session.d.ts +150 -0
  80. package/dist/core/session.js +541 -0
  81. package/dist/core/text.d.ts +17 -0
  82. package/dist/core/text.js +17 -0
  83. package/dist/core/time.d.ts +19 -0
  84. package/dist/core/time.js +39 -0
  85. package/dist/core/timeline-index.d.ts +44 -0
  86. package/dist/core/timeline-index.js +59 -0
  87. package/dist/core/transitions.d.ts +20 -0
  88. package/dist/core/transitions.js +118 -0
  89. package/dist/core/validated.d.ts +23 -0
  90. package/dist/core/validated.js +52 -0
  91. package/dist/index.d.ts +12 -0
  92. package/dist/index.js +11 -0
  93. package/dist/native-client/index.d.ts +131 -0
  94. package/dist/native-client/index.js +354 -0
  95. package/dist/ports/index.d.ts +146 -0
  96. package/dist/ports/index.js +1 -0
  97. package/dist/react/index.d.ts +37 -0
  98. package/dist/react/index.js +94 -0
  99. package/package.json +79 -4
@@ -0,0 +1,140 @@
1
+ /** The engine's quality level names, lowest first. */
2
+ export function qualityLevelNames(): readonly string[];
3
+ /**
4
+ * Resolves the video rate an export at `quality` will encode at, through the engine: the same
5
+ * function the native host calls.
6
+ */
7
+ export function resolvedVideoRate({ codec, width, height, frameRate, quality, }: {
8
+ codec: any;
9
+ width: any;
10
+ height: any;
11
+ frameRate: any;
12
+ quality: any;
13
+ }): import("alpha2/rate-control").VideoRateControl;
14
+ /**
15
+ * Which video codecs this browser encodes for an export at `width`x`height`, `frameRate`, and
16
+ * `videoQuality` (default `high`), asked with the configuration that export would open its encoder
17
+ * with: a codec answered `false` is refused when such an export starts.
18
+ */
19
+ export function probeEncoders(width: any, height: any, { frameRate, videoQuality }?: {
20
+ frameRate?: {
21
+ num: number;
22
+ den: number;
23
+ } | undefined;
24
+ videoQuality?: string | undefined;
25
+ }): Promise<{}>;
26
+ /**
27
+ * Renders `range` (seconds) of the loaded project through the engine's export schedule and writes
28
+ * it, with its mixed audio, to the output `openOutput` opens. Resolves to the sink's output, the
29
+ * opened output (not yet finished), and the export report. Any failure discards the output and is
30
+ * rethrown as an `ExportFailureError` with the phase it happened in; a cancellation rethrows the
31
+ * abort reason. `createSink(options)` makes the muxer the frames and audio are written to, a
32
+ * `MediabunnyMp4Sink` unless a test supplies another.
33
+ */
34
+ export function exportTimeline({ supplyFrame, renderFrame, sourceTransfer, engine, project, doc, library, audioSupplier, range, options, openOutput, onProgress, signal, createSink, }: {
35
+ supplyFrame: any;
36
+ renderFrame: any;
37
+ sourceTransfer: any;
38
+ engine: any;
39
+ project: any;
40
+ doc: any;
41
+ library: any;
42
+ audioSupplier: any;
43
+ range: any;
44
+ options: any;
45
+ openOutput: any;
46
+ onProgress: any;
47
+ signal: any;
48
+ createSink?: ((sinkOptions: any) => MediabunnyMp4Sink) | undefined;
49
+ }): Promise<{
50
+ written: import("alpha2/mediabunny").Mp4Output;
51
+ output: any;
52
+ result: {
53
+ renderMs: number;
54
+ frames: number;
55
+ audio: boolean;
56
+ videoCodec: any;
57
+ videoRateControl: {
58
+ bitrate: number;
59
+ mode: "constant" | "variable";
60
+ quantizer: number | null;
61
+ level: string | null;
62
+ source: string;
63
+ };
64
+ appliedVideoRateControl: import("alpha2/mediabunny").AppliedVideoRateControl | null;
65
+ audioCodec: "aac" | "opus" | undefined;
66
+ audioRateControl: {
67
+ bitrate: number;
68
+ level: string | null;
69
+ } | null;
70
+ fps: number;
71
+ resume: {
72
+ status: string;
73
+ reason: string;
74
+ };
75
+ performance: {
76
+ pipelineEnabled: any;
77
+ sourceConvertUploadMs: any;
78
+ frameSubmitMs: any;
79
+ readbackMapLatencyMs: any;
80
+ readbackWaitMs: any;
81
+ readbackBlockingMs: any;
82
+ encodeQueueWaitMs: any;
83
+ videoEncodeMs: any;
84
+ audioDecodeMs: any;
85
+ audioMixMs: any;
86
+ audioEncodeMs: any;
87
+ muxFinishMs: any;
88
+ inFlightDepth: number;
89
+ encodeChannelDepth: number;
90
+ stagingBytesPerFrame: any;
91
+ packedBytesPerFrame: any;
92
+ peakReadbackBytes: any;
93
+ outputReadbackBytes: any;
94
+ outputRepackBytes: any;
95
+ sourcePlanarCopyFrames: any;
96
+ sourcePlanarCopyBytes: any;
97
+ peakEncodeQueueBytes: any;
98
+ maxPendingMediaEvents: any;
99
+ averagePendingMediaEvents: number;
100
+ maxInFlightReadbacks: any;
101
+ maxEncodeQueueEvents: any;
102
+ encodeBackpressureCount: any;
103
+ pipelineOverlapFrames: any;
104
+ audioBlocksInterleaved: any;
105
+ memory: any;
106
+ output: any;
107
+ };
108
+ };
109
+ }>;
110
+ /**
111
+ * The audio codec this browser encodes the export's audio with, and the rate its encoder is given:
112
+ * AAC where it can, else Opus, each at the project rate where the encoder takes it and otherwise at
113
+ * the rate a native host would convert to (`audioEncoderSampleRate` in `alpha2/mediabunny`), so
114
+ * every project rate exports. A browser that encodes neither at any rate (Safari before 26 has a
115
+ * VideoEncoder but no AudioEncoder) is refused here, before anything renders, as `INVALID_INPUT`:
116
+ * a retry would meet the same browser.
117
+ *
118
+ * @returns {Promise<{ codec: "aac" | "opus", sampleRate: number }>}
119
+ */
120
+ export function chooseAudioCodec(sampleRate: any, audioQuality: any): Promise<{
121
+ codec: "aac" | "opus";
122
+ sampleRate: number;
123
+ }>;
124
+ /**
125
+ * Refuses an export whose video codec this browser does not encode at the export's size and rate,
126
+ * before anything renders, as `INVALID_INPUT`: WebCodecs leaves the codecs to the browser, and a
127
+ * retry would meet the same browser.
128
+ */
129
+ export function requireVideoEncoder(codec: any, { width, height }: {
130
+ width: any;
131
+ height: any;
132
+ }, rate: any): Promise<void>;
133
+ /** The video codecs a browser export may request, with display labels. */
134
+ export const VIDEO_CODECS: {
135
+ value: string;
136
+ label: string;
137
+ }[];
138
+ export { engineVideoCodec };
139
+ import { MediabunnyMp4Sink } from "alpha2/mediabunny";
140
+ import { engineVideoCodec } from "alpha2/rate-control";