|
1 | 1 | /* oxlint-disable trigen/import-order */ |
2 | 2 | /** |
3 | 3 | * Ambient module declarations for image imports handled by @srcset/vite-plugin. |
| 4 | + * Only the named exports are declared: the default url export |
| 5 | + * comes from the `vite/client` asset types. |
4 | 6 | * |
5 | 7 | * Usage: add to tsconfig `types` or reference directly: |
6 | 8 | * /// <reference types="@srcset/vite-plugin/client" /> |
|
9 | 11 | declare module '*.jpg' { |
10 | 12 | import type { SrcSetEntry } from '@srcset/runtime' |
11 | 13 |
|
12 | | - const url: string |
13 | | - |
14 | 14 | export const src: SrcSetEntry |
15 | 15 | export const srcSet: SrcSetEntry[] |
16 | 16 | export const srcMap: Record<string, string> |
17 | 17 | export const placeholder: string | undefined |
18 | | - export default url |
19 | 18 | } |
20 | 19 |
|
21 | 20 | declare module '*.jpeg' { |
22 | 21 | import type { SrcSetEntry } from '@srcset/runtime' |
23 | 22 |
|
24 | | - const url: string |
25 | | - |
26 | 23 | export const src: SrcSetEntry |
27 | 24 | export const srcSet: SrcSetEntry[] |
28 | 25 | export const srcMap: Record<string, string> |
29 | 26 | export const placeholder: string | undefined |
30 | | - export default url |
31 | 27 | } |
32 | 28 |
|
33 | 29 | declare module '*.png' { |
34 | 30 | import type { SrcSetEntry } from '@srcset/runtime' |
35 | 31 |
|
36 | | - const url: string |
37 | | - |
38 | 32 | export const src: SrcSetEntry |
39 | 33 | export const srcSet: SrcSetEntry[] |
40 | 34 | export const srcMap: Record<string, string> |
41 | 35 | export const placeholder: string | undefined |
42 | | - export default url |
43 | 36 | } |
44 | 37 |
|
45 | 38 | declare module '*.webp' { |
46 | 39 | import type { SrcSetEntry } from '@srcset/runtime' |
47 | 40 |
|
48 | | - const url: string |
49 | | - |
50 | 41 | export const src: SrcSetEntry |
51 | 42 | export const srcSet: SrcSetEntry[] |
52 | 43 | export const srcMap: Record<string, string> |
53 | 44 | export const placeholder: string | undefined |
54 | | - export default url |
55 | 45 | } |
56 | 46 |
|
57 | 47 | declare module '*.avif' { |
58 | 48 | import type { SrcSetEntry } from '@srcset/runtime' |
59 | 49 |
|
60 | | - const url: string |
61 | | - |
62 | 50 | export const src: SrcSetEntry |
63 | 51 | export const srcSet: SrcSetEntry[] |
64 | 52 | export const srcMap: Record<string, string> |
65 | 53 | export const placeholder: string | undefined |
66 | | - export default url |
67 | 54 | } |
68 | 55 |
|
69 | 56 | declare module '*.gif' { |
70 | 57 | import type { SrcSetEntry } from '@srcset/runtime' |
71 | 58 |
|
72 | | - const url: string |
73 | | - |
74 | 59 | export const src: SrcSetEntry |
75 | 60 | export const srcSet: SrcSetEntry[] |
76 | 61 | export const srcMap: Record<string, string> |
77 | 62 | export const placeholder: string | undefined |
78 | | - export default url |
79 | 63 | } |
0 commit comments