Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't import ExportProgress? #1969

Closed
tobiasBora opened this issue Apr 28, 2024 · 1 comment · Fixed by #1971
Closed

Can't import ExportProgress? #1969

tobiasBora opened this issue Apr 28, 2024 · 1 comment · Fixed by #1971

Comments

@tobiasBora
Copy link
Contributor

tobiasBora commented Apr 28, 2024

(sorry, I'm not extremely familiar with typescript, so I may write something stupid here… but in any case it might be worth adding more details in the documentation if I'm doing something wrong. See also my question here)

I can't find how to import the type ExportProgress from dexie-export-import:

If I do:

  import "dexie-export-import";

  function progressCallback ({totalRows, completedRows, ...restProps} : ExportProgress) {
    console.log(`Progress: ${completedRows} of ${totalRows} rows completed`);
    return true;
  }

then I get an error:

Error: Cannot find name 'ExportProgress'. 

If I do:

  import type { ExportProgress } from "dexie-export-import";

or

  import type { ExportProgress } from "dexie-export-import";

then I get an error Error: Module '"dexie-export-import"' has no exported member 'ExportProgress'. Did you mean to use 'import ExportProgress from "dexie-export-import"' instead? (ts).

The library exports it here via:

export interface ExportProgress {
  totalTables: number;
  completedTables: number;
  totalRows: number | undefined;
  completedRows: number;
  done: boolean;
}

Any idea what I'm missing? I'm using sveltekit + vite, and I tried to change in tsconfig.json the {"compilerOptions": {"moduleResolution": "bundler"}} into:

{"compilerOptions": {"moduleResolution": "node", …}}

without success

@tobiasBora tobiasBora mentioned this issue Apr 29, 2024
@tobiasBora
Copy link
Contributor Author

Ok, seems like it was just that someone forgot to export the type, see my PR here #1971

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant