TypeScript support
maraisr opened ·
First of all love this lib! Neat. :100:
TypeScript people had `@types/classnames` - with this lib being a drop in replacement, should we fork that typings, or simply include it in this repo.
```ts declare module 'clsx' { type ClassValue = string | number | ClassDictionary | ClassArray | undefined | null | boolean;
interface ClassDictionary { [ id: string ]: any; }
interface ClassArray extends Array<ClassValue> { }
type ClassNamesFn = (...classes: ClassValue[]) => string;
type ClassNamesExport = ClassNamesFn & { default: ClassNamesFn };
const classNames: ClassNamesExport;
export = classNames; } ``` > sourced from: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/classnames/index.d.ts
Not sure if you wan't to include this in your project as a `index.d.ts` in the root.
maraisrreferenced this in feat: added a typescript defs file #47 years ago on GitHub
- LU
Hey, thank you~! 🙌
I'm not really a fan of TypeScript – so my thinking here was that the `@types/classnames` could be used instead (since usage is meant to be identical), ignoring the extra `bind/dedupe` bits, or we could fork it in the DefinitelyTyped repo & publish as its own name.
What do you think?
- MA
Yeah sure - we could fork and rename. We just can't use the same lib (@types/classnames), as it binds to a different module.
Would I be right in leaving this for you to handle?
- LU
Awesome – did not know that 😆
It's up to you. Happy to let you take it on over there. If you tag me I'll review & approve! But if you don't want to expend any additional effort, I'll add it to my list.
maraisrreferenced this in Added a typescript defs file #57 years ago on GitHub
- RO
@maraisr for reference here is a pull at rifm that I just did to add dtslint and tests. Should be a similar thing here https://github.com/istarkov/rifm/pull/40
maraisrmentioned7 years ago on GitHub
maraisrsubscribed7 years ago on GitHub
- LU
@maraisr Added types to this repo perfectly – I was just being stubborn & not wanting to be held responsible for maintaining types in the future 😇
maraisrmentioned7 years ago on GitHub
maraisrsubscribed7 years ago on GitHub