Cars project 3 do dokończenia
This commit is contained in:
1 parent
3b96ac1be8
commit
b3be59a011
159 files changed
+9794
-3786
No files matched your search
+19
-17
@@ -5,9 +5,10 @@
|
||||
* @module
|
||||
*/
|
||||
import { Minipass } from 'minipass';
|
||||
import { Path } from 'path-scurry';
|
||||
import { IgnoreLike } from './ignore.js';
|
||||
import { Pattern } from './pattern.js';
|
||||
import type { Form } from 'minimatch';
|
||||
import type { Path } from 'path-scurry';
|
||||
import type { IgnoreLike } from './ignore.js';
|
||||
import type { Pattern } from './pattern.js';
|
||||
import { Processor } from './processor.js';
|
||||
export interface GlobWalkerOpts {
|
||||
absolute?: boolean;
|
||||
@@ -16,7 +17,7 @@ export interface GlobWalkerOpts {
|
||||
dot?: boolean;
|
||||
dotRelative?: boolean;
|
||||
follow?: boolean;
|
||||
ignore?: string | string[] | IgnoreLike;
|
||||
ignore?: string | string[] | IgnoreLike | ReadonlyArray<string>;
|
||||
mark?: boolean;
|
||||
matchBase?: boolean;
|
||||
maxDepth?: number;
|
||||
@@ -25,6 +26,7 @@ export interface GlobWalkerOpts {
|
||||
nodir?: boolean;
|
||||
noext?: boolean;
|
||||
noglobstar?: boolean;
|
||||
normalize?: boolean | Form;
|
||||
platform?: NodeJS.Platform;
|
||||
posix?: boolean;
|
||||
realpath?: boolean;
|
||||
@@ -45,7 +47,7 @@ export type GWOFileTypesUnset = GlobWalkerOpts & {
|
||||
withFileTypes?: undefined;
|
||||
};
|
||||
export type Result<O extends GlobWalkerOpts> = O extends GWOFileTypesTrue ? Path : O extends GWOFileTypesFalse ? string : O extends GWOFileTypesUnset ? string : Path | string;
|
||||
export type Matches<O extends GlobWalkerOpts> = O extends GWOFileTypesTrue ? Set<Path> : O extends GWOFileTypesFalse ? Set<string> : O extends GWOFileTypesUnset ? Set<string> : Set<Path | string>;
|
||||
export type Matches<O extends GlobWalkerOpts> = O extends GWOFileTypesTrue ? Path[] : O extends GWOFileTypesFalse ? string[] : O extends GWOFileTypesUnset ? string[] : (Path | string)[];
|
||||
export type MatchStream<O extends GlobWalkerOpts> = Minipass<Result<O>, Result<O>>;
|
||||
/**
|
||||
* basic walking utilities that all the glob walker types use
|
||||
@@ -64,28 +66,28 @@ export declare abstract class GlobUtil<O extends GlobWalkerOpts = GlobWalkerOpts
|
||||
constructor(patterns: Pattern[], path: Path, opts: O);
|
||||
pause(): void;
|
||||
resume(): void;
|
||||
onResume(fn: () => any): void;
|
||||
matchCheck(e: Path, ifDir: boolean): Promise<Path | undefined>;
|
||||
onResume(fn: () => unknown): void;
|
||||
matchCheck(inPath: Path, ifDir: boolean): Promise<Path | undefined>;
|
||||
matchCheckTest(e: Path | undefined, ifDir: boolean): Path | undefined;
|
||||
matchCheckSync(e: Path, ifDir: boolean): Path | undefined;
|
||||
matchCheckSync(inPath: Path, ifDir: boolean): Path | undefined;
|
||||
abstract matchEmit(p: Result<O>): void;
|
||||
abstract matchEmit(p: string | Path): void;
|
||||
matchFinish(e: Path, absolute: boolean): void;
|
||||
match(e: Path, absolute: boolean, ifDir: boolean): Promise<void>;
|
||||
matchSync(e: Path, absolute: boolean, ifDir: boolean): void;
|
||||
walkCB(target: Path, patterns: Pattern[], cb: () => any): void;
|
||||
walkCB2(target: Path, patterns: Pattern[], processor: Processor, cb: () => any): any;
|
||||
walkCB3(target: Path, entries: Path[], processor: Processor, cb: () => any): void;
|
||||
walkCBSync(target: Path, patterns: Pattern[], cb: () => any): void;
|
||||
walkCB2Sync(target: Path, patterns: Pattern[], processor: Processor, cb: () => any): any;
|
||||
walkCB3Sync(target: Path, entries: Path[], processor: Processor, cb: () => any): void;
|
||||
walkCB(target: Path, patterns: Pattern[], cb: () => unknown): unknown;
|
||||
walkCB2(target: Path, patterns: Pattern[], processor: Processor, cb: () => unknown): unknown;
|
||||
walkCB3(target: Path, entries: Path[], processorx: Processor, cb: () => unknown): void;
|
||||
walkCBSync(target: Path, patterns: Pattern[], cb: () => unknown): unknown;
|
||||
walkCB2Sync(target: Path, patterns: Pattern[], processor: Processor, cb: () => unknown): unknown;
|
||||
walkCB3Sync(target: Path, entries: Path[], processor: Processor, cb: () => unknown): void;
|
||||
}
|
||||
export declare class GlobWalker<O extends GlobWalkerOpts = GlobWalkerOpts> extends GlobUtil<O> {
|
||||
matches: Set<Result<O>>;
|
||||
matches: Result<O>[];
|
||||
constructor(patterns: Pattern[], path: Path, opts: O);
|
||||
matchEmit(e: Result<O>): void;
|
||||
walk(): Promise<Set<Result<O>>>;
|
||||
walkSync(): Set<Result<O>>;
|
||||
walk(): Promise<Result<O>[]>;
|
||||
walkSync(): Result<O>[];
|
||||
}
|
||||
export declare class GlobStream<O extends GlobWalkerOpts = GlobWalkerOpts> extends GlobUtil<O> {
|
||||
results: Minipass<Result<O>, Result<O>>;
|
||||
|
||||
Reference in new issue
Block a user