@helpwave/hightide
Version:
helpwave's component and theming library
15 lines (12 loc) • 495 B
TypeScript
import { ReactNode } from 'react';
type BagFunction<T> = (bag: T) => ReactNode;
type PropsWithBagFunction<T, P = unknown> = P & {
children?: BagFunction<T>;
};
type PropsWithBagFunctionOrChildren<T, P = unknown> = P & {
children?: BagFunction<T> | ReactNode;
};
declare const BagFunctionUtil: {
resolve: <T>(children: BagFunction<T> | ReactNode, bag: T) => ReactNode;
};
export { type BagFunction, BagFunctionUtil, type PropsWithBagFunction, type PropsWithBagFunctionOrChildren };