/
types.ts
79 lines (77 loc) · 2.08 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import type { CustomIconLoader, IconCustomizations, InlineCollection } from '@iconify/utils/lib/loader/types'
import type { Awaitable } from '@unocss/core'
import type { IconifyJSON } from '@iconify/types'
export interface IconsOptions {
/**
* Scale related to the current font size (1em).
*
* @default 1
*/
scale?: number
/**
* Mode of generated CSS icons.
*
* - `mask` - use background color and the `mask` property for monochrome icons
* - `background-img` - use background image for the icons, colors are static
* - `auto` - smartly decide mode between `mask` and `background-img` per icon based on its style
*
* @default 'auto'
* @see https://antfu.me/posts/icons-in-pure-css
*/
mode?: 'mask' | 'background-img' | 'auto'
/**
* Class prefix for matching icon rules.
*
* @default `i-`
*/
prefix?: string | string[]
/**
* Extra CSS properties applied to the generated CSS
*
* @default {}
*/
extraProperties?: Record<string, string>
/**
* Emit warning when missing icons are matched
*
* @default false
*/
warn?: boolean
/**
* In Node.js environment, the preset will search for the installed iconify dataset automatically.
* When using in the browser, this options is provided to provide dataset with custom loading mechanism.
*/
collections?: Record<string, (() => Awaitable<IconifyJSON>) | undefined | CustomIconLoader | InlineCollection>
/**
* Rule layer
*
* @default 'icons'
*/
layer?: string
/**
* Custom icon customizations.
*/
customizations?: Omit<IconCustomizations, 'additionalProps' | 'trimCustomSvg'>
/**
* Auto install icon sources package when the usages is detected
*
* **WARNING**: only on `node` environment, on `browser` this option will be ignored.
*
* @default false
*/
autoInstall?: boolean
/**
* Custom icon unit.
*
* @default `em`
*/
unit?: string
/**
* Load icons from CDN. Should starts with `https://` and ends with `/`
*
* Recommends:
* - https://esm.sh/
* - https://cdn.skypack.dev/
*/
cdn?: string
}