@alauda-fe/common
Version:
Alauda frontend team common codes.
33 lines • 1.4 kB
TypeScript
import type { AccountInfo } from '../page-scaffold/page-header/account-menu/component/component';
export interface TokenResponse {
token_storage: string;
token_type: string;
expire_at: string;
issued_at: string;
id_token?: string;
}
export declare function resetAuthRuntimeCache(): void;
export declare function getCachedAccountInfo(): AccountInfo;
export declare function setCachedAccountInfo(info: AccountInfo | null | undefined): void;
export declare function createAuthorizedFetchInit(init?: RequestInit): {
credentials: RequestCredentials;
headers: Headers;
body?: BodyInit | null;
cache?: RequestCache;
integrity?: string;
keepalive?: boolean;
method?: string;
mode?: RequestMode;
priority?: RequestPriority;
redirect?: RequestRedirect;
referrer?: string;
referrerPolicy?: ReferrerPolicy;
signal?: AbortSignal | null;
window?: null;
};
export declare function fetchTokenApi(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
export declare function fetchAuthorizedResource(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
export declare function requestTokenInfo(force?: boolean): Promise<AccountInfo>;
export declare function requestTokenRefresh(): Promise<TokenResponse>;
export declare function resolveTokenInfoWithRefresh(): Promise<AccountInfo>;
//# sourceMappingURL=runtime.d.ts.map