Replies: 2 comments 1 reply
-
You are not explicitly typing the return something like this should work? interface IMathExtras {
randomInt: (min: number, max: number) => number
}
export const MathExtras: IMathExtras = {
randomInt(min, max) {
return 1;
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
-
You seem to really just be simulating a module here - maybe you could declare it as such? // mathExtras.ts
export const randomInt = (min: number, max: number) => {
// do something
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, i noticed that JSR now throws error for public objects of package like this:
Error says that MathExtras should have explicit type.
As I understand, I have to define type or interface and bind it to
MathExtras
contant, but I dont want to declare redundant types/interfaces.How is it proposed to declare such objects for JSR?
Beta Was this translation helpful? Give feedback.
All reactions