@redhare/lowcode-datasource-types
Version:
6 lines (5 loc) • 525 B
TypeScript
import { IDataSourceRuntimeContext, RuntimeOptionsConfig } from './data-source-runtime';
export type RequestHandler<T = unknown> = (options: RuntimeOptionsConfig, context?: IDataSourceRuntimeContext) => Promise<T>;
export type UrlParamsHandler<T = unknown> = (context?: IDataSourceRuntimeContext) => Promise<T>;
export type RequestHandlersMap<T = unknown> = Record<string, RequestHandler<T>>;
export type CustomRequestHandler<T = unknown> = (options: RuntimeOptionsConfig, context?: IDataSourceRuntimeContext) => Promise<T>;