import type { ComponentType } from 'react'; import type { CalculateMetadataFunction } from 'remotion'; import type { AnyZodObject, z } from 'zod'; export type InferProps> = AnyZodObject extends Schema ? {} extends Props ? Record : Props : {} extends Props ? z.input : z.input & Props; export type DefaultPropsIfHasProps = AnyZodObject extends Schema ? {} extends Props ? { defaultProps?: z.input & Props; } : { defaultProps: Props; } : {} extends Props ? { defaultProps: z.input; } : { defaultProps: z.input & Props; }; type LooseComponentType = ComponentType | ((props: T) => React.ReactNode); type OptionalDimensions> = { component: LooseComponentType; id: string; width?: number; height?: number; calculateMetadata: CalculateMetadataFunction>; }; type MandatoryDimensions> = { component: LooseComponentType; id: string; width: number; height: number; calculateMetadata?: CalculateMetadataFunction> | null; }; export type CompositionCalculateMetadataOrExplicit> = ((OptionalDimensions & { fps?: number; durationInFrames?: number; }) | (MandatoryDimensions & { fps: number; durationInFrames: number; })) & DefaultPropsIfHasProps; export {};