/// export interface Constructor { new (...args: any[]): Instance; } export interface IStringIndexable { [key: string]: any; } export declare type Factory = () => T; export declare type ReactorComponent, TInstance = InstanceType> = React.ForwardRefExoticComponent> & React.RefAttributes>; export declare type ReactorComponentProps, TInstance = InstanceType> = MainProps & AttachProp & ChildrenProp & ConstructorArgsProps & ObjectProp; declare type MainProps = Omit, "children" | "attach" | "args">; declare type ConvenienceProps = { [K in keyof T]?: SetArgumentType | SetScalarArgumentType; }; declare type SetArgumentType = T[K] extends { set: (...args: infer Arguments) => any; } ? Arguments extends [any] ? Arguments[0] | T[K] : Arguments | T[K] : T[K]; declare type SetScalarArgumentType = T[K] extends { setScalar: (scalar: infer Argument) => any; } ? Argument | T[K] : T[K]; declare type ChildrenProp = { children?: React.ReactNode | (() => JSX.Element); }; declare type AttachProp = { /** Attach the object to the parent property specified here. */ attach?: string; }; /** * Our wrapper components allow the user to pass an already instantiated object, or it will create a new * instance of the class it wraps around. */ declare type ObjectProp = { /** If you already have an instance of the class you want to wrap, you can pass it here. */ object?: T | { dispose?: () => void; }; }; /** Some extra props we will be accepting on our wrapper component. */ declare type ConstructorArgsProps = { /** Arguments passed to the wrapped THREE class' constructor. */ args?: TConstructor extends new (...args: infer V) => any ? V : never; }; export {};