UNPKG

armisa-models

Version:
34 lines (33 loc) 1.67 kB
import { AxiosInstance, AxiosRequestConfig, RawAxiosRequestHeaders } from "axios"; import { MainStateManager } from "../../../MainStateManager"; import { UserInfo } from "../UserInfo/UserInfo"; import { ATTACHFILE, PATH, Paths, SAVE } from "amisa-paths"; type ICustomHeader = { fiscalYear: number; }; export declare class TokenInfo { #private; mainStateManager: MainStateManager; signOut: () => void; constructor(mainStateManager: MainStateManager); get userInfo(): UserInfo; get key(): string; get tokenFromLocalStorage(): boolean; get token(): string | undefined; removeLocalStorageToken: () => void; get headerOfAxios(): AxiosRequestConfig<any>; createAxios: (controllerPath: string, customHeaders?: ICustomHeader) => AxiosInstance; } export interface IHeaderOfAxios extends RawAxiosRequestHeaders { Authorization?: string; "content-type": string; Accept: string; } export declare const useHeader: () => AxiosRequestConfig<any>; export declare const useTokenInfo: () => TokenInfo; export declare const useUrls: <SECTION extends keyof Paths, P extends Paths[SECTION], CONTROLLER extends keyof P>(section: SECTION, controller: CONTROLLER) => P[CONTROLLER]; export declare const useAxios: (paths: PATH, customHeaders?: ICustomHeader) => AxiosInstance; export declare const getTempRowsAxios: (paths: SAVE, customHeaders?: ICustomHeader) => AxiosInstance | undefined; export declare const getHistoryAxios: (customHeaders?: ICustomHeader) => AxiosInstance; export declare const getAttachesAxios: (urls: ATTACHFILE, customHeaders?: ICustomHeader) => AxiosInstance; export {};