Skip to content

Commit a4f7e34

Browse files
committed
isolatedDeclarations
1 parent 46793ab commit a4f7e34

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

lib/src/lib/databases/exceptions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const IDB_BROKEN_ERROR = "indexedDB is not working";
77
* Exception raised when `indexedDB` is not working
88
*/
99
export class IDBBrokenError extends Error {
10-
override message = IDB_BROKEN_ERROR;
10+
override message: string = IDB_BROKEN_ERROR;
1111
}
1212

1313
/**
@@ -20,5 +20,5 @@ where data must be serialized, and the provided data can't be serialized.`;
2020
* Exception throwned when a value cannot be serialized for `localStorage`
2121
*/
2222
export class SerializationError extends Error {
23-
override message = SERIALIZATION_ERROR;
23+
override message: string = SERIALIZATION_ERROR;
2424
}

lib/src/lib/storages/exceptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ Check your JSON schema, otherwise it means data has been corrupted.`;
88
* Exception throwned when a value is not valid against the JSON schema
99
*/
1010
export class ValidationError extends Error {
11-
override message = VALIDATION_ERROR;
11+
override message: string = VALIDATION_ERROR;
1212
}

lib/src/lib/tokens.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { InjectionToken } from "@angular/core";
33
/**
44
* Token to provide a prefix to `localStorage` keys.
55
*/
6-
export const LS_PREFIX = new InjectionToken<string>("localStoragePrefix", {
6+
export const LS_PREFIX: InjectionToken<string> = new InjectionToken<string>("localStoragePrefix", {
77
providedIn: "root",
88
factory: (): string => ""
99
});
@@ -16,7 +16,7 @@ export const DEFAULT_IDB_DB_NAME = "ngStorage";
1616
/**
1717
* Token to provide `indexedDB` database name.
1818
*/
19-
export const IDB_DB_NAME = new InjectionToken<string>("localStorageIDBDBName", {
19+
export const IDB_DB_NAME: InjectionToken<string> = new InjectionToken<string>("localStorageIDBDBName", {
2020
providedIn: "root",
2121
factory: (): string => DEFAULT_IDB_DB_NAME
2222
});
@@ -30,7 +30,7 @@ export const DEFAULT_IDB_DB_VERSION = 1;
3030
* Token to provide `indexedDB` database version.
3131
* Must be an unsigned **integer**.
3232
*/
33-
export const IDB_DB_VERSION = new InjectionToken<number>("localStorageIDBDBVersion", {
33+
export const IDB_DB_VERSION: InjectionToken<number> = new InjectionToken<number>("localStorageIDBDBVersion", {
3434
providedIn: "root",
3535
factory: (): number => DEFAULT_IDB_DB_VERSION
3636
});
@@ -44,7 +44,7 @@ export const DEFAULT_IDB_STORE_NAME = "localStorage";
4444
* Token to provide `indexedDB` store name.
4545
* For backward compatibility, the default can't be set now, `IndexedDBDatabase` will do it at runtime.
4646
*/
47-
export const IDB_STORE_NAME = new InjectionToken<string>("localStorageIDBStoreName", {
47+
export const IDB_STORE_NAME: InjectionToken<string> = new InjectionToken<string>("localStorageIDBStoreName", {
4848
providedIn: "root",
4949
factory: (): string => DEFAULT_IDB_STORE_NAME
5050
});
@@ -61,7 +61,7 @@ export const DEFAULT_IDB_NO_WRAP = true;
6161
* Defaults to `true`. Change to `false` for backward compatiblity in existing applications.
6262
* **DO NOT CHANGE THIS BEHAVIOR ONCE IN PRODUCTION**, as it would break with existing data.
6363
*/
64-
export const IDB_NO_WRAP = new InjectionToken<boolean>("localStorageIDBWrap", {
64+
export const IDB_NO_WRAP: InjectionToken<boolean> = new InjectionToken<boolean>("localStorageIDBWrap", {
6565
providedIn: "root",
6666
factory: (): boolean => DEFAULT_IDB_NO_WRAP
6767
});

lib/tsconfig.lib.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"compilerOptions": {
44
"outDir": "../out-tsc/lib",
55
"declaration": true,
6+
"isolatedDeclarations": true,
67
"declarationMap": true,
78
"inlineSources": true,
89
"types": []

0 commit comments

Comments
 (0)