diff --git a/errors.d.ts b/errors.d.ts new file mode 100644 index 000000000..ae512a53b --- /dev/null +++ b/errors.d.ts @@ -0,0 +1,12 @@ +export interface ErrorWithCode extends Error { + code: number; + description?: string; +} + +type Errors = { + [key: number]: ErrorWithCode; +}; + +const errors: Errors; + +export default errors; diff --git a/regedit.d.ts b/regedit.d.ts index 9100c89b2..18b752182 100644 --- a/regedit.d.ts +++ b/regedit.d.ts @@ -1,4 +1,5 @@ import type { Readable } from 'stream'; +import type { ErrorWithCode } from './errors'; export interface REG_SZ_Value { value: string; @@ -156,11 +157,6 @@ export type FOLDER_FOUND = 'Folder found and set'; export type FOLDER_NOT_FOUND = 'Folder not found'; export function setExternalVBSLocation(newLocation: string): FOLDER_FOUND | FOLDER_NOT_FOUND; -interface ErrorWithCode extends Error { - code: number; - description: string; -} - type ErrCallback = (err: ErrorWithCode | undefined) => void; export function createKey(keys: readonly K[], callback: ErrCallback): void;