-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d2f26a7
commit c8fbe43
Showing
24 changed files
with
410 additions
and
330 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,67 @@ | ||
import type Interface from "../Interface/Class.js"; | ||
import type Option from "../Interface/Option.js"; | ||
import type Plan from "../Interface/Plan.js"; | ||
|
||
/** | ||
* @module Pipe | ||
* | ||
*/ | ||
export default class implements Interface { | ||
In: (Path: import("../Type/Path.js").Type) => Promise<this>; | ||
By: (File: string | string[]) => Promise<this>; | ||
Not: (File: boolean | import("../Type/Exclude.js").Type | Set<import("../Type/Exclude.js").Type> | import("../Type/Exclude.js").Type[] | undefined) => Promise<this>; | ||
Pipe: (Action?: import("../Interface/Action.js").default | undefined) => Promise<this>; | ||
Plan: Plan; | ||
constructor(Cache?: Option["Cache"], Logger?: Option["Logger"]); | ||
In: (Path: import("../Type/Path.js").Type) => Promise<this>; | ||
By: (File: string | string[]) => Promise<this>; | ||
Not: ( | ||
File: | ||
| boolean | ||
| import("../Type/Exclude.js").Type | ||
| Set<import("../Type/Exclude.js").Type> | ||
| import("../Type/Exclude.js").Type[] | ||
| undefined, | ||
) => Promise<this>; | ||
Pipe: ( | ||
Action?: import("../Interface/Action.js").default | undefined, | ||
) => Promise<this>; | ||
Plan: Plan; | ||
constructor(Cache?: Option["Cache"], Logger?: Option["Logger"]); | ||
} | ||
export declare const Cache: { | ||
Search: string; | ||
Folder: string; | ||
}, Logger: 2, Action: { | ||
Read: ({ Input }: import("../Interface/File.js").default) => Promise<string>; | ||
Wrote: ({ Buffer }: import("../Interface/File.js").default) => Promise<import("../Type/Buffer.js").Type>; | ||
Passed: (On: import("../Interface/File.js").default) => Promise<true>; | ||
Failed: ({ Input }: import("../Interface/File.js").default) => Promise<string>; | ||
Accomplished: ({ Input, Output }: import("../Interface/File.js").default) => Promise<string>; | ||
Fulfilled: ({ File }: Plan) => Promise<string | false>; | ||
Changed: (Plan: Plan) => Promise<Plan>; | ||
}; | ||
export declare const Merge: <Ts extends readonly unknown[]>(...objects: Ts) => import("deepmerge-ts").DeepMergeHKT<Ts, Readonly<{ | ||
DeepMergeRecordsURI: "DeepMergeRecordsDefaultURI"; | ||
DeepMergeArraysURI: "DeepMergeArraysDefaultURI"; | ||
DeepMergeSetsURI: "DeepMergeSetsDefaultURI"; | ||
DeepMergeMapsURI: "DeepMergeMapsDefaultURI"; | ||
DeepMergeOthersURI: "DeepMergeLeafURI"; | ||
DeepMergeFilterValuesURI: "DeepMergeFilterValuesDefaultURI"; | ||
}>, Readonly<{ | ||
key: PropertyKey; | ||
parents: ReadonlyArray<Readonly<Record<PropertyKey, unknown>>>; | ||
}>>; | ||
Search: string; | ||
Folder: string; | ||
}, | ||
Logger: 2, | ||
Action: { | ||
Read: ({ | ||
Input, | ||
}: import("../Interface/File.js").default) => Promise<string>; | ||
Wrote: ({ | ||
Buffer, | ||
}: import("../Interface/File.js").default) => Promise< | ||
import("../Type/Buffer.js").Type | ||
>; | ||
Passed: (On: import("../Interface/File.js").default) => Promise<true>; | ||
Failed: ({ | ||
Input, | ||
}: import("../Interface/File.js").default) => Promise<string>; | ||
Accomplished: ({ | ||
Input, | ||
Output, | ||
}: import("../Interface/File.js").default) => Promise<string>; | ||
Fulfilled: ({ File }: Plan) => Promise<string | false>; | ||
Changed: (Plan: Plan) => Promise<Plan>; | ||
}; | ||
export declare const Merge: <Ts extends readonly unknown[]>( | ||
...objects: Ts | ||
) => import("deepmerge-ts").DeepMergeHKT< | ||
Ts, | ||
Readonly<{ | ||
DeepMergeRecordsURI: "DeepMergeRecordsDefaultURI"; | ||
DeepMergeArraysURI: "DeepMergeArraysDefaultURI"; | ||
DeepMergeSetsURI: "DeepMergeSetsDefaultURI"; | ||
DeepMergeMapsURI: "DeepMergeMapsDefaultURI"; | ||
DeepMergeOthersURI: "DeepMergeLeafURI"; | ||
DeepMergeFilterValuesURI: "DeepMergeFilterValuesDefaultURI"; | ||
}>, | ||
Readonly<{ | ||
key: PropertyKey; | ||
parents: ReadonlyArray<Readonly<Record<PropertyKey, unknown>>>; | ||
}> | ||
>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import type Interface from "../Interface/Apply.js"; | ||
|
||
/** | ||
* @module Apply | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import type Interface from "../Interface/By.js"; | ||
|
||
/** | ||
* @module By | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import type Interface from "../Interface/Bytes.js"; | ||
|
||
/** | ||
* @module Bytes | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import type Interface from "../Interface/In.js"; | ||
import type Path from "../Type/Path.js"; | ||
|
||
/** | ||
* @module In | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import type Interface from "../Interface/Not.js"; | ||
|
||
/** | ||
* @module Not | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import type Interface from "../Interface/Pipe.js"; | ||
|
||
/** | ||
* @module Pipe | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,65 @@ | ||
import type File from "../Interface/File.js"; | ||
import type Plan from "../Interface/Plan.js"; | ||
import type Buffer from "../Type/Buffer.js"; | ||
|
||
/** | ||
* @module Pipe | ||
* | ||
* Represents the execution configuration for specific actions on files. | ||
* | ||
*/ | ||
export default interface Interface { | ||
/** | ||
* Attaches a callback for the fulfillment of the Action. | ||
* | ||
* @param Plan | ||
* | ||
*/ | ||
Fulfilled?: boolean | ((Plan: Plan) => Promise<false | string>); | ||
/** | ||
* Attaches a callback for handling failures in the Action. | ||
* | ||
* @param Input The input file being processed. | ||
* | ||
* @param _Error The error encountered during execution. | ||
* | ||
*/ | ||
Failed?: boolean | ((Input: File, _Error: unknown) => Promise<false | string>); | ||
/** | ||
* Attaches a callback for actions that are accomplished. | ||
* | ||
* @param On The file on which an action was accomplished. | ||
* | ||
*/ | ||
Accomplished?: boolean | ((On: File) => Promise<false | string>); | ||
/** | ||
* Attaches a callback for actions that result in changes to the plan. | ||
* | ||
* @param Plan The execution plan to be changed. | ||
* | ||
*/ | ||
Changed?: (Plan: Plan) => Promise<Plan>; | ||
/** | ||
* Attaches a callback for actions that check if a file can pass through the pipe. | ||
* | ||
* @param On The file on which the action is being checked. | ||
* | ||
*/ | ||
Passed?: (On: File) => Promise<boolean>; | ||
/** | ||
* Attaches a callback for reading from a file. | ||
* | ||
* @param On The file to be read. | ||
* | ||
*/ | ||
Read?: (On: File) => Promise<Buffer>; | ||
/** | ||
* Attaches a callback for writing to a file. | ||
* | ||
* @param On The file to be written to. | ||
* | ||
*/ | ||
Wrote?: (On: File) => Promise<Buffer>; | ||
/** | ||
* Attaches a callback for the fulfillment of the Action. | ||
* | ||
* @param Plan | ||
* | ||
*/ | ||
Fulfilled?: boolean | ((Plan: Plan) => Promise<false | string>); | ||
/** | ||
* Attaches a callback for handling failures in the Action. | ||
* | ||
* @param Input The input file being processed. | ||
* | ||
* @param _Error The error encountered during execution. | ||
* | ||
*/ | ||
Failed?: | ||
| boolean | ||
| ((Input: File, _Error: unknown) => Promise<false | string>); | ||
/** | ||
* Attaches a callback for actions that are accomplished. | ||
* | ||
* @param On The file on which an action was accomplished. | ||
* | ||
*/ | ||
Accomplished?: boolean | ((On: File) => Promise<false | string>); | ||
/** | ||
* Attaches a callback for actions that result in changes to the plan. | ||
* | ||
* @param Plan The execution plan to be changed. | ||
* | ||
*/ | ||
Changed?: (Plan: Plan) => Promise<Plan>; | ||
/** | ||
* Attaches a callback for actions that check if a file can pass through the pipe. | ||
* | ||
* @param On The file on which the action is being checked. | ||
* | ||
*/ | ||
Passed?: (On: File) => Promise<boolean>; | ||
/** | ||
* Attaches a callback for reading from a file. | ||
* | ||
* @param On The file to be read. | ||
* | ||
*/ | ||
Read?: (On: File) => Promise<Buffer>; | ||
/** | ||
* Attaches a callback for writing to a file. | ||
* | ||
* @param On The file to be written to. | ||
* | ||
*/ | ||
Wrote?: (On: File) => Promise<Buffer>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,33 @@ | ||
import type { Pattern } from "fast-glob"; | ||
|
||
import type Plan from "../Interface/Plan.js"; | ||
|
||
/** | ||
* @module By | ||
* | ||
*/ | ||
export default interface Interface { | ||
/** | ||
* The function `By` takes in a file pattern or an array of file patterns, a set | ||
* of input and output paths, and a map of results, and returns the updated map | ||
* of results after matching the file patterns with the input paths. | ||
* | ||
* @param File - File is either a single file pattern or an array of file | ||
* patterns. These patterns are used to match files in the input directory | ||
* (`Input`) that will be processed. | ||
* | ||
* @param Paths - Paths is an array of tuples that represent the input and | ||
* output paths. | ||
* Each tuple contains two elements: the input path and the output path. | ||
* | ||
* @param Results - Map object that stores the mapping between the output file | ||
* paths and their corresponding input file paths. It is used to keep track of | ||
* the files that have been processed and their respective destinations. | ||
* | ||
*/ | ||
(File: Pattern | Pattern[], Paths: Plan["Paths"], Results: Plan["Results"]): Promise<typeof Results>; | ||
/** | ||
* The function `By` takes in a file pattern or an array of file patterns, a set | ||
* of input and output paths, and a map of results, and returns the updated map | ||
* of results after matching the file patterns with the input paths. | ||
* | ||
* @param File - File is either a single file pattern or an array of file | ||
* patterns. These patterns are used to match files in the input directory | ||
* (`Input`) that will be processed. | ||
* | ||
* @param Paths - Paths is an array of tuples that represent the input and | ||
* output paths. | ||
* Each tuple contains two elements: the input path and the output path. | ||
* | ||
* @param Results - Map object that stores the mapping between the output file | ||
* paths and their corresponding input file paths. It is used to keep track of | ||
* the files that have been processed and their respective destinations. | ||
* | ||
*/ | ||
( | ||
File: Pattern | Pattern[], | ||
Paths: Plan["Paths"], | ||
Results: Plan["Results"], | ||
): Promise<typeof Results>; | ||
} |
Oops, something went wrong.