@axa-fr/react-oidc-fetch-core
Version:
15 lines • 1.21 kB
TypeScript
import { User } from 'oidc-client';
declare type Fetch = typeof window.fetch;
export declare const fetchWithToken: (fetch: ((input: RequestInfo, init?: RequestInit) => Promise<Response>) & typeof fetch, getAccessTokenInjected: () => string) => (url: RequestInfo, options?: RequestInit) => Promise<Response>;
interface ComponentWithFetchProps {
fetch: Fetch;
user?: User | null;
}
export declare const fetchWrapper: (fetchWithTokenInjected: (fetch: ((input: RequestInfo, init?: RequestInit) => Promise<Response>) & typeof fetch, getAccessTokenInjected: () => string) => (url: RequestInfo, options?: RequestInit) => Promise<Response>) => (getAccessTokenInjected: (user: User) => () => string) => (fetch?: ((input: RequestInfo, init?: RequestInit) => Promise<Response>) & typeof fetch) => (props: ComponentWithFetchProps) => {
fetch: (url: RequestInfo, options?: RequestInit) => Promise<Response>;
};
declare const _default: (fetch?: ((input: RequestInfo, init?: RequestInit) => Promise<Response>) & typeof fetch) => (props: ComponentWithFetchProps) => {
fetch: (url: RequestInfo, options?: RequestInit) => Promise<Response>;
};
export default _default;
//# sourceMappingURL=fetchToken.d.ts.map