react-forminate
Version:
React.js + Typescript package that creates dynamic UI forms based on the JSON schema
30 lines (29 loc) • 987 B
TypeScript
import { APIMethodType, APIDependsOnType, APIParamsType, APIHeadersType, APITransformResponseType, APIResultPathType, APIfetchOnInitType, APIEndpointType, APIForceRefreshType } from './primitiveTypes';
export type APIPaginationType = {
limit?: number;
maxPage?: number;
pageKey?: string;
limitKey?: string;
skipKey?: string;
pageMode?: "page" | "skip";
startPage?: number;
metadataPath?: string;
};
export interface DynamicOptionsCache {
lastValues?: Record<string, any>;
lastFetchTime?: number;
}
export interface dynamicOptionsType {
endpoint: APIEndpointType;
method?: APIMethodType;
dependsOn?: APIDependsOnType;
params?: APIParamsType;
headers?: APIHeadersType;
transformResponse?: APITransformResponseType;
resultPath?: APIResultPathType;
fetchOnInit?: APIfetchOnInitType;
pagination?: APIPaginationType;
forceRefresh?: APIForceRefreshType;
_cache?: DynamicOptionsCache;
cacheTime?: number;
}