pinecone-router / router

The extensible client-side router for Alpine.js v3
https://pinecone-example.vercel.app/
MIT License
239 stars 7 forks source link

TypeScript definitions are outdated #36

Closed vokirok closed 7 months ago

vokirok commented 7 months ago

Describe the bug It seems to me TypeScript definitions are outdated for pinecone-route v4.3.0. You can check it here: https://codesandbox.io/p/sandbox/pinecone-router-dvlkv3?file=%2Fsrc%2Fmain.ts

To Reproduce

  1. Start new project.
  2. npm i alpinejs pinecone-router
  3. Use window.PineconeRouter.settings.templateTargetId or window.PineconeRouter.context in code.
  4. npm run tsc

You will see TypeScript errors:

error TS2339: Property 'context' does not exist on type '{ version: string; name: string; viewCache: {}; settings: Settings; notfound: Route; routes: Route[]; currentContext: Context; add(path: string, options?: {} | undefined): void; remove(path: string): void; loadStart: Event; loadEnd: Event; }'.

error TS2339: Property 'templateTargetId' does not exist on type 'Settings'.

Also VSCode IntelliSense suggests currentContext and viewSelector fields which was changed in 4.0.0

rehhouari commented 7 months ago

Thanks for the report! I forgot to use build:types script. to avoid this I merged the command into the build script

rehhouari commented 7 months ago

v4.3.1 should have the updated types. Feel free to reopen if the issue isn't fixed

vokirok commented 7 months ago

Thanks a lot! Everything is fine now.