Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Typecript typings #21

Open
G-Rath opened this issue May 16, 2019 · 1 comment · May be fixed by #30
Open

Typecript typings #21

G-Rath opened this issue May 16, 2019 · 1 comment · May be fixed by #30

Comments

@G-Rath
Copy link

G-Rath commented May 16, 2019

I would love to use this library with TypeScript, but there don't seem to be any typings :(

@hydrosquall
Copy link

hydrosquall commented Aug 14, 2021

I started a typings file that I didn't end up needing, so I"ll share it here. Hopefully it can help someone to get started / or you can just import this into your project directly.

// nanomatch.typings.d.ts
declare module 'nanomatch' {

  interface MatchOptions {
    basename?: boolean;
    bash?: boolean;
    cache?: boolean;
    dot?: boolean;
    failglob?: boolean;
    ignore?: string | string[];
    matchBase?: boolean;
    nocase?: boolean;
    nodupes?: boolean;
    nonegate?: boolean;
    noglobstar?: boolean;
    nonull?: boolean;
    nullglob?: boolean;
    slash?: string | (() => string);
    star?: string | (() => string);
    /* https://github.com/jonschlinkert/snapdragon */
    snapdragon?: object; // a snapdragon instance:
    sourcemap?: boolean;
    unescape?: boolean;
    unixify?: boolean;
  }

  export const isMatch: (string: string, pattern: string, options?: MatchOptions) => boolean;
}

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants