Skip to content

Commit

Permalink
update(web-TypeScript): static files modules
Browse files Browse the repository at this point in the history
issue #105
  • Loading branch information
sabertazimi committed Aug 4, 2021
1 parent 3bbbb84 commit 7572010
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions notes/web/javascript/typescriptBasicNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,27 @@ npx eslint --init
### Globals Definition

globals.d.ts:
```json
{
"include": ["./src/**/*", "globals.d.ts", "index.d.ts"]
}
```

```ts
declare module '*.css';
// import * as foo from './some/file.css';
//=> import * as foo from './some/file.css';

declare module '*.png' {
const value: unknown;
export = value;
}
//=> import logo from './logo.png';
// <img src={logo as string} />

declare module '*.jpg' {
const value: unknown;
export = value;
}
```

```ts
Expand Down

0 comments on commit 7572010

Please sign in to comment.