import { Plugin } from 'vite'; interface BaseOptions { /** * app mount element ID * @example vue:
==> app * @example react: ==> root */ rootElementId?: string; /** * Development environment whether enable. * @default false */ devEnable?: boolean; /** * If the existing style is not suitable, you can customize the css through this option */ css?: string; /** * Same as `options.css`, but imported css by file path */ cssPath?: string; /** * Loading placeholder content tip text. * @default Loading... */ tipText?: string; /** * Prevent the loading animation from flashing when the network is good. */ debounce?: number; /** * error handle config */ error?: { /** * error tip text */ tip?: string; /** * show error details */ detail?: boolean; /** * error handle callback * @param error error list * @example // error retry * const search = window.location.search const reloadNum = +search.match(/slr=(\d+)/)?.[1] || 1 if (reloadNum < 3) location.reload(true) * @returns void */ handler?: (error: string[]) => void; }; } interface Text extends BaseOptions { } interface Image extends BaseOptions { /** * Specify the file path of the image. It is recommended to use `base64` images, avoid network loading affecting rendering. */ src: string; } interface _Svg extends BaseOptions { /** * Specify the svg content */ content?: string; /** * Specify the svg file path */ path?: string; } type LoadingPlaceholderType = 'text' | 'img' | 'svg'; type Svg = _Svg & ({ content: string; } | { path: string; }); type Options = Text | Image | Svg; declare function spaLoading(type: 'text', options?: Text): Plugin; declare function spaLoading(type: 'img', options?: Image): Plugin; declare function spaLoading(type: 'svg', options?: Svg): Plugin; export { BaseOptions, Image, LoadingPlaceholderType, Options, Svg, Text, spaLoading };