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

typescript support #6

Open
ViNoS-ab opened this issue Sep 17, 2023 · 7 comments
Open

typescript support #6

ViNoS-ab opened this issue Sep 17, 2023 · 7 comments

Comments

@ViNoS-ab
Copy link

ViNoS-ab commented Sep 17, 2023

I have this type error when i use Tempus.add :
Property 'add' does not exist on type 'r'

adding // @ts-ignore does the trick but it's still good to have a type declaration

@pixply
Copy link

pixply commented Jan 4, 2024

I also get a typescript error when using this in a next.js 14 project.

Could not find a declaration file for module '@studio-freight/tempus'. '/Users/pixply/project/node_modules/@studio-freight/tempus/dist/tempus.modern.mjs' implicitly has an 'any' type.
  Try `npm i --save-dev @types/studio-freight__tempus` if it exists or add a new declaration (.d.ts) file containing `declare module '@studio-freight/tempus';`ts(7016)

adding

"types": "./dist/types/index.d.ts"

to package.json in "exports": {} would help...

https://github.com/studio-freight/tempus/blob/067bd998100e9c37be6462d3d996be742875cac7/package.json#L15-L18

@clementroche
Copy link
Member

it should be fixed in v0.0.40

@pixply
Copy link

pixply commented Jan 8, 2024

I might not get it, but for me now the types directory and the index.d.ts file a completely gone... So I still get the typescript error in Next JS. Leaving these files and just adding the mentioned line to package.js would have done the trick, I think. And also the import is now broken, since the module is gone.

import Tempus from '@studio-freight/tempus';
Cannot find module '@studio-freight/tempus' or its corresponding type declarations

@clementroche
Copy link
Member

mb @pixply, can you try v0.0.41 ?

@vhorzinek
Copy link

The same

I might not get it, but for me now the types directory and the index.d.ts file a completely gone... So I still get the typescript error in Next JS. Leaving these files and just adding the mentioned line to package.js would have done the trick, I think. And also the import is now broken, since the module is gone.

import Tempus from '@studio-freight/tempus';
Cannot find module '@studio-freight/tempus' or its corresponding type declarations

Also occurs for me, 0.0.42

@clementroche
Copy link
Member

my bad, will be fixed asap, thx

@clementroche
Copy link
Member

clementroche commented Jan 22, 2024

0.0.44 fixes it @vhorzinek

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

No branches or pull requests

4 participants