react-native-wishlist
Version:
The fastest List component for React Native.
21 lines • 1.29 kB
TypeScript
import React from 'react';
import { ComponentPool, TemplateItem } from './InflatorRepository';
import { TemplateValue } from './TemplateValue';
declare type Nullable = undefined | null;
declare type Primitive = string | number | boolean | symbol;
declare type Builtin = Function | Date | Error | RegExp;
interface WithTemplateArray<P> extends Array<WithTemplateValue<P>> {
}
declare type WithTemplateObject<T> = {
[K in keyof T]: WithTemplateValue<T[K]>;
};
declare type WithTemplateValue<T> = T extends Builtin | Nullable ? T : T extends Primitive ? T | TemplateValue<T> : T extends Array<infer P> ? WithTemplateArray<P> : T extends {} ? WithTemplateObject<T> : T;
declare type NonTemplateProps = 'key' | 'ref';
export declare type TemplateProps<T> = {
[key in keyof T]: key extends NonTemplateProps ? T[key] : WithTemplateValue<T[key]>;
};
export interface TemplateComponent<T extends React.ComponentType<any>> extends React.FC<TemplateProps<React.ComponentPropsWithRef<T>>> {
}
export declare function createTemplateComponent<T extends React.ComponentType<any>>(Component: T, addProps?: (templateItem: TemplateItem, props: any, inflatorId: string, pool: ComponentPool, rootValue: any) => void): TemplateComponent<T>;
export {};
//# sourceMappingURL=createTemplateComponent.d.ts.map