anki/ts/tsconfig.json
Hikaru Y 779ca57660
Refactor CSS/image preloading; implement custom font preloading (#2356)
* Refactor CSS preloading

- Rename css.ts to preload.ts
- Rename type/function names
- Automatically remove style/link element on load/error event

* Refactor image preloading

- Reuse template element
- Change timeout value from 100ms to 200ms, as it often takes more than
  100ms to load even a single small image on a low-spec machine
- Refactor preloadAnswerImages():
  - Use 'new Image()' instead of <link rel=preload>
  - Stop calculating images that only appear on the answer side as
    cached images are resolved immediately

* Update tsconfig.json

es2020.string -> String.matchAll()
es2018.regexp -> RegExprMatchArray.groups

* Implement custom font preloading

Font files for some languages such as Chinese and Japanese can be as
large as 20MB, so we set the timeout value to 800ms for font preloading.
2023-05-10 13:26:02 +10:00

65 lines
1.7 KiB
JSON

{
"include": [],
"exclude": [],
"references": [
{ "path": "components" },
{ "path": "congrats" },
{ "path": "deck-options" },
{ "path": "editable" },
{ "path": "editor" },
{ "path": "graphs" },
{ "path": "html-filter" },
{ "path": "reviewer" },
{ "path": "lib" },
{ "path": "mathjax" },
{ "path": "domlib" },
{ "path": "sveltelib" },
{ "path": "icons" }
],
"compilerOptions": {
"declaration": true,
"isolatedModules": true,
"composite": true,
"target": "es2019",
"module": "es2020",
"lib": [
"es2017",
"es2018.intl",
"es2018.promise",
"es2018.regexp",
"es2019.array",
"es2019.object",
"es2020.string",
"es2020.promise",
"dom",
"dom.iterable"
],
"outDir": "../out",
"rootDir": "..",
"rootDirs": [
"..",
"../out"
],
"baseUrl": ".",
"paths": {
"@tslib/*": ["lib/*", "../out/ts/lib/*"]
},
"types": [],
"verbatimModuleSyntax": true,
"strict": true,
"noImplicitAny": false,
"strictNullChecks": true,
"strictFunctionTypes": true,
"strictBindCallApply": true,
"strictPropertyInitialization": true,
"noImplicitThis": true,
"alwaysStrict": true,
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"jsx": "react",
"noEmitHelpers": true,
"importHelpers": true
}
}