-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcustom.d.ts
More file actions
25 lines (21 loc) · 725 Bytes
/
custom.d.ts
File metadata and controls
25 lines (21 loc) · 725 Bytes
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
/**
* To use non-code assets with TypeScript, we need to defer the type for these imports.
* This requires a custom.d.ts file which signifies custom definitions for TypeScript in
* our project.
* Here we declare a new module for SVGs by specifying any import that ends in .svg
* and defining the module's content as any. We could be more explicit about it being
* a url by defining the type as string. The same concept applies to other assets
* including CSS, SCSS, JSON and more.
*/
declare module "*.svg" {
const content: any;
export default content;
}
declare module "*.jpeg" {
const content: any;
export default content;
}
declare module "*.png" {
const content: any;
export default content;
}