-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbinding.d.cts
More file actions
48 lines (44 loc) · 2.65 KB
/
Copy pathbinding.d.cts
File metadata and controls
48 lines (44 loc) · 2.65 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/* auto-generated by NAPI-RS */
/* eslint-disable */
/**
* Which binding artifact the generated loader actually loaded: `'native'` for
* a native addon, otherwise the `platformArchABI` of the WASI flavor. Every
* flavor napi-rs can build is listed, because `NAPI_RS_NATIVE_LIBRARY_PATH`
* can point the loader at a WASI artifact this package does not build itself.
*/
export declare const __napiBindingTarget: 'native' | 'wasm32-wasi' | 'wasm32-wasip1'
/** 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
/** Matches children with nonzero candidate flags and returns one byte per input name. */
isIgnoredBatch(parentPath: string, names: Array<string>, directoryFlags: Uint8Array, candidateFlags: Uint8Array): Uint8Array
/** Matches up to 32 candidate-selected children and returns an ignored-entry bit mask. */
isIgnoredBatchMask(parentPath: string, names: Array<string>, directoryMask: number, candidateMask: number): number
/** Matches a single child without constructing an intermediate names array. */
isIgnoredChild(parentPath: string, name: 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
}