mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
[picomatch] Improve types to accept more accurate options. (#44276)
* [picomatch] Add basic types. * [picomatch] Fix some lint issues. * Update github link for definition author. * Add more PicomatchOptions.
This commit is contained in:
parent
c3c1d0f27d
commit
d562e5ee9f
15
types/picomatch/index.d.ts
vendored
15
types/picomatch/index.d.ts
vendored
@ -12,6 +12,10 @@ interface PicomatchOptions {
|
||||
onResult?: (result: Result) => void;
|
||||
onIgnore?: (result: Result) => void;
|
||||
onMatch?: (result: Result) => void;
|
||||
dot?: boolean;
|
||||
windows?: boolean;
|
||||
contains?: boolean;
|
||||
format?: (input: string) => string;
|
||||
}
|
||||
|
||||
type Matcher = (test: string) => boolean;
|
||||
@ -52,7 +56,7 @@ interface Picomatch {
|
||||
test(
|
||||
input: string,
|
||||
regex: RegExp,
|
||||
options: { format: any },
|
||||
options?: PicomatchOptions,
|
||||
test?: {},
|
||||
): { isMatch: boolean; match: boolean; output: any };
|
||||
|
||||
@ -66,12 +70,17 @@ interface Picomatch {
|
||||
|
||||
compileRe(
|
||||
state: ReturnType<typeof parse>,
|
||||
options?: { contains?: boolean },
|
||||
options?: PicomatchOptions,
|
||||
returnOutput?: boolean,
|
||||
returnState?: boolean,
|
||||
): RegExp;
|
||||
|
||||
makeRe(input: string, options?: {}, returnOutput?: boolean, returnState?: boolean): Picomatch['compileRe'];
|
||||
makeRe(
|
||||
input: string,
|
||||
options?: PicomatchOptions,
|
||||
returnOutput?: boolean,
|
||||
returnState?: boolean,
|
||||
): Picomatch['compileRe'];
|
||||
|
||||
toRegex(source: string | RegExp, options?: { flags?: string; nocase?: boolean; debug?: boolean }): RegExp;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user