feat: async renderScene

This commit is contained in:
Arnošt Pleskot 2023-08-08 17:30:54 +02:00
parent f2611f5d1f
commit 9e9f564ea9
No known key found for this signature in database
4 changed files with 543 additions and 547 deletions

File diff suppressed because it is too large Load Diff

View File

@ -54,7 +54,7 @@ export const exportToCanvas = async (
const onlyExportingSingleFrame = isOnlyExportingSingleFrame(elements); const onlyExportingSingleFrame = isOnlyExportingSingleFrame(elements);
renderScene({ await renderScene({
elements, elements,
appState, appState,
scale, scale,

View File

@ -27,7 +27,7 @@ export type RenderConfig = {
/** when exporting the behavior is slightly different (e.g. we can't use /** when exporting the behavior is slightly different (e.g. we can't use
CSS filters), and we disable render optimizations for best output */ CSS filters), and we disable render optimizations for best output */
isExporting: boolean; isExporting: boolean;
exportBackgroundImage?: string; exportBackgroundImage?: string | null;
selectionColor?: string; selectionColor?: string;
}; };

View File

@ -54,3 +54,5 @@ export type Assert<T extends true> = T;
export type NestedKeyOf<T, K = keyof T> = K extends keyof T & (string | number) export type NestedKeyOf<T, K = keyof T> = K extends keyof T & (string | number)
? `${K}` | (T[K] extends object ? `${K}.${NestedKeyOf<T[K]>}` : never) ? `${K}` | (T[K] extends object ? `${K}.${NestedKeyOf<T[K]>}` : never)
: never; : never;
export type Unpromisify<T> = T extends Promise<infer U> ? U : T;