Skip to content
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

TypeScript d.ts file for TinySort? #141

Open
daiplusplus opened this issue Apr 5, 2018 · 2 comments
Open

TypeScript d.ts file for TinySort? #141

daiplusplus opened this issue Apr 5, 2018 · 2 comments

Comments

@daiplusplus
Copy link

Would it be possible to get a TypeScript d.ts file for TinySort?

@Sjeiti
Copy link
Owner

Sjeiti commented Apr 13, 2018

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.

@ChrisSargent
Copy link

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
  );
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants