Skip to content

Commit

Permalink
add @types/wicg-file-system-access to fix build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
josxha committed Jan 6, 2025
1 parent 9208924 commit 0999651
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
8 changes: 8 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
"@types/react-icon-base": "^2.1.6",
"@types/string-hash": "^1.1.3",
"@types/uuid": "^9.0.8",
"@types/wicg-file-system-access": "^2023.10.5",
"@vitejs/plugin-react": "^4.2.1",
"cors": "^2.8.5",
"cypress": "^13.13.0",
Expand Down
10 changes: 4 additions & 6 deletions src/components/ModalExport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,14 @@ class ModalExportInternal extends React.Component<ModalExportInternalProps> {
}

async createFileHandle() : Promise<FileSystemFileHandle | null> {
const pickerOpts = {
const pickerOpts: SaveFilePickerOptions = {
types: [
{
description: "Style JSON",
accept: {"application/json": [".json"]},
suggestedName: this.exportName(),
description: "json",
accept: { "application/json": [".json"] },
},
],
excludeAcceptAllOption: true,
multiple: false,
suggestedName: this.exportName(),
};

const fileHandle = await window.showSaveFilePicker(pickerOpts) as FileSystemFileHandle;
Expand Down
7 changes: 3 additions & 4 deletions src/components/ModalOpen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,13 @@ class ModalOpenInternal extends React.Component<ModalOpenInternalProps, ModalOpe
onOpenFile = async () => {
this.clearError();

const pickerOpts = {
const pickerOpts: OpenFilePickerOptions = {
types: [
{
description: "Style JSON",
accept: {"application/json": [".json"]},
description: "json",
accept: { "application/json": [".json"] },
},
],
excludeAcceptAllOption: true,
multiple: false,
};

Expand Down
6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"types": ["geojson"],
"types": ["geojson", "@types/wicg-file-system-access"],
"module": "ESNext",
"skipLibCheck": true,

Expand All @@ -27,7 +27,7 @@
"ts-node": {
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "Node"
"moduleResolution": "Node",
}
}
}
}

0 comments on commit 0999651

Please sign in to comment.