@mui/internal-docs-infra
Version:
MUI Infra - internal documentation creation tools.
44 lines • 2.44 kB
TypeScript
import { CreateDemoDataMeta, DemoData, DemoGlobalData, DemoGlobalProvider } from "./types.js";
/**
* Creates demo data for displaying code examples with syntax highlighting.
* A variant is a different implementation style of the same component.
* Returns a data object containing demo metadata and components instead of a complete demo component.
* Note: It is recommended to use abstractCreateDemo to create a complete demo component rather than just demo data.
* @param url Depends on `import.meta.url` to determine the source file location.
* @param variants The variants of the component to be rendered in the demo.
* @param meta Additional meta for the demo.
*/
export declare function createDemoDataWithVariants<T extends React.ComponentType<any> = React.ComponentType>(url: string, variants: {
Default: T;
} | {
[key: string]: T;
}, meta?: CreateDemoDataMeta): DemoData<T>;
/**
* Creates demo data for displaying code examples with syntax highlighting.
* Returns a data object containing demo metadata and components instead of a complete demo component.
* Note: It is recommended to use abstractCreateDemo to create a complete demo component rather than just demo data.
* @param url Depends on `import.meta.url` to determine the source file location.
* @param component The component to be rendered in the demo.
* @param meta Additional meta for the demo.
*/
export declare function createDemoData<T extends React.ComponentType<any> = React.ComponentType>(url: string, component: T, meta?: CreateDemoDataMeta): DemoData<T>;
/**
* Creates a demo data object for a global provider component with different variants.
*
* @param url The URL of the demo file.
* @param globalProviders The variants of the global provider to be rendered in the demo.
* @param meta Additional metadata for the demo data.
* @returns Demo data object.
*/
export declare function createDemoGlobalWithVariants(url: string, globalProviders: {
[variant: string]: DemoGlobalProvider;
}, meta?: CreateDemoDataMeta): DemoGlobalData;
/**
* Creates a demo data object for a global provider component.
*
* @param url The URL of the demo file.
* @param globalProvider The global provider to be rendered in the demo.
* @param meta Additional metadata for the demo data.
* @returns Demo data object.
*/
export declare function createDemoGlobal(url: string, globalProvider: DemoGlobalProvider, meta?: CreateDemoDataMeta): DemoGlobalData;