add @types/wicg-file-system-access to fix build errors

- https://stackoverflow.com/a/71343465/9439899
- https://github.com/WICG/file-system-access
This commit is contained in:
Joscha
2025-01-06 19:26:36 +01:00
parent 9208924ffe
commit 09996516de
5 changed files with 19 additions and 13 deletions
+8
View File
@@ -94,6 +94,7 @@
"@types/react-icon-base": "^2.1.6", "@types/react-icon-base": "^2.1.6",
"@types/string-hash": "^1.1.3", "@types/string-hash": "^1.1.3",
"@types/uuid": "^9.0.8", "@types/uuid": "^9.0.8",
"@types/wicg-file-system-access": "^2023.10.5",
"@vitejs/plugin-react": "^4.2.1", "@vitejs/plugin-react": "^4.2.1",
"cors": "^2.8.5", "cors": "^2.8.5",
"cypress": "^13.13.0", "cypress": "^13.13.0",
@@ -2395,6 +2396,13 @@
"integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==", "integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==",
"dev": true "dev": true
}, },
"node_modules/@types/wicg-file-system-access": {
"version": "2023.10.5",
"resolved": "https://registry.npmjs.org/@types/wicg-file-system-access/-/wicg-file-system-access-2023.10.5.tgz",
"integrity": "sha512-e9kZO9kCdLqT2h9Tw38oGv9UNzBBWaR1MzuAavxPcsV/7FJ3tWbU6RI3uB+yKIDPGLkGVbplS52ub0AcRLvrhA==",
"dev": true,
"license": "MIT"
},
"node_modules/@types/yauzl": { "node_modules/@types/yauzl": {
"version": "2.10.3", "version": "2.10.3",
"resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz", "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz",
+1
View File
@@ -125,6 +125,7 @@
"@types/react-icon-base": "^2.1.6", "@types/react-icon-base": "^2.1.6",
"@types/string-hash": "^1.1.3", "@types/string-hash": "^1.1.3",
"@types/uuid": "^9.0.8", "@types/uuid": "^9.0.8",
"@types/wicg-file-system-access": "^2023.10.5",
"@vitejs/plugin-react": "^4.2.1", "@vitejs/plugin-react": "^4.2.1",
"cors": "^2.8.5", "cors": "^2.8.5",
"cypress": "^13.13.0", "cypress": "^13.13.0",
+4 -6
View File
@@ -113,16 +113,14 @@ class ModalExportInternal extends React.Component<ModalExportInternalProps> {
} }
async createFileHandle() : Promise<FileSystemFileHandle | null> { async createFileHandle() : Promise<FileSystemFileHandle | null> {
const pickerOpts = { const pickerOpts: SaveFilePickerOptions = {
types: [ types: [
{ {
description: "Style JSON", description: "json",
accept: {"application/json": [".json"]}, accept: { "application/json": [".json"] },
suggestedName: this.exportName(),
}, },
], ],
excludeAcceptAllOption: true, suggestedName: this.exportName(),
multiple: false,
}; };
const fileHandle = await window.showSaveFilePicker(pickerOpts) as FileSystemFileHandle; const fileHandle = await window.showSaveFilePicker(pickerOpts) as FileSystemFileHandle;
+3 -4
View File
@@ -138,14 +138,13 @@ class ModalOpenInternal extends React.Component<ModalOpenInternalProps, ModalOpe
onOpenFile = async () => { onOpenFile = async () => {
this.clearError(); this.clearError();
const pickerOpts = { const pickerOpts: OpenFilePickerOptions = {
types: [ types: [
{ {
description: "Style JSON", description: "json",
accept: {"application/json": [".json"]}, accept: { "application/json": [".json"] },
}, },
], ],
excludeAcceptAllOption: true,
multiple: false, multiple: false,
}; };
+3 -3
View File
@@ -3,7 +3,7 @@
"target": "ES2020", "target": "ES2020",
"useDefineForClassFields": true, "useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"], "lib": ["ES2020", "DOM", "DOM.Iterable"],
"types": ["geojson"], "types": ["geojson", "@types/wicg-file-system-access"],
"module": "ESNext", "module": "ESNext",
"skipLibCheck": true, "skipLibCheck": true,
@@ -27,7 +27,7 @@
"ts-node": { "ts-node": {
"compilerOptions": { "compilerOptions": {
"module": "ESNext", "module": "ESNext",
"moduleResolution": "Node" "moduleResolution": "Node",
} }
} }
} }