UNPKG

@vitus-labs/rocketstories

Version:

Rocketstyle is ultra powerful and extensible styling system for building React components blazingly fast, easily and make them easily extensible and reusable.

29 lines 2.04 kB
import * as rocketstory from "./stories/rocketstories"; import * as simplestory from "./stories/base"; import type { Control, TObj, Configuration, RocketType, ExtractProps, RenderStoryOptions, ListStoryOptions } from "./types"; export interface IRocketStories<OA extends TObj = {}, RA extends TObj | unknown = unknown, ISRS extends boolean = false> { CONFIG: Configuration; main: () => ISRS extends true ? ReturnType<rocketstory.RenderMain<OA>> : ReturnType<simplestory.RenderMain<OA>>; dimension: <P extends keyof RA>(dimension: ISRS extends true ? P : never, options?: Partial<{ ignore: Array<RA[P]>; }>) => ReturnType<rocketstory.RenderDimension<OA>> | null; render: (params: RenderStoryOptions<OA>) => ISRS extends true ? ReturnType<rocketstory.RenderRender<OA>> : ReturnType<simplestory.RenderRender<OA>>; list: (params: ListStoryOptions) => ISRS extends true ? ReturnType<rocketstory.RenderList<OA>> : ReturnType<simplestory.RenderList<OA>>; init: () => { component: Configuration['component']; title: Configuration['name']; decorators: Configuration['decorators']; }; storyOptions: (options: Configuration['storyOptions']) => IRocketStories<OA, RA, ISRS>; controls: (options: Partial<{ [I in keyof OA]: Control; }>) => IRocketStories<OA, RA, ISRS>; config: <P extends Partial<Omit<Configuration, 'attrs'>>>(params: P) => IRocketStories<OA, RA, ISRS>; attrs: <P extends Partial<OA>>(params: P) => IRocketStories<OA, RA, ISRS>; replaceComponent: <P extends Configuration['component']>(param: P) => P extends RocketType ? IRocketStories<ExtractProps<P>, P['$$rocketstyle'], true> : IRocketStories<ExtractProps<P>, unknown, false>; decorators: <P extends Configuration['decorators']>(param: P) => IRocketStories<OA, RA, ISRS>; } type CreateRocketStories = (options: Configuration) => IRocketStories; declare const createRocketStories: CreateRocketStories; export default createRocketStories; //# sourceMappingURL=rocketstories.d.ts.map