-
-
Notifications
You must be signed in to change notification settings - Fork 149
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
Added a typescript defs file #5
Conversation
@kentcdodds looks good to me, how about to you? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once we fix the exports this'll be ready.
Thanks for considering including this @lukeed!
We'll also need to add index.d.ts
to the package.json
files
property.
Aye, I'll take care of properly distributing the types to npm – that's about all I can contribute here. As per Twitter thread, I can't really weigh in on the right/wrong/better ways for typings, so once you all come to an agreement I'll merge. I will say that multiple of my repos have been PR'd with |
I'm pretty new to TS, but from what I understand |
Ah, then I suppose the above was specific to |
Is this final form? export type ClassValue = ClassArray | ClassDictionary | string | number | null | boolean;
export interface ClassDictionary {
[id: string]: any;
}
export interface ClassArray extends Array<ClassValue> { }
declare const clsx: (...classes: ClassValue[]) => string;
export default clsx; |
Yep, I think that'll do it! |
yup, the // Note: exports === module.exports
Object.defineProperty(exports, "__esModule", { value: true }); In the case for |
Thanks for the help @marvinhagemeister! |
Thank you @marvinhagemeister, makes sense~! And thank you all, especially @maraisr, for the types. Since they are so simple & small, I'll just add them here after all. Patch incoming~ |
👏 |
Released in |
Not sure we need all the fancy things from that @types/classnames repo - but here is something nice and tight.
If you're not too keen; happy to amend this with a simple copy-paste from their one, and rename somethings.
resolves #3