export type Errors = Record; export interface ScopedError { code: Code | 'UNKNOWN_ERROR'; scope: string; } /** * * An Error class builder. * * @example * * const errors = { * PARSE_INVALID_EXT: 'Unable to parse file "{0}". Unsupported file extension.', * PATH_REQUIRE_ABSOLUTE: 'An absolute file path is required.', * PATH_RESOLVE_LOOKUPS: 'Failed to resolve a path using the following lookups (in order):\n{0}\n', * PROJECT_NO_PACKAGE: 'No `package.json` found within project root.', * }; * * type CommonErrorCode = keyof typeof errors; * * const CommonError = createScopedError('CMN', 'CommonError', errors); * * @param scope * @param name * @param errors */ export declare function createScopedError(scope: string, name: string, errors: Errors): new (code: Code, params?: unknown[]) => Error & ScopedError;