UNPKG

@renderlesskit/react

Version:

Collection of headless components/hooks that are accessible, composable, customizable from low level to build your own UI & Design System powered by Reakit

27 lines (26 loc) 1.13 kB
export declare type Hook<O = any, P = any> = { (options?: O, htmlProps?: P, unstable_ignoreUseOptions?: boolean): P; unstable_propsAreEqual: (prev: O & P, next: O & P) => boolean; __keys: ReadonlyArray<any>; __useOptions: (options: O, htmlProps: P) => O; }; export declare type CreateHook<O, P> = { name?: string; compose?: Hook | Hook[]; useState?: { (): any; __keys: ReadonlyArray<any>; }; useOptions?: (options: O, htmlProps: P) => O; useProps?: (options: O, htmlProps: P) => P; useComposeOptions?: (options: O, htmlProps: P) => O; useComposeProps?: (options: O, htmlProps: P) => P; propsAreEqual?: (prev: O & P, next: O & P) => boolean; keys?: ReadonlyArray<string>; }; export declare function createComposableHook<O, P>(options: CreateHook<O, P>): (newOptions?: CreateHook<O, P> | undefined) => { (options?: O | undefined, htmlProps?: P | undefined, unstable_ignoreUseOptions?: boolean | undefined): P; unstable_propsAreEqual: (prev: O & P, next: O & P) => boolean; __keys: readonly any[]; __useOptions: (options: O, htmlProps: P) => O; };