export type GenericFunction = (...arguments_: any[]) => T; export type PlainObject = Record; export type HttpMethods = "CONNECT" | "DELETE" | "GET" | "HEAD" | "OPTIONS" | "PATCH" | "POST" | "PUT"; export interface CorsOptions { /** @default true */ allowCredentials?: boolean; /** @default [] */ allowedHeaders?: string[]; /** @default ['GET'] */ methods?: HttpMethods[]; /** @default * */ origin?: string; responseHeaders?: PlainObject; /** @default 200 */ statusCode?: number; } export interface FormatDateLocaleOptions { locale?: string; showTime?: boolean; } export interface FormatMoneyOptions { decimalChar?: "," | "."; showCents?: boolean; symbol?: string; thousandsChar?: "," | "."; } export type InvertKeyValue> = { [K in T[keyof T]]: { [P in keyof T]: T[P] extends K ? P : never; }[keyof T]; }; export interface LoggerOptions { collapsed?: boolean; hideTimestamp?: boolean; skip?: boolean; typeColor?: string; } export interface PollOptions { delay?: number; maxRetries?: number; } export interface QueryStringFormatOptions { addPrefix?: boolean; encodeValuesOnly?: boolean; encoder?: (uri: string) => string; } export interface RequestOptions { body?: any; headers?: PlainObject; method?: HttpMethods; } export interface RequestError extends Error { response: any; status: number; } export interface SortFunction { (left: PlainObject, right: PlainObject): number; (left: T, right: T): number; } export interface TimeSinceOptions { /** * @default "day" */ day?: string; /** * @default "days" */ days?: string; /** * @default "hour" */ hour?: string; /** * @default "hours" */ hours?: string; /** * @default "minute" */ minute?: string; /** * @default "minutes" */ minutes?: string; /** * @default "month" */ month?: string; /** * @default "months" */ months?: string; prefix?: string; /** * @default "second" */ second?: string; /** * @default "seconds" */ seconds?: string; /** * @default false */ skipWeeks?: boolean; /** * @default "ago" */ suffix?: string; /** * @default "week" */ week?: string; /** * @default "weeks" */ weeks?: string; /** * @default "year" */ year?: string; /** * @default "years" */ years?: string; } export interface UniqueOptions { includeLowercase?: boolean; includeNumbers?: boolean; includeSymbols?: boolean; includeUppercase?: boolean; } export interface ValidatePasswordOptions { maxLength?: number; maxLengthMessage?: string; minLength?: number; minLengthMessage?: string; regex?: RegExp; requiredCharactersMessage?: string; } export interface NavigateOptions { history?: "auto" | "push" | "replace"; } export interface Navigate { (url: string | URL, options?: NavigateOptions): void; } export interface Router { pathname: string; searchParams: URLSearchParams; navigate: Navigate; } export interface Branding { appTitle?: string; appLogo?: React.ReactNode; appHomeUrl?: string; } export interface NavigationPageItem { kind?: "page"; segment?: string; title?: string; icon?: React.ReactNode; link?: string; pattern?: string; action?: React.ReactNode; children?: Navigation; permission?: Array; } export interface NavigationSubheaderItem { kind: "header"; title: string; } export interface NavigationDividerItem { kind: "divider"; } export type NavigationItem = NavigationPageItem | NavigationSubheaderItem | NavigationDividerItem; export type Navigation = NavigationItem[]; export interface LinkProps extends React.AnchorHTMLAttributes { history?: "auto" | "push" | "replace"; } export interface Breadcrumb { title: string; path: string; }