import { Cache } from "cache"; import { CommandInstance } from "command"; import { Dispatcher } from "dispatcher"; import { ClientResponseType, ClientType, ClientQueryParamsType } from "client"; import { Builder } from "builder"; import { AppManager } from "managers"; import { NegativeTypes } from "types"; /** * Configuration setup for the builder */ export type BuilderConfig = { /** * Url to your server */ baseUrl: string; /** * Disable the web event listeners and actions on window object */ isNodeJS?: boolean; /** * Custom client initialization prop */ client?: ClientType; /** * Custom cache initialization prop */ cache?: (builder: B) => C; /** * Custom app manager initialization prop */ appManager?: (builder: B) => A; /** * Custom fetch dispatcher initialization prop */ fetchDispatcher?: (builder: B) => D; /** * Custom submit dispatcher initialization prop */ submitDispatcher?: (builder: B) => D; }; export type BuilderInstance = Builder; export type BuilderErrorType = Record | string; // Interceptors export type RequestInterceptorCallback = (command: CommandInstance) => Promise | CommandInstance; export type ResponseInterceptorCallback = ( response: ClientResponseType, command: CommandInstance, ) => Promise> | ClientResponseType; // Stringify export type StringifyCallbackType = (queryParams: ClientQueryParamsType | string | NegativeTypes) => string;