feat: full studio build -- light theme, canvas thumbnails, i18n (fa/en)
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const layerSchema = z.object({
|
||||
id: z.string(),
|
||||
type: z.enum(["text", "image", "video", "shape"]),
|
||||
x: z.number(),
|
||||
y: z.number(),
|
||||
width: z.number(),
|
||||
height: z.number(),
|
||||
rotation: z.number(),
|
||||
opacity: z.number(),
|
||||
zIndex: z.number(),
|
||||
props: z.record(z.string(), z.unknown()),
|
||||
});
|
||||
|
||||
export const sceneSchema = z.object({
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
duration: z.number().positive(),
|
||||
layers: z.array(layerSchema),
|
||||
thumbnailUrl: z.string().optional(),
|
||||
});
|
||||
|
||||
export const renderSettingsSchema = z.object({
|
||||
resolution: z.enum(["720p", "1080p", "4K"]),
|
||||
format: z.literal("mp4").default("mp4"),
|
||||
fps: z.union([z.literal(24), z.literal(30), z.literal(60)]),
|
||||
});
|
||||
|
||||
export const renderRequestSchema = z.object({
|
||||
projectId: z.string().min(1),
|
||||
scenes: z.array(sceneSchema).min(1),
|
||||
settings: renderSettingsSchema,
|
||||
});
|
||||
|
||||
export type RenderRequest = z.infer<typeof renderRequestSchema>;
|
||||
export type RenderSettings = z.infer<typeof renderSettingsSchema>;
|
||||
export type RenderScene = z.infer<typeof sceneSchema>;
|
||||
|
||||
export const renderStatusSchema = z.enum([
|
||||
"queued",
|
||||
"processing",
|
||||
"completed",
|
||||
"failed",
|
||||
]);
|
||||
|
||||
export type RenderJobStatus = z.infer<typeof renderStatusSchema>;
|
||||
|
||||
export const RESOLUTION_DIMENSIONS: Record<
|
||||
RenderSettings["resolution"],
|
||||
{ width: number; height: number }
|
||||
> = {
|
||||
"720p": { width: 1280, height: 720 },
|
||||
"1080p": { width: 1920, height: 1080 },
|
||||
"4K": { width: 3840, height: 2160 },
|
||||
};
|
||||
Reference in New Issue
Block a user