Skip to content

Commit 7ec0b97

Browse files
committed
matches.d.ts
1 parent fa69912 commit 7ec0b97

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

types/matches.d.ts

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,33 @@
1-
export type MatcherFunction = (content: string, element: HTMLElement) => boolean;
2-
export type Matcher = string | RegExp | MatcherFunction;
1+
export type MatcherFunction = (content: string, element: HTMLElement) => boolean
2+
export type Matcher = string | RegExp | MatcherFunction
33

4-
export type NormalizerFn = (text: string) => string;
4+
export type NormalizerFn = (text: string) => string
55

66
export interface MatcherOptions {
7-
exact?: boolean;
8-
/** Use normalizer with getDefaultNormalizer instead */
9-
trim?: boolean;
10-
/** Use normalizer with getDefaultNormalizer instead */
11-
collapseWhitespace?: boolean;
12-
normalizer?: NormalizerFn;
7+
exact?: boolean
8+
/** Use normalizer with getDefaultNormalizer instead */
9+
trim?: boolean
10+
/** Use normalizer with getDefaultNormalizer instead */
11+
collapseWhitespace?: boolean
12+
normalizer?: NormalizerFn
13+
/** set query suppress suggestions */
14+
suggest?: boolean
1315
}
1416

1517
export type Match = (
16-
textToMatch: string,
17-
node: HTMLElement | null,
18-
matcher: Matcher,
19-
options?: MatcherOptions,
20-
) => boolean;
18+
textToMatch: string,
19+
node: HTMLElement | null,
20+
matcher: Matcher,
21+
options?: MatcherOptions,
22+
) => boolean
2123

2224
export interface DefaultNormalizerOptions {
23-
trim?: boolean;
24-
collapseWhitespace?: boolean;
25+
trim?: boolean
26+
collapseWhitespace?: boolean
2527
}
2628

27-
export function getDefaultNormalizer(options?: DefaultNormalizerOptions): NormalizerFn;
29+
export function getDefaultNormalizer(
30+
options?: DefaultNormalizerOptions,
31+
): NormalizerFn
2832

2933
// N.B. Don't expose fuzzyMatches + matches here: they're not public API

0 commit comments

Comments
 (0)