element-book 4.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -13,9 +13,11 @@ export type ElementBookPage<Controls extends ElementBookPageControlMap = Element
|
|
|
13
13
|
pageBreadcrumbs: ReadonlyArray<string>;
|
|
14
14
|
};
|
|
15
15
|
export type PageControlsFromPage<Page extends ElementBookPage<any>> = Page extends ElementBookPage<infer Controls> ? Controls : never;
|
|
16
|
+
export type DefinePageExamplesCallback<ParentPageControls extends ElementBookPageControlMap> = (params: {
|
|
17
|
+
defineExample: DefineExampleCallback<ParentPageControls>;
|
|
18
|
+
}) => void;
|
|
19
|
+
export type DefineExampleCallback<ParentPageControls extends ElementBookPageControlMap> = <StateInit extends PropertyInitMapBase = {}, RenderOutput = any>(exampleInit: ElementBookPageExampleInit<ParentPageControls, StateInit, RenderOutput>) => void;
|
|
16
20
|
export type ElementBookPageInit<Controls extends ElementBookPageControlMap> = Overwrite<SetOptional<Omit<ElementBookPage<Controls>, 'entryType' | 'allExampleTitles' | 'pageBreadcrumbs' | 'examples'>, 'controls'>, {
|
|
17
|
-
defineExamplesCallback?:
|
|
18
|
-
defineExample: <StateInit extends PropertyInitMapBase = {}, RenderOutput = any>(exampleInit: ElementBookPageExampleInit<Controls, StateInit, RenderOutput>) => void;
|
|
19
|
-
}) => void;
|
|
21
|
+
defineExamplesCallback?: DefinePageExamplesCallback<Controls>;
|
|
20
22
|
}>;
|
|
21
23
|
export declare function defineElementBookPage<Controls extends ElementBookPageControlMap = {}>(pageSetup: ElementBookPageInit<Controls>): ElementBookPage<Controls>;
|