@omnia/fx
Version:
Provide Omnia Fx typings and tooling for clientside Omnia development.
24 lines (23 loc) • 810 B
TypeScript
export type BringMethods = "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
export type BringCacheOptions = "no-cache" | "reload" | "force-cache" | "only-if-cached";
export type BringCredentials = "include" | "omit" | "same-origin";
export interface BringInterceptOptions {
beforeRequest?: (request: BringConfig) => BringConfig;
afterRequest?: <T>(response: BringResponse<T>, request: BringConfig) => BringResponse<T>;
}
export interface BringConfig {
baseUrl?: string;
headers?: {
[key: string]: string;
};
cache?: BringCacheOptions;
interceptors?: BringInterceptOptions;
abortable?: boolean;
credentials?: BringCredentials;
}
export interface BringResponse<TData> {
data?: TData;
status: Number;
statusText: String;
ok: Boolean;
}