Skip to content

Commit

Permalink
Missing error collection types
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgoitia committed May 23, 2022
1 parent ea65389 commit b8c7ca2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
12 changes: 12 additions & 0 deletions errors.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export interface ErrorWithCode extends Error {
code: number;
description?: string;
}

type Errors = {
[key: number]: ErrorWithCode;
};

declare const errors: Errors;

export default errors;
6 changes: 1 addition & 5 deletions regedit.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Readable } from 'stream';
import type { ErrorWithCode } from './errors';

export interface REG_SZ_Value {
value: string;
Expand Down Expand Up @@ -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<K extends string>(keys: readonly K[], callback: ErrCallback): void;
Expand Down

0 comments on commit b8c7ca2

Please sign in to comment.