Open daiplusplus opened 6 years ago
I currently don't have the time to figure out how to write a proper Typescript definition file but I'd welcome a pull request. Tinysort does have thorough JSDoc declarations so it shouldn't be too hard if you know how to.
Started work on this, not sure if it's complete but got we what I needed in my app. Might be useful for someone to complete?
declare module 'tinysort' {
export interface Options {
selector?: string;
order?: 'asc' | 'desc' | 'rand';
attr?: string;
data?: string;
place?: 'start' | 'end' | 'first' | 'last' | 'org';
useVal?: boolean;
cases?: boolean;
natural?: boolean;
forceStrings?: boolean;
ignoreDashes?: boolean;
sortFunction?(el: HTMLElement): function;
useFlex?: boolean;
emptyEnd?: boolean;
console?: boolean;
}
export default function tinysort(
nodelist: string | NodeList | JQuery<HTMLElement>,
options?: Options
);
}
Would it be possible to get a TypeScript d.ts file for TinySort?