Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaRHristov committed Nov 22, 2024
1 parent d2f26a7 commit c8fbe43
Show file tree
Hide file tree
Showing 24 changed files with 410 additions and 330 deletions.
5 changes: 1 addition & 4 deletions Source/Function/Pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ import type Interface from "../Interface/Pipe.js";
*
*/
export default (async (
...[
Plan,
{ Accomplished, Changed, Failed, Fulfilled, Passed, Read, Wrote },
]
...[Plan, { Accomplished, Changed, Failed, Fulfilled, Passed, Read, Wrote }]
) => {
for (const [_Output, _Input] of Plan.Results) {
Plan.On.Input = _Input;
Expand Down
85 changes: 57 additions & 28 deletions Target/Class/Pipe.d.ts
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>>>;
}>
>;
1 change: 1 addition & 0 deletions Target/Function/Apply.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type Interface from "../Interface/Apply.js";

/**
* @module Apply
*
Expand Down
1 change: 1 addition & 0 deletions Target/Function/By.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type Interface from "../Interface/By.js";

/**
* @module By
*
Expand Down
1 change: 1 addition & 0 deletions Target/Function/Bytes.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type Interface from "../Interface/Bytes.js";

/**
* @module Bytes
*
Expand Down
1 change: 1 addition & 0 deletions Target/Function/In.d.ts
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
*
Expand Down
28 changes: 17 additions & 11 deletions Target/Function/Merge.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,21 @@
* @module Merge
*
*/
declare const _default: <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>>>;
}>>;
declare const _default: <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>>>;
}>
>;
export default _default;
1 change: 1 addition & 0 deletions Target/Function/Not.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type Interface from "../Interface/Not.js";

/**
* @module Not
*
Expand Down
1 change: 1 addition & 0 deletions Target/Function/Pipe.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type Interface from "../Interface/Pipe.js";

/**
* @module Pipe
*
Expand Down
105 changes: 54 additions & 51 deletions Target/Interface/Action.d.ts
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>;
}
20 changes: 10 additions & 10 deletions Target/Interface/Apply.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
*
*/
export default interface Interface {
/**
* The function `Apply` takes a function `_Function` and a test value `Test`, and applies `_Function` to `Test` based
* on its type (Map, Set, Array, or other) and returns the result.
*
* @param _Function - _Function is a parameter that represents a function. It can be any type of function.
*
* @param Test - The `Test` parameter can be any value that you want to apply the function `_Function` to. It can be a single value, an array of values, a set of values, or a map of key-value pairs.
*
*/
(_Function: (Test: any) => any, Test: any): Promise<any>;
/**
* The function `Apply` takes a function `_Function` and a test value `Test`, and applies `_Function` to `Test` based
* on its type (Map, Set, Array, or other) and returns the result.
*
* @param _Function - _Function is a parameter that represents a function. It can be any type of function.
*
* @param Test - The `Test` parameter can be any value that you want to apply the function `_Function` to. It can be a single value, an array of values, a set of values, or a map of key-value pairs.
*
*/
(_Function: (Test: any) => any, Test: any): Promise<any>;
}
44 changes: 25 additions & 19 deletions Target/Interface/By.d.ts
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>;
}
Loading

0 comments on commit c8fbe43

Please sign in to comment.