BaseHandler

Represents a base handler class.

Signature

export declare class BaseHandler

Properties

filter: (path: string) => boolean;

Filters a file path.

Parameters
path
The path to filter.
Returns

`true` if the path passes the filter, otherwise `false`.

Methods

protected getFiles(dir: string): Promise<string[]>;

Recursively retrieves all files in a directory.

Parameters
dir
The directory path.
Returns

A Promise that resolves to an array of file paths.

protected loadFiles<T extends NonNullable<unknown>>(paths: string[]): Promise<T[]>;

Loads files from given paths.

Parameters
paths
The paths of the files to load.
Returns

A Promise that resolves to an array of loaded files.

protected loadFilesK<T>(paths: string[]): Promise<{    name: string;    file: T;    path: string;}[]>;

Loads files from given paths along with additional information.

Parameters
paths
The paths of the files to load.
Returns

A Promise that resolves to an array of objects containing name, file, and path.