@jengaui/utils
Version:
Jenga UI Utils component in React
23 lines (20 loc) • 1.21 kB
TypeScript
import { Props } from 'tastycss';
declare function castNullableStringValue<T>(props: T): T;
declare function castNullableNumberValue<T>(props: T): T;
declare function castNullableArrayValue<T>(props: T): T;
declare function castNullableIsSelected<T>(props: T): T;
declare function castNullableSelectedKey<T>(props: T): T;
declare function castNullableField<T>(props: T, keys: string[], type?: string, cast?: (k: any) => any): T;
declare type WithNullableValue<T extends Props> = Omit<T, 'value' | 'defaultValue'> & {
value?: T['value'] | any;
defaultValue?: T['defaultValue'] | any;
};
declare type WithNullableSelected<T extends Props> = Omit<T, 'isSelected' | 'defaultSelected'> & {
isSelected?: T['isSelected'] | any;
defaultSelected?: T['defaultSelected'] | any;
};
declare type WithNullableSelectedKey<T extends Props> = Omit<T, 'selectedKey' | 'defaultSelectedKey'> & {
selectedKey?: T['selectedKey'] | any;
defaultSelectedKey?: T['defaultSelectedKey'] | any;
};
export { WithNullableSelected, WithNullableSelectedKey, WithNullableValue, castNullableArrayValue, castNullableField, castNullableIsSelected, castNullableNumberValue, castNullableSelectedKey, castNullableStringValue };