UNPKG

4.69 kBTypeScriptView Raw
1import { PluginOption } from 'vite';
2
3/**
4 * iconify icon sets, visit https://icones.js.org to preview them.
5 */
6type IconifySet = 'academicons' | 'akar-icons' | 'ant-design' | 'arcticons' | 'basil' | 'bi' | 'bpmn' | 'brandico' | 'bx' | 'bxl' | 'bxs' | 'bytesize' | 'carbon' | 'charm' | 'ci' | 'cib' | 'cif' | 'cil' | 'circle-flags' | 'circum' | 'clarity' | 'codicon' | 'covid' | 'cryptocurrency-color' | 'cryptocurrency' | 'dashicons' | 'devicon-line' | 'devicon-original' | 'devicon-plain' | 'devicon' | 'ei' | 'el' | 'emblemicons' | 'emojione-monotone' | 'emojione-v1' | 'emojione' | 'entypo-social' | 'entypo' | 'eos-icons' | 'ep' | 'et' | 'eva' | 'fa-brands' | 'fa-regular' | 'fa-solid' | 'fa' | 'fa6-brands' | 'fa6-regular' | 'fa6-solid' | 'fad' | 'fe' | 'feather' | 'file-icons' | 'flag' | 'flagpack' | 'flat-color-icons' | 'flat-ui' | 'fluent-emoji-flat' | 'fluent-emoji-high-contrast' | 'fluent-emoji' | 'fluent-mdl2' | 'fluent' | 'fontelico' | 'fontisto' | 'formkit' | 'foundation' | 'fxemoji' | 'gala' | 'game-icons' | 'geo' | 'gg' | 'gis' | 'gridicons' | 'grommet-icons' | 'guidance' | 'healthicons' | 'heroicons-outline' | 'heroicons-solid' | 'heroicons' | 'humbleicons' | 'ic' | 'icomoon-free' | 'icon-park-outline' | 'icon-park-solid' | 'icon-park-twotone' | 'icon-park' | 'iconamoon' | 'iconoir' | 'icons8' | 'il' | 'ion' | 'iwwa' | 'jam' | 'la' | 'line-md' | 'logos' | 'ls' | 'lucide' | 'majesticons' | 'maki' | 'map' | 'material-symbols-light' | 'material-symbols' | 'mdi-light' | 'mdi' | 'medical-icon' | 'memory' | 'meteocons' | 'mi' | 'mingcute' | 'mono-icons' | 'mynaui' | 'nimbus' | 'nonicons' | 'noto-v1' | 'noto' | 'octicon' | 'oi' | 'ooui' | 'openmoji' | 'pajamas' | 'pepicons-pencil' | 'pepicons-pop' | 'pepicons-print' | 'pepicons' | 'ph' | 'pixelarticons' | 'prime' | 'ps' | 'quill' | 'radix-icons' | 'raphael' | 'ri' | 'si-glyph' | 'simple-icons' | 'simple-line-icons' | 'skill-icons' | 'solar' | 'streamline-emojis' | 'streamline' | 'subway' | 'svg-spinners' | 'system-uicons' | 'tabler' | 'tdesign' | 'teenyicons' | 'topcoat' | 'twemoji' | 'typcn' | 'uil' | 'uim' | 'uis' | 'uit' | 'uiw' | 'vaadin' | 'vs' | 'vscode-icons' | 'websymbol' | 'whh' | 'wi' | 'wpf' | 'zmdi' | 'zondicons';
7/**
8 * Local icon set configuration
9 */
10interface IconifyLocal {
11 /**
12 * Iconify icon sets, visit https://icones.js.org to preview them.
13 */
14 sets: IconifySet[];
15 /**
16 * Same as Vite configuration base option. Default is "/".
17 * @default "/"
18 */
19 base?: string;
20 /**
21 * Local output directory, default is the same as Vite configuration build.outDir option
22 * @default "dist"
23 */
24 outDir?: string;
25 /**
26 * Local output path, module URLs will also be replaced with this path. Default is "npm/@iconify/json@{version}"
27 * @default "npm/@iconify/json@{version}"
28 */
29 path?: string;
30 /**
31 * Whether to copy the icon to the local device. Default is true
32 * @default true
33 */
34 copy?: boolean;
35}
36/**
37 * Iconify plugin configuration
38 */
39interface IconifyOptions {
40 /**
41 * Selector for the tag to inject IconifyProviders script after. Default is "title"
42 * @default "title"
43 */
44 selector?: string;
45 /**
46 * Icon API URLs. Default is ["https://api.iconify.design"].
47 *
48 * You can add npm cdn or custom url:
49 * * npmmirror:
50 * * https://registry.npmmirror.com/@iconify/json/{version}/files/json
51 * * https://registry.npmmirror.com/@iconify/json/latest/files/json
52 * * https://registry.npmmirror.com/@iconify/json/2.2.187/files/json
53 * * jsdelivr:
54 * * https://cdn.jsdelivr.net/npm/@iconify/json@{version}/json
55 * * https://cdn.jsdelivr.net/npm/@iconify/json/json
56 * * https://cdn.jsdelivr.net/npm/@iconify/json@2.2.187/json
57 * * unpkg:
58 * * https://unpkg.com/@iconify/json@{version}/json
59 * * https://unpkg.com/@iconify/json/json
60 * * https://unpkg.com/@iconify/json@2.2.187/json
61 * @default ["https://api.iconify.design"]
62 */
63 resources?: string[];
64 /**
65 * Local icon set configuration. Default is false
66 * @default false
67 */
68 local?: boolean | IconifySet[] | IconifyLocal;
69 /**
70 * Timeout before using next host, in milliseconds. Default is 750
71 * @default 750
72 */
73 rotate?: number;
74 /**
75 * Timeout for API query to be considered as failed, in milliseconds
76 * @default 5000
77 */
78 timeout?: number;
79}
80
81/**
82 * Iconify icon sets plugin
83 */
84declare function useIconifyPlugin(options?: IconifyOptions): PluginOption;
85
86export { type IconifyLocal, type IconifyOptions, type IconifySet, useIconifyPlugin as default, useIconifyPlugin };