@@ -38,6 +38,7 @@ import {
3838import type { GeotaggedPhotoResult } from "./geotagged-photos" ;
3939import { PHOTO_IMAGE_EXTENSIONS , isPhotoDropFileName , isPhotoFileName } from "./geotagged-photos" ;
4040import { projectedGeoJsonCrs } from "./crs-utils" ;
41+ import { nativeFileDialogFilters , type FileDialogFilter } from "./file-dialog-filters" ;
4142import { parseGpxLayer } from "./gpx" ;
4243import { isTauri } from "./is-tauri" ;
4344import { SHAPEFILE_COMPANION_EXTENSIONS , shapefileCompanionPathsFromSelection } from "./mas-build" ;
@@ -71,10 +72,7 @@ function browserSafeFileName(path: string): string {
7172 return path . split ( / [ / \\ ] / ) . pop ( ) || "project.geolibre.json" ;
7273}
7374
74- export interface FileDialogFilter {
75- name : string ;
76- extensions : string [ ] ;
77- }
75+ export type { FileDialogFilter } from "./file-dialog-filters" ;
7876
7977interface PickLocalPathOptions {
8078 accept ?: string ;
@@ -90,6 +88,7 @@ interface PickSavePathOptions {
9088
9189interface LocalDataFileOptions {
9290 filters : FileDialogFilter [ ] ;
91+ androidFilters ?: FileDialogFilter [ ] ;
9392 accept : string ;
9493 readBinary ?: boolean ;
9594 readText ?: boolean ;
@@ -2462,7 +2461,7 @@ export async function openLocalDataFileWithFallback(options: LocalDataFileOption
24622461 if ( isTauri ( ) ) {
24632462 const selected = await open ( {
24642463 multiple : false ,
2465- filters : options . filters ,
2464+ filters : nativeFileDialogFilters ( options . filters , options . androidFilters ) ,
24662465 } ) ;
24672466 if ( ! selected || typeof selected !== "string" ) return null ;
24682467 const data = options . readBinary ? toArrayBuffer ( await readFile ( selected ) ) : undefined ;
0 commit comments