import { Method, ResponseType, AxiosRequestConfig, AxiosResponse } from 'axios'; export { AxiosResponse } from 'axios'; type Page = { key: string; title: string; menuId?: number; url: string; reloadFlag: number; isNew: boolean; type: "tab" | "page" | "external"; }; type PageOption = { isNew?: boolean; query?: Record; }; type MessageNotice = { type: "success" | "warning" | "info" | "error"; title: string; message?: string; duration?: number; }; type LoadingType = "progress" | "loading" | "none"; type MessageLoading = { status: "open" | "close"; type: LoadingType; }; type MessagePage = { type: Page["type"]; url: string; title: string; option?: PageOption; }; type Token = { value: string; username: number; }; type Config = { dashboardCollapse: boolean; developmentMenuGroup: string[]; }; type Server = { name: string; title: string; url: string; logo: string; favicon: string; captcha: { type: string; config: Record; }; }; type EnvSerializeType = { server: Server; config: Config; token?: Token; }; declare class Env { readonly server: Server; config: Config; token?: Token | undefined; constructor(server: Server, config: Config, token?: Token | undefined); static createUrl(url: string, action: string): string; url(action?: string): string; header(): Record; get dashboardCollapse(): boolean; get developmentMenuGroup(): string[]; get isLogin(): boolean; get name(): string; static unSerialize(data: EnvSerializeType): Env; serialize(): EnvSerializeType; } declare const createEnv: (server: Server, config: Config, token?: Token) => Env; type ContentType = "text/html" | "text/plain" | "multipart/form-data" | "application/json" | "application/x-www-form-urlencoded" | "application/octet-stream"; interface Response { status: boolean; message: string; code: number; time: string; trackId: string; data: T; } type ResponseHandleFunc = (data: T, apiResponse: Response, response: AxiosResponse>) => void; type RequestCompleteHandleFunc = (data?: T, apiResponse?: Response, response?: AxiosResponse>) => void; type Params = Record | any[]; declare class Request$1 { protected readonly _env: Env; protected readonly _action: string; protected _method: Method; protected _body: Params; protected _params: Params; protected _data?: Params; protected _header: Record; protected _tipSuccess: boolean; protected _tipError: boolean; protected _loadingType: MessageLoading["type"]; protected _responseType: ResponseType; protected _contentType: ContentType; protected _start?: () => void; protected _fail?: () => void; protected _success?: ResponseHandleFunc; protected _error?: ResponseHandleFunc; protected _complete?: RequestCompleteHandleFunc; protected _config: AxiosRequestConfig; constructor(_env: Env, _action: string); responseType(value: ResponseType): this; loadingType(value: MessageLoading["type"]): this; contentType(value: ContentType): this; config(value: AxiosRequestConfig): this; protected getConfig(): AxiosRequestConfig; contentTypeUrlencoded(): this; contentTypeMultipart(): this; data(value: Params): this; body(value: Params): this; params(value: Params): this; header(value: Record): this; showSuccessTip(): this; hideErrorTip(): this; start(value: () => void): void; fail(value: () => void): void; success(value: ResponseHandleFunc): this; error(value: ResponseHandleFunc): this; complete(value: RequestCompleteHandleFunc): this; get(): void; post(): void; put(): void; delete(): void; protected getStartHandleFunc(): (() => void) | undefined; protected getFailHandleFunc(): (() => void) | undefined; protected getSuccessHandleFunc(): ResponseHandleFunc | undefined; protected getErrorHandleFunc(): ResponseHandleFunc | undefined; protected getCompleteHandleFunc(): RequestCompleteHandleFunc | undefined; private dataHandle; private execute; static http(env: Env, action: string, method: Method, params?: Params, body?: Params, responseType?: ResponseType, contentType?: ContentType, _headers?: Record, _config?: AxiosRequestConfig): Promise>; static syncConfig(url: string): Promise, any>>; } type LoadUser = { id: number; createTime: string; updateTime: string; username: string; lastLoginIp: string; lastLoginTime: string; status: number; }; type LoadAllUser = { id: number; username: string; }; type LoadUserGroup = { id: number; name: string; identifier: string; }; type LoadMenu = { id: number; group: string; parentId: number; name: string; url: string; icon: string; sort: number; development: boolean; }; type LoadMenuGroup = { id: number; name: string; identifier: string; }; type LoadRequest = { id: number; name: string; method: string; action: string; }; type LoadAuth = { id: number; name: string; identifier: string; }; type LoadConfig = { menuHomeId: number; authGuestUserIdentifier: string; authLoginUserIdentifier: string; userGroupAdministratorIdentifier: string; userGroupDeveloperIdentifier: string; menuGroupDirIdentifier: string; menuGroupLinkIdentifier: string; clientType: { name: string; value: string; }[]; }; type Load = { user: LoadUser; allUser: LoadAllUser[]; userGroup: LoadUserGroup[]; menu: LoadMenu[]; menuGroup: LoadMenuGroup[]; request: LoadRequest[]; auth: LoadAuth[]; config: LoadConfig; administrator: boolean; developer: boolean; }; declare const createPageByUrl: (url: string, title: string, type: Page["type"], option?: PageOption) => Page; declare const createPageByMenu: (menu: LoadMenu, type: Page["type"], option?: { menuId?: number; } & PageOption) => Page; type Type = "FeatureRefresh" | "FeatureTitle" | "DashboardContext" | "DashboardOpen" | "DashboardClose" | "DashboardNotice" | "DashboardLoading"; type Listener = (data: any) => any; type MessageElement = HTMLElement | Window; declare class Message { private readonly element; private readonly listeners; constructor(element: MessageElement); addListener(type: Type, listener: Listener): void; send(type: Type, data?: any): Promise; } declare abstract class MessageListenerAbstract { abstract notice(): (data: MessageNotice) => void; abstract loading(): (data: MessageLoading) => void; abstract open(): (data: MessagePage) => void; abstract close(): () => void; abstract context(): () => { env: EnvSerializeType; context: Load; }; } declare const createDashboardMessage: (element: HTMLElement, listener: MessageListenerAbstract) => Message; declare class Request extends Request$1 { private readonly cadmin; constructor(cadmin: CadminInterface, env: Env, action: string); protected getStartHandleFunc(): () => void; protected getFailHandleFunc(): () => void; protected getSuccessHandleFunc(): (data: T, apiResponse: Response, response: AxiosResponse>) => void; protected getErrorHandleFunc(): (data: T, apiResponse: Response, response: AxiosResponse>) => void; protected getCompleteHandleFunc(): (data?: T, apiResponse?: Response, response?: AxiosResponse>) => void; protected getConfig(): AxiosRequestConfig; } type GlobalConfig = { request?: Partial; }; interface CadminInterface { request(action: string): Request; get env(): Env; get context(): Load; get user(): LoadUser; get notice(): Notice; get message(): Message; get version(): string; get globalConfig(): GlobalConfig; loading(status: MessageLoading["status"], type: MessageLoading["type"]): void; } declare class Notice { private readonly cadmin; constructor(cadmin: CadminInterface); success(message: string, duration?: number, title?: string): void; warning(message: string, duration?: number, title?: string): void; info(message: string, duration?: number, title?: string): void; error(message: string, duration?: number, title?: string): void; private push; } declare class Cadmin implements CadminInterface { private readonly _message; private readonly _notice; private _env?; private _context?; private readonly _globalConfig; constructor(globalConfig: GlobalConfig); init(): void; request(action: string): Request; get env(): Env; get context(): Load; get user(): LoadUser; get notice(): Notice; open(data: MessagePage): void; close(): void; loading(status: MessageLoading["status"], type: MessageLoading["type"]): void; check(action: string, method: string): boolean; getUserById(id: number): LoadAllUser | undefined; get message(): Message; get version(): string; get globalConfig(): GlobalConfig; } declare const cadminLoad: (globalConfig?: GlobalConfig) => Promise; declare global { interface Window { cadmin: Cadmin; cadminLoad: typeof cadminLoad; } } export { type Config, Env, type EnvSerializeType, type Load, type LoadAllUser, type LoadAuth, type LoadConfig, type LoadMenu, type LoadMenuGroup, type LoadRequest, type LoadUser, type LoadUserGroup, Message, MessageListenerAbstract, type MessageLoading, type MessageNotice, type MessagePage, type Page, type PageOption, Request$1 as Request, type Response, type Server, type Token, cadminLoad, createDashboardMessage, createEnv, createPageByMenu, createPageByUrl };