49 lines
1.1 KiB
TypeScript
49 lines
1.1 KiB
TypeScript
// ----- createApi -----
|
|
|
|
export type ApiAction = {
|
|
url?: string | ((id?: unknown, data?: any) => string);
|
|
method?: "get" | "post" | "put" | "patch" | "delete";
|
|
body?: (data: any) => any;
|
|
sendRawPayload?: boolean;
|
|
invalidateKeys?: any[] | ((responseData: any, variables: any) => any[]);
|
|
};
|
|
|
|
export type CreateApiConfig = {
|
|
key: string | unknown[];
|
|
url: string;
|
|
actions?: Record<string, ApiAction>;
|
|
axiosInstance?: any;
|
|
fetcher?: any;
|
|
};
|
|
|
|
export function createApi(config: CreateApiConfig): {
|
|
key: unknown[];
|
|
listKey: unknown[];
|
|
useGet: any;
|
|
useItem: any;
|
|
useAction: any;
|
|
};
|
|
|
|
// ----- BiProvider -----
|
|
|
|
export type BiProviderProps = {
|
|
children?: any;
|
|
apiBaseUrl?: string;
|
|
keycloakClientId?: string;
|
|
permissionClientId?: string;
|
|
loading?: any;
|
|
updateChecker?: boolean;
|
|
updateCheckerProps?: Record<string, any>;
|
|
keycloakUrl?: string;
|
|
keycloakRealm?: string;
|
|
permissionUrl?: string;
|
|
keycloakEnabled?: boolean;
|
|
permissionEnabled?: boolean;
|
|
theme?: any;
|
|
remoteUiEnabled?: boolean;
|
|
remoteUiUrl?: string;
|
|
remoteUiChakraProviderProps?: Record<string, any>;
|
|
};
|
|
|
|
export function BiProvider(props: BiProviderProps): any;
|