-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbinding.d.cts
More file actions
33 lines (31 loc) · 1.67 KB
/
Copy pathbinding.d.cts
File metadata and controls
33 lines (31 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* auto-generated by NAPI-RS */
/* eslint-disable */
/** JavaScript-facing hierarchy for repository `.gitignore` files. */
export declare class GitIgnoreMatcher {
/** Creates an empty matcher whose sources can be added during directory traversal. */
constructor()
/** Compiles or replaces rules rooted at a repository-relative POSIX directory. */
addSource(relativeRoot: string, patterns: string): boolean
/** Returns whether one repository-relative POSIX path is ignored. */
isIgnored(relativePath: string, isDirectory: boolean): boolean
/** Matches one directory's entries in a native call and returns one byte per name. */
isIgnoredBatch(relativeParent: string, names: Array<string>, directoryFlags: Uint8Array): Uint8Array
/** Matches up to 32 entries while avoiding per-directory typed-array allocation. */
isIgnoredBatchMask(relativeParent: string, names: Array<string>, directoryMask: number): number
/** Matches a single directory entry without constructing a JavaScript array. */
isIgnoredChild(relativeParent: string, name: string, isDirectory: boolean): boolean
}
/** JavaScript-facing wrapper around the compiled Rust matcher. */
export declare class IgnoreMatcher {
/** Compiles all pattern sources once and keeps the result for repeated path checks. */
constructor(sources: Array<IgnoreSource>)
/** Returns whether a file or directory is ignored by any source. */
isIgnored(filePath: string, isDirectory: boolean): boolean
}
/** A Gitignore-compatible pattern source received from JavaScript. */
export interface IgnoreSource {
/** Directory that patterns are resolved from. */
rootPath: string
/** Newline-delimited Gitignore patterns. */
patterns: string
}