The plugin runs all imported SVG files through svgo. For index.html, you can use the following syntax: ```html <use svg="file.svg" size="24" /> ``` For scripts, use the `?svg` import query ```javascript import SVG_FILE from './file.svg?svg&size=24 ``` Note: size is shorthand for specifying both width and height individually. You can also set any property of the base SVG element. You can also use the `?svg&icon` query to return a function that allows dynamically resizing the SVG string.
29 lines
858 B
TypeScript
29 lines
858 B
TypeScript
declare module '*?url' {
|
|
const content: string;
|
|
export default content;
|
|
}
|
|
|
|
declare module '*?blob-url' {
|
|
const urlPromise: () => Promise<string>;
|
|
export default urlPromise;
|
|
}
|
|
|
|
declare module '*?svg&icon' {
|
|
const resize: (size: number, attrs?: Record<string, string>) => string;
|
|
export default resize;
|
|
}
|
|
|
|
declare module '*?svg&icon&class=heart-icon' {
|
|
const resize: (size: number, attrs?: Record<string, string>) => string;
|
|
export default resize;
|
|
}
|
|
|
|
declare module '*?svg&icon&class=heart-icon+filled' {
|
|
const resize: (size: number, attrs?: Record<string, string>) => string;
|
|
export default resize;
|
|
}
|
|
|
|
declare module 'https://cdn.jsdelivr.net/npm/client-zip@2.4.5/+esm' {
|
|
/** Creates a ZIP stream from an async iterable of file entries. */
|
|
export function downloadZip(files: AsyncIterable<object>): Response;
|
|
}
|