asciify-engine 4.6.0 → 4.8.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 +31 -0
- package/dist/core.d.cts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/{model-Tyu-NpVf.d.ts → model-CMKdRB30.d.ts} +76 -1
- package/dist/{model-BR3qK_NW.d.cts → model-fP9NdG-w.d.cts} +76 -1
- package/dist/studio.cjs +1 -1
- package/dist/studio.d.cts +168 -5
- package/dist/studio.d.ts +168 -5
- package/dist/studio.js +1 -1
- package/examples/layered-composition.ts +24 -0
- package/examples/studio-composition.ts +4 -7
- package/package.json +2 -1
- package/skills/asciify-engine/SKILL.md +6 -2
- package/skills/asciify-engine/agents/openai.yaml +2 -2
- package/skills/asciify-engine/references/layered-projects.md +89 -0
- package/skills/asciify-engine/references/project-integration.md +1 -0
- package/skills/asciify-engine/references/source-shaping.md +54 -0
- package/skills/asciify-engine/references/studio-workspace.md +5 -1
- package/skills/asciify-engine/references/upgrading.md +8 -0
package/dist/studio.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as StudioSettings, a as StudioInput } from './model-
|
|
2
|
-
export {
|
|
1
|
+
import { S as StudioSettings, a as StudioInput, B as BLEND_MODES } from './model-fP9NdG-w.cjs';
|
|
2
|
+
export { C as CHARACTER_SETS, D as DEFAULT_STUDIO_SETTINGS, b as DITHER_ALGORITHMS, c as DitherAlgorithm, M as MAX_STUDIO_WARPS, d as STUDIO_CHARACTER_SETS, e as STUDIO_CURVE_CHANNELS, f as STUDIO_PALETTES, g as STUDIO_STYLES, h as STUDIO_WARPS, i as StudioCurveChannel, j as StudioCurvePoint, k as StudioCurves, l as StudioLight, m as StudioMask, n as StudioStyle, o as StudioWarp, p as StudioWarpEdge, q as StudioWarpType, r as createStudioCurveLookup, s as normalizeStudioCurve, t as normalizeStudioCurves, u as normalizeStudioSettings, v as normalizeStudioWarps, w as parseStudioSettings, x as serializeStudioSettings, y as studioCrop, z as studioDimensions, A as studioGrid, E as updateStudioSettings } from './model-fP9NdG-w.cjs';
|
|
3
3
|
import * as figlet_fonts_Wavy from 'figlet/fonts/Wavy';
|
|
4
4
|
import * as figlet_fonts_Univers from 'figlet/fonts/Univers';
|
|
5
5
|
import * as figlet_fonts_3_D from 'figlet/fonts/3-D';
|
|
@@ -94,7 +94,7 @@ interface StudioExportOptions {
|
|
|
94
94
|
interface StudioExportSource {
|
|
95
95
|
frame(time: number, signal?: AbortSignal): StudioSource | Promise<StudioSource>;
|
|
96
96
|
}
|
|
97
|
-
/** A separate renderer preserves preview state.
|
|
97
|
+
/** A separate renderer preserves preview state. Video sources must also be independent. */
|
|
98
98
|
declare function exportStudio(source: StudioExportSource, settings: StudioSettings, options: StudioExportOptions): Promise<Blob>;
|
|
99
99
|
|
|
100
100
|
interface MountStudioOptions {
|
|
@@ -184,9 +184,172 @@ declare const loaders: {
|
|
|
184
184
|
Wavy: () => Promise<typeof figlet_fonts_Wavy>;
|
|
185
185
|
};
|
|
186
186
|
declare const STUDIO_TEXT_FONTS: (keyof typeof loaders)[];
|
|
187
|
-
declare function createStudioText(text: string, font?: keyof typeof loaders, ink?: string): Promise<{
|
|
187
|
+
declare function createStudioText(text: string, font?: keyof typeof loaders, ink?: string, background?: string | null): Promise<{
|
|
188
188
|
canvas: HTMLCanvasElement;
|
|
189
189
|
ascii: string;
|
|
190
190
|
}>;
|
|
191
191
|
|
|
192
|
-
|
|
192
|
+
declare const MAX_STUDIO_LAYERS = 8;
|
|
193
|
+
interface StudioLayerPlacement {
|
|
194
|
+
/** Normalized center and size in the project canvas. */
|
|
195
|
+
x: number;
|
|
196
|
+
y: number;
|
|
197
|
+
width: number;
|
|
198
|
+
height: number;
|
|
199
|
+
rotation: number;
|
|
200
|
+
flipX: boolean;
|
|
201
|
+
flipY: boolean;
|
|
202
|
+
}
|
|
203
|
+
interface StudioProjectLayer {
|
|
204
|
+
id: string;
|
|
205
|
+
name: string;
|
|
206
|
+
source: string;
|
|
207
|
+
visible: boolean;
|
|
208
|
+
opacity: number;
|
|
209
|
+
blend: typeof BLEND_MODES[number];
|
|
210
|
+
placement: StudioLayerPlacement;
|
|
211
|
+
settings: StudioSettings;
|
|
212
|
+
}
|
|
213
|
+
interface StudioProject {
|
|
214
|
+
kind: 'asciify-project';
|
|
215
|
+
version: 1;
|
|
216
|
+
width: number;
|
|
217
|
+
height: number;
|
|
218
|
+
background: string | null;
|
|
219
|
+
pointerMode: 'top' | 'all';
|
|
220
|
+
layers: StudioProjectLayer[];
|
|
221
|
+
}
|
|
222
|
+
type StudioLayerInput = Pick<StudioProjectLayer, 'id' | 'source'> & Partial<Omit<StudioProjectLayer, 'id' | 'source' | 'placement' | 'settings'>> & {
|
|
223
|
+
placement?: Partial<StudioLayerPlacement>;
|
|
224
|
+
settings?: StudioInput;
|
|
225
|
+
};
|
|
226
|
+
type StudioLayerPatch = Partial<Omit<StudioLayerInput, 'id'>>;
|
|
227
|
+
type StudioProjectInput = Partial<Omit<StudioProject, 'layers'>> & {
|
|
228
|
+
layers?: StudioLayerInput[];
|
|
229
|
+
};
|
|
230
|
+
/** A project contains asset keys, never source files, URLs or executable code. */
|
|
231
|
+
declare function normalizeStudioProject(input?: unknown): StudioProject;
|
|
232
|
+
declare function updateStudioProjectLayer(project: StudioProject, id: string, patch: StudioLayerPatch): StudioProject;
|
|
233
|
+
declare const serializeStudioProject: (project: StudioProject) => string;
|
|
234
|
+
declare function parseStudioProject(json: string): StudioProject;
|
|
235
|
+
/** No pixel readback: pointer picking uses transformed rectangular layer bounds. */
|
|
236
|
+
declare function studioLayerPoint(layer: StudioProjectLayer, x: number, y: number, width: number, height: number): [number, number];
|
|
237
|
+
declare function visibleStudioLayers(project: StudioProject): StudioProjectLayer[];
|
|
238
|
+
/** A shared budget prevents each extra layer from multiplying the work ceiling. */
|
|
239
|
+
declare function studioProjectBudget(project: StudioProject, maxCells?: number, maxRasterPixels?: number, width?: number, height?: number): {
|
|
240
|
+
id: string;
|
|
241
|
+
maxCells: number;
|
|
242
|
+
width: number;
|
|
243
|
+
height: number;
|
|
244
|
+
}[];
|
|
245
|
+
|
|
246
|
+
interface StudioProjectLimits {
|
|
247
|
+
maxDimension?: number;
|
|
248
|
+
maxCells?: number;
|
|
249
|
+
maxRasterPixels?: number;
|
|
250
|
+
pixelRatio?: number;
|
|
251
|
+
}
|
|
252
|
+
type StudioProjectFrames = ReadonlyMap<string, StudioSource>;
|
|
253
|
+
/** Reusable composition renderer. No RAF, event listeners, loading or media ownership. */
|
|
254
|
+
declare function createStudioProjectRenderer(canvas: HTMLCanvasElement, input?: unknown, limits?: StudioProjectLimits): {
|
|
255
|
+
canvas: HTMLCanvasElement;
|
|
256
|
+
render(frames: StudioProjectFrames, time?: number, width?: number, height?: number, motionTimes?: Readonly<Record<string, number>>): boolean;
|
|
257
|
+
configure(next: unknown): void;
|
|
258
|
+
pointer(x: number, y: number, time: number): void;
|
|
259
|
+
leave(): void;
|
|
260
|
+
invalidate(source?: string): void;
|
|
261
|
+
setBudget(value: number): void;
|
|
262
|
+
setPixelRatio(value: number): void;
|
|
263
|
+
readonly maxCells: number;
|
|
264
|
+
readonly pixelRatio: number;
|
|
265
|
+
readonly quality: {
|
|
266
|
+
id: string;
|
|
267
|
+
maxCells: number;
|
|
268
|
+
width: number;
|
|
269
|
+
height: number;
|
|
270
|
+
}[];
|
|
271
|
+
readonly active: boolean;
|
|
272
|
+
destroy(): void;
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
interface StudioProjectTextSource {
|
|
276
|
+
text: string;
|
|
277
|
+
font?: Parameters<typeof createStudioText>[1];
|
|
278
|
+
ink?: string;
|
|
279
|
+
}
|
|
280
|
+
type StudioProjectSource = File | string | StudioProjectTextSource;
|
|
281
|
+
type StudioProjectSources = Readonly<Record<string, StudioProjectSource>>;
|
|
282
|
+
type StudioProjectMedia = ReadonlyMap<string, StudioMedia>;
|
|
283
|
+
|
|
284
|
+
interface MountStudioProjectOptions extends StudioProjectLimits {
|
|
285
|
+
fps?: number;
|
|
286
|
+
adaptive?: boolean;
|
|
287
|
+
signal?: AbortSignal;
|
|
288
|
+
onFrame?: (time: number, costMs: number) => void;
|
|
289
|
+
onError?: (error: Error) => void;
|
|
290
|
+
onQualityChange?: (maxCells: number) => void;
|
|
291
|
+
}
|
|
292
|
+
declare function mountStudioProject(canvas: HTMLCanvasElement, input: StudioProjectInput, sources: StudioProjectSources, options?: MountStudioProjectOptions): Promise<{
|
|
293
|
+
canvas: HTMLCanvasElement;
|
|
294
|
+
readonly project: StudioProject;
|
|
295
|
+
readonly time: number;
|
|
296
|
+
readonly motionTimes: {
|
|
297
|
+
[x: string]: number;
|
|
298
|
+
};
|
|
299
|
+
readonly paused: boolean;
|
|
300
|
+
readonly maxCells: number;
|
|
301
|
+
readonly pixelRatio: number;
|
|
302
|
+
readonly quality: {
|
|
303
|
+
id: string;
|
|
304
|
+
maxCells: number;
|
|
305
|
+
width: number;
|
|
306
|
+
height: number;
|
|
307
|
+
}[];
|
|
308
|
+
update: (next: StudioProjectInput) => void;
|
|
309
|
+
updateLayer: (id: string, patch: StudioLayerPatch) => void;
|
|
310
|
+
resize(w: number, h: number, pixelRatio?: number): void;
|
|
311
|
+
pause(value?: boolean): void;
|
|
312
|
+
seek(seconds: number): Promise<void>;
|
|
313
|
+
redraw(): void;
|
|
314
|
+
setBudget(value: number): void;
|
|
315
|
+
setAdaptive(value: boolean): void;
|
|
316
|
+
destroy: () => void;
|
|
317
|
+
}>;
|
|
318
|
+
/** Takes ownership of the supplied media. One shared RAF drives all layers. */
|
|
319
|
+
declare function mountStudioProjectMedia(canvas: HTMLCanvasElement, input: StudioProjectInput, media: StudioProjectMedia, options?: MountStudioProjectOptions): {
|
|
320
|
+
canvas: HTMLCanvasElement;
|
|
321
|
+
readonly project: StudioProject;
|
|
322
|
+
readonly time: number;
|
|
323
|
+
readonly motionTimes: {
|
|
324
|
+
[x: string]: number;
|
|
325
|
+
};
|
|
326
|
+
readonly paused: boolean;
|
|
327
|
+
readonly maxCells: number;
|
|
328
|
+
readonly pixelRatio: number;
|
|
329
|
+
readonly quality: {
|
|
330
|
+
id: string;
|
|
331
|
+
maxCells: number;
|
|
332
|
+
width: number;
|
|
333
|
+
height: number;
|
|
334
|
+
}[];
|
|
335
|
+
update: (next: StudioProjectInput) => void;
|
|
336
|
+
updateLayer: (id: string, patch: StudioLayerPatch) => void;
|
|
337
|
+
resize(w: number, h: number, pixelRatio?: number): void;
|
|
338
|
+
pause(value?: boolean): void;
|
|
339
|
+
seek(seconds: number): Promise<void>;
|
|
340
|
+
redraw(): void;
|
|
341
|
+
setBudget(value: number): void;
|
|
342
|
+
setAdaptive(value: boolean): void;
|
|
343
|
+
destroy: () => void;
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
interface StudioProjectExportOptions extends Omit<StudioExportOptions, 'motionTime'> {
|
|
347
|
+
/** Phase snapshot from a mounted project, for a still after speed edits. */
|
|
348
|
+
motionTimes?: Readonly<Record<string, number>>;
|
|
349
|
+
/** Combined child-raster budget, distinct from the shared character budget. */
|
|
350
|
+
maxRasterPixels?: number;
|
|
351
|
+
}
|
|
352
|
+
/** Loads independent assets and never seeks, pauses or destroys a live preview. */
|
|
353
|
+
declare function exportStudioProject(input: StudioProjectInput, sources: StudioProjectSources, options: StudioProjectExportOptions): Promise<Blob>;
|
|
354
|
+
|
|
355
|
+
export { BLEND_MODES, MAX_STUDIO_LAYERS, type MountStudioOptions, type MountStudioProjectOptions, STUDIO_LOOKS, STUDIO_TEXT_FONTS, type StudioExportFormat, type StudioExportOptions, type StudioExportSource, StudioInput, type StudioLayerInput, type StudioLayerPatch, type StudioLayerPlacement, type StudioMedia, type StudioProject, type StudioProjectExportOptions, type StudioProjectFrames, type StudioProjectInput, type StudioProjectLayer, type StudioProjectLimits, type StudioProjectMedia, type StudioProjectSource, type StudioProjectSources, type StudioProjectTextSource, StudioSettings, type StudioSource, createStudioProjectRenderer, createStudioRenderer, createStudioText, exportStudio, exportStudioProject, loadStudioMedia, mountStudio, mountStudioMedia, mountStudioProject, mountStudioProjectMedia, normalizeStudioProject, parseStudioProject, restyleStudio, serializeStudioProject, studioLayerPoint, studioLook, studioProjectBudget, studioSourceSize, updateStudioProjectLayer, visibleStudioLayers };
|
package/dist/studio.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as StudioSettings, a as StudioInput } from './model-
|
|
2
|
-
export {
|
|
1
|
+
import { S as StudioSettings, a as StudioInput, B as BLEND_MODES } from './model-CMKdRB30.js';
|
|
2
|
+
export { C as CHARACTER_SETS, D as DEFAULT_STUDIO_SETTINGS, b as DITHER_ALGORITHMS, c as DitherAlgorithm, M as MAX_STUDIO_WARPS, d as STUDIO_CHARACTER_SETS, e as STUDIO_CURVE_CHANNELS, f as STUDIO_PALETTES, g as STUDIO_STYLES, h as STUDIO_WARPS, i as StudioCurveChannel, j as StudioCurvePoint, k as StudioCurves, l as StudioLight, m as StudioMask, n as StudioStyle, o as StudioWarp, p as StudioWarpEdge, q as StudioWarpType, r as createStudioCurveLookup, s as normalizeStudioCurve, t as normalizeStudioCurves, u as normalizeStudioSettings, v as normalizeStudioWarps, w as parseStudioSettings, x as serializeStudioSettings, y as studioCrop, z as studioDimensions, A as studioGrid, E as updateStudioSettings } from './model-CMKdRB30.js';
|
|
3
3
|
import * as figlet_fonts_Wavy from 'figlet/fonts/Wavy';
|
|
4
4
|
import * as figlet_fonts_Univers from 'figlet/fonts/Univers';
|
|
5
5
|
import * as figlet_fonts_3_D from 'figlet/fonts/3-D';
|
|
@@ -94,7 +94,7 @@ interface StudioExportOptions {
|
|
|
94
94
|
interface StudioExportSource {
|
|
95
95
|
frame(time: number, signal?: AbortSignal): StudioSource | Promise<StudioSource>;
|
|
96
96
|
}
|
|
97
|
-
/** A separate renderer preserves preview state.
|
|
97
|
+
/** A separate renderer preserves preview state. Video sources must also be independent. */
|
|
98
98
|
declare function exportStudio(source: StudioExportSource, settings: StudioSettings, options: StudioExportOptions): Promise<Blob>;
|
|
99
99
|
|
|
100
100
|
interface MountStudioOptions {
|
|
@@ -184,9 +184,172 @@ declare const loaders: {
|
|
|
184
184
|
Wavy: () => Promise<typeof figlet_fonts_Wavy>;
|
|
185
185
|
};
|
|
186
186
|
declare const STUDIO_TEXT_FONTS: (keyof typeof loaders)[];
|
|
187
|
-
declare function createStudioText(text: string, font?: keyof typeof loaders, ink?: string): Promise<{
|
|
187
|
+
declare function createStudioText(text: string, font?: keyof typeof loaders, ink?: string, background?: string | null): Promise<{
|
|
188
188
|
canvas: HTMLCanvasElement;
|
|
189
189
|
ascii: string;
|
|
190
190
|
}>;
|
|
191
191
|
|
|
192
|
-
|
|
192
|
+
declare const MAX_STUDIO_LAYERS = 8;
|
|
193
|
+
interface StudioLayerPlacement {
|
|
194
|
+
/** Normalized center and size in the project canvas. */
|
|
195
|
+
x: number;
|
|
196
|
+
y: number;
|
|
197
|
+
width: number;
|
|
198
|
+
height: number;
|
|
199
|
+
rotation: number;
|
|
200
|
+
flipX: boolean;
|
|
201
|
+
flipY: boolean;
|
|
202
|
+
}
|
|
203
|
+
interface StudioProjectLayer {
|
|
204
|
+
id: string;
|
|
205
|
+
name: string;
|
|
206
|
+
source: string;
|
|
207
|
+
visible: boolean;
|
|
208
|
+
opacity: number;
|
|
209
|
+
blend: typeof BLEND_MODES[number];
|
|
210
|
+
placement: StudioLayerPlacement;
|
|
211
|
+
settings: StudioSettings;
|
|
212
|
+
}
|
|
213
|
+
interface StudioProject {
|
|
214
|
+
kind: 'asciify-project';
|
|
215
|
+
version: 1;
|
|
216
|
+
width: number;
|
|
217
|
+
height: number;
|
|
218
|
+
background: string | null;
|
|
219
|
+
pointerMode: 'top' | 'all';
|
|
220
|
+
layers: StudioProjectLayer[];
|
|
221
|
+
}
|
|
222
|
+
type StudioLayerInput = Pick<StudioProjectLayer, 'id' | 'source'> & Partial<Omit<StudioProjectLayer, 'id' | 'source' | 'placement' | 'settings'>> & {
|
|
223
|
+
placement?: Partial<StudioLayerPlacement>;
|
|
224
|
+
settings?: StudioInput;
|
|
225
|
+
};
|
|
226
|
+
type StudioLayerPatch = Partial<Omit<StudioLayerInput, 'id'>>;
|
|
227
|
+
type StudioProjectInput = Partial<Omit<StudioProject, 'layers'>> & {
|
|
228
|
+
layers?: StudioLayerInput[];
|
|
229
|
+
};
|
|
230
|
+
/** A project contains asset keys, never source files, URLs or executable code. */
|
|
231
|
+
declare function normalizeStudioProject(input?: unknown): StudioProject;
|
|
232
|
+
declare function updateStudioProjectLayer(project: StudioProject, id: string, patch: StudioLayerPatch): StudioProject;
|
|
233
|
+
declare const serializeStudioProject: (project: StudioProject) => string;
|
|
234
|
+
declare function parseStudioProject(json: string): StudioProject;
|
|
235
|
+
/** No pixel readback: pointer picking uses transformed rectangular layer bounds. */
|
|
236
|
+
declare function studioLayerPoint(layer: StudioProjectLayer, x: number, y: number, width: number, height: number): [number, number];
|
|
237
|
+
declare function visibleStudioLayers(project: StudioProject): StudioProjectLayer[];
|
|
238
|
+
/** A shared budget prevents each extra layer from multiplying the work ceiling. */
|
|
239
|
+
declare function studioProjectBudget(project: StudioProject, maxCells?: number, maxRasterPixels?: number, width?: number, height?: number): {
|
|
240
|
+
id: string;
|
|
241
|
+
maxCells: number;
|
|
242
|
+
width: number;
|
|
243
|
+
height: number;
|
|
244
|
+
}[];
|
|
245
|
+
|
|
246
|
+
interface StudioProjectLimits {
|
|
247
|
+
maxDimension?: number;
|
|
248
|
+
maxCells?: number;
|
|
249
|
+
maxRasterPixels?: number;
|
|
250
|
+
pixelRatio?: number;
|
|
251
|
+
}
|
|
252
|
+
type StudioProjectFrames = ReadonlyMap<string, StudioSource>;
|
|
253
|
+
/** Reusable composition renderer. No RAF, event listeners, loading or media ownership. */
|
|
254
|
+
declare function createStudioProjectRenderer(canvas: HTMLCanvasElement, input?: unknown, limits?: StudioProjectLimits): {
|
|
255
|
+
canvas: HTMLCanvasElement;
|
|
256
|
+
render(frames: StudioProjectFrames, time?: number, width?: number, height?: number, motionTimes?: Readonly<Record<string, number>>): boolean;
|
|
257
|
+
configure(next: unknown): void;
|
|
258
|
+
pointer(x: number, y: number, time: number): void;
|
|
259
|
+
leave(): void;
|
|
260
|
+
invalidate(source?: string): void;
|
|
261
|
+
setBudget(value: number): void;
|
|
262
|
+
setPixelRatio(value: number): void;
|
|
263
|
+
readonly maxCells: number;
|
|
264
|
+
readonly pixelRatio: number;
|
|
265
|
+
readonly quality: {
|
|
266
|
+
id: string;
|
|
267
|
+
maxCells: number;
|
|
268
|
+
width: number;
|
|
269
|
+
height: number;
|
|
270
|
+
}[];
|
|
271
|
+
readonly active: boolean;
|
|
272
|
+
destroy(): void;
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
interface StudioProjectTextSource {
|
|
276
|
+
text: string;
|
|
277
|
+
font?: Parameters<typeof createStudioText>[1];
|
|
278
|
+
ink?: string;
|
|
279
|
+
}
|
|
280
|
+
type StudioProjectSource = File | string | StudioProjectTextSource;
|
|
281
|
+
type StudioProjectSources = Readonly<Record<string, StudioProjectSource>>;
|
|
282
|
+
type StudioProjectMedia = ReadonlyMap<string, StudioMedia>;
|
|
283
|
+
|
|
284
|
+
interface MountStudioProjectOptions extends StudioProjectLimits {
|
|
285
|
+
fps?: number;
|
|
286
|
+
adaptive?: boolean;
|
|
287
|
+
signal?: AbortSignal;
|
|
288
|
+
onFrame?: (time: number, costMs: number) => void;
|
|
289
|
+
onError?: (error: Error) => void;
|
|
290
|
+
onQualityChange?: (maxCells: number) => void;
|
|
291
|
+
}
|
|
292
|
+
declare function mountStudioProject(canvas: HTMLCanvasElement, input: StudioProjectInput, sources: StudioProjectSources, options?: MountStudioProjectOptions): Promise<{
|
|
293
|
+
canvas: HTMLCanvasElement;
|
|
294
|
+
readonly project: StudioProject;
|
|
295
|
+
readonly time: number;
|
|
296
|
+
readonly motionTimes: {
|
|
297
|
+
[x: string]: number;
|
|
298
|
+
};
|
|
299
|
+
readonly paused: boolean;
|
|
300
|
+
readonly maxCells: number;
|
|
301
|
+
readonly pixelRatio: number;
|
|
302
|
+
readonly quality: {
|
|
303
|
+
id: string;
|
|
304
|
+
maxCells: number;
|
|
305
|
+
width: number;
|
|
306
|
+
height: number;
|
|
307
|
+
}[];
|
|
308
|
+
update: (next: StudioProjectInput) => void;
|
|
309
|
+
updateLayer: (id: string, patch: StudioLayerPatch) => void;
|
|
310
|
+
resize(w: number, h: number, pixelRatio?: number): void;
|
|
311
|
+
pause(value?: boolean): void;
|
|
312
|
+
seek(seconds: number): Promise<void>;
|
|
313
|
+
redraw(): void;
|
|
314
|
+
setBudget(value: number): void;
|
|
315
|
+
setAdaptive(value: boolean): void;
|
|
316
|
+
destroy: () => void;
|
|
317
|
+
}>;
|
|
318
|
+
/** Takes ownership of the supplied media. One shared RAF drives all layers. */
|
|
319
|
+
declare function mountStudioProjectMedia(canvas: HTMLCanvasElement, input: StudioProjectInput, media: StudioProjectMedia, options?: MountStudioProjectOptions): {
|
|
320
|
+
canvas: HTMLCanvasElement;
|
|
321
|
+
readonly project: StudioProject;
|
|
322
|
+
readonly time: number;
|
|
323
|
+
readonly motionTimes: {
|
|
324
|
+
[x: string]: number;
|
|
325
|
+
};
|
|
326
|
+
readonly paused: boolean;
|
|
327
|
+
readonly maxCells: number;
|
|
328
|
+
readonly pixelRatio: number;
|
|
329
|
+
readonly quality: {
|
|
330
|
+
id: string;
|
|
331
|
+
maxCells: number;
|
|
332
|
+
width: number;
|
|
333
|
+
height: number;
|
|
334
|
+
}[];
|
|
335
|
+
update: (next: StudioProjectInput) => void;
|
|
336
|
+
updateLayer: (id: string, patch: StudioLayerPatch) => void;
|
|
337
|
+
resize(w: number, h: number, pixelRatio?: number): void;
|
|
338
|
+
pause(value?: boolean): void;
|
|
339
|
+
seek(seconds: number): Promise<void>;
|
|
340
|
+
redraw(): void;
|
|
341
|
+
setBudget(value: number): void;
|
|
342
|
+
setAdaptive(value: boolean): void;
|
|
343
|
+
destroy: () => void;
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
interface StudioProjectExportOptions extends Omit<StudioExportOptions, 'motionTime'> {
|
|
347
|
+
/** Phase snapshot from a mounted project, for a still after speed edits. */
|
|
348
|
+
motionTimes?: Readonly<Record<string, number>>;
|
|
349
|
+
/** Combined child-raster budget, distinct from the shared character budget. */
|
|
350
|
+
maxRasterPixels?: number;
|
|
351
|
+
}
|
|
352
|
+
/** Loads independent assets and never seeks, pauses or destroys a live preview. */
|
|
353
|
+
declare function exportStudioProject(input: StudioProjectInput, sources: StudioProjectSources, options: StudioProjectExportOptions): Promise<Blob>;
|
|
354
|
+
|
|
355
|
+
export { BLEND_MODES, MAX_STUDIO_LAYERS, type MountStudioOptions, type MountStudioProjectOptions, STUDIO_LOOKS, STUDIO_TEXT_FONTS, type StudioExportFormat, type StudioExportOptions, type StudioExportSource, StudioInput, type StudioLayerInput, type StudioLayerPatch, type StudioLayerPlacement, type StudioMedia, type StudioProject, type StudioProjectExportOptions, type StudioProjectFrames, type StudioProjectInput, type StudioProjectLayer, type StudioProjectLimits, type StudioProjectMedia, type StudioProjectSource, type StudioProjectSources, type StudioProjectTextSource, StudioSettings, type StudioSource, createStudioProjectRenderer, createStudioRenderer, createStudioText, exportStudio, exportStudioProject, loadStudioMedia, mountStudio, mountStudioMedia, mountStudioProject, mountStudioProjectMedia, normalizeStudioProject, parseStudioProject, restyleStudio, serializeStudioProject, studioLayerPoint, studioLook, studioProjectBudget, studioSourceSize, updateStudioProjectLayer, visibleStudioLayers };
|