mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 04:49:15 +08:00
* @types/classnames - hide global declarations, add tslint * @types/classnames - add export as namespace as its a UMD module * @types/classnames - address CR comments
26 lines
1.0 KiB
TypeScript
26 lines
1.0 KiB
TypeScript
// Type definitions for classnames 2.2
|
|
// Project: https://github.com/JedWatson/classnames
|
|
// Definitions by: Dave Keen <http://www.keendevelopment.ch>
|
|
// Adi Dahiya <https://github.com/adidahiya>
|
|
// Jason Killian <https://github.com/JKillian>
|
|
// Sean Kelley <https://github.com/seansfkelley/>
|
|
// Michal Adamczyk <https://github.com/mradamczyk>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
type ClassValue = string | number | ClassDictionary | ClassArray | undefined | null | false;
|
|
|
|
interface ClassDictionary {
|
|
[id: string]: boolean | undefined | null;
|
|
}
|
|
|
|
// This is the only way I found to break circular references between ClassArray and ClassValue
|
|
// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
|
|
interface ClassArray extends Array<ClassValue> { } // tslint:disable-line no-empty-interface
|
|
|
|
type ClassNamesFn = (...classes: ClassValue[]) => string;
|
|
|
|
declare const classNames: ClassNamesFn;
|
|
|
|
export = classNames;
|
|
export as namespace classNames;
|