@toriistudio/v0-playground
Version:
102 lines (94 loc) • 3.19 kB
text/typescript
import * as react_jsx_runtime from 'react/jsx-runtime';
import * as React from 'react';
import React__default, { ReactNode } from 'react';
import * as class_variance_authority_types from 'class-variance-authority/types';
import { VariantProps } from 'class-variance-authority';
declare function Playground({ children }: {
children: ReactNode;
}): react_jsx_runtime.JSX.Element | null;
type CanvasMediaProps = {
debugOrbit?: boolean;
size: {
width: number;
height: number;
} | null;
};
type CanvasProps = {
mediaProps?: CanvasMediaProps;
children: React__default.ReactNode;
};
declare const Canvas: React__default.FC<CanvasProps>;
type PlaygroundCanvasProps = {
children: React__default.ReactNode;
mediaProps?: CanvasMediaProps;
};
declare const PlaygroundCanvas: React__default.FC<PlaygroundCanvasProps>;
declare function CameraLogger(): react_jsx_runtime.JSX.Element;
declare const buttonVariants: (props?: ({
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
} & class_variance_authority_types.ClassProp) | undefined) => string;
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
asChild?: boolean;
}
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
type BaseControl = {
hidden?: boolean;
};
type ControlType = ({
type: "boolean";
value: boolean;
} & BaseControl) | ({
type: "number";
value: number;
min?: number;
max?: number;
step?: number;
} & BaseControl) | ({
type: "string";
value: string;
} & BaseControl) | ({
type: "color";
value: string;
} & BaseControl) | ({
type: "select";
value: string;
options: Record<string, any>;
} & BaseControl) | ({
type: "button";
onClick?: () => void;
label?: string;
render?: () => React__default.ReactNode;
} & BaseControl);
type ControlsSchema = Record<string, ControlType>;
type ControlsConfig = {
showCopyButton?: boolean;
mainLabel?: string;
showGrid?: boolean;
};
declare const ControlsProvider: ({ children }: {
children: ReactNode;
}) => react_jsx_runtime.JSX.Element;
declare const useControls: <T extends ControlsSchema>(schema: T, options?: {
componentName?: string;
config?: ControlsConfig;
}) => { [K in keyof T]: T[K] extends {
value: infer V;
} ? V : never; } & {
controls: Record<string, any>;
schema: ControlsSchema;
setValue: (key: string, value: any) => void;
jsx: () => string;
};
declare const useUrlSyncedControls: <T extends ControlsSchema>(schema: T, options?: {
componentName?: string;
config?: ControlsConfig;
}) => { [K in keyof T]: T[K] extends {
value: infer V;
} ? V : never; } & {
controls: Record<string, any>;
schema: ControlsSchema;
setValue: (key: string, value: any) => void;
jsx: () => string;
};
export { Button, CameraLogger, Canvas, type ControlType, ControlsProvider, type ControlsSchema, Playground, PlaygroundCanvas, useControls, useUrlSyncedControls };