forked from vbenjs/vite-plugin-svg-icons
-
Notifications
You must be signed in to change notification settings - Fork 1
/
typing.ts
38 lines (32 loc) · 806 Bytes
/
typing.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
import type FastGlob from 'fast-glob'
import type { OptimizeOptions } from 'svgo'
type OrArray<T> = T | T[]
export interface ViteSvgSpriteOptions {
/**
* icons folder, all svg files in it will be converted to svg sprite.
*/
iconDirs: OrArray<Pick<FastGlob.Options, 'cwd' | 'ignore'> | string>
/**
* svgo configuration, used to compress svg
*
* @default:true
*/
svgoOptions?: boolean | OptimizeOptions
/**
* icon format
*
* @default: [name]
*/
symbolId?: string | ((id: string) => string)
}
export interface FileStats {
relativeName: string
mtimeMs?: number
code: string
symbolId?: string
}
export type ModuleCodeOptions = {
createSymbolId: (id: string) => string
optimizeOptions: OptimizeOptions | false
fastGlobOptions: FastGlob.Options[]
}