Skip to content

Commit

Permalink
chore: configure TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmaj committed Feb 5, 2024
1 parent 6979ec8 commit 4f73368
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 2 deletions.
28 changes: 28 additions & 0 deletions custom.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
declare global {
namespace JSX {
interface IntrinsicElements {
DOCUMENT: any;
PAGE: any;
TEXT: any;
VIEW: any;
}
}

interface Navigator {
readonly msSaveBlob: any;
}

const BROWSER: boolean;

interface Window {
BROWSER: boolean;
}

namespace jest {
interface Matchers<R> {
toMatchImageSnapshot(): R;
}
}
}

export {};
19 changes: 19 additions & 0 deletions global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
declare module '*.jpg' {
const src: string;
export default src;
}

declare module '*.jpeg' {
const src: string;
export default src;
}

declare module '*.png' {
const src: string;
export default src;
}

declare module '*.ttf' {
const src: string;
export default src;
}
9 changes: 7 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"esModuleInterop": true,
"isolatedModules": true,
"jsx": "preserve",
"module": "commonjs",
"module": "esnext",
"moduleResolution": "node",
"noEmit": true,
"noUncheckedIndexedAccess": true,
Expand All @@ -14,5 +14,10 @@
"strict": false,
"target": "es2019"
},
"include": ["packages/**/src/**/*"]
"include": [
"packages/**/src/**/*",
"packages/**/tests/**/*",
"custom.d.ts",
"global.d.ts"
]
}

0 comments on commit 4f73368

Please sign in to comment.