Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use error keys insted of values for typescript #1115

Merged
merged 1 commit into from
Sep 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/errors/errors.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
DexieError,
DexieErrorConstructor,
DexieErrors,
ModifyError,
ModifyErrorConstructor,
BulkError,
Expand All @@ -17,6 +18,6 @@ export declare const exceptions : ExceptionAliasSet & {
Type: ErrorConstructor,
Range: ErrorConstructor
};
export declare const errnames : {[P in keyof ExceptionSet]: P};
export declare const errnames : DexieErrors;
export declare const fullNameExceptions : ExceptionSet;
export declare function mapError (domError, message?) : DexieError;
4 changes: 2 additions & 2 deletions src/public/types/dexie-constructor.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Transaction } from "./transaction";
import { ThenShortcut } from "./then-shortcut";
import { TableSchema } from "./table-schema";
import { IndexSpec } from "./index-spec";
import { DexieExceptionClasses } from "./errors";
import { DexieExceptionClasses, DexieErrors } from "./errors";
import { PromiseExtendedConstructor } from "./promise-extended";
import { DexieEventSet } from "./dexie-event-set";
import { DexieDOMDependencies } from "./dexie-dom-dependencies";
Expand Down Expand Up @@ -50,5 +50,5 @@ export interface DexieConstructor extends DexieExceptionClasses {
//IndexSpec: {new():IndexSpec}; //? Deprecate
Events: (ctx?: any)=>DexieEventSet;

errnames: {[P in keyof DexieExceptionClasses]: P};
errnames: DexieErrors;
}