diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-08-10 14:37:20 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-08-10 14:37:20 +0530 |
commit | 5f8714091aac80144be118fa6427d65222e7509c (patch) | |
tree | a897f42a894b299a78a44e8d9b96a2a9a8342d0c /packages/idb-bridge/src/util/types.ts | |
parent | 6990b3b5ec09ed5c1cc9d3eab4c5f8ad31d351ff (diff) | |
download | wallet-core-5f8714091aac80144be118fa6427d65222e7509c.tar.xz |
use API extractor for cleaner package separation
Diffstat (limited to 'packages/idb-bridge/src/util/types.ts')
-rw-r--r-- | packages/idb-bridge/src/util/types.ts | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/packages/idb-bridge/src/util/types.ts b/packages/idb-bridge/src/util/types.ts index b0142b0d8..b07f5ad00 100644 --- a/packages/idb-bridge/src/util/types.ts +++ b/packages/idb-bridge/src/util/types.ts @@ -18,16 +18,10 @@ import { BridgeIDBRequest } from "../BridgeIDBRequest"; import { BridgeIDBKeyRange } from "../BridgeIDBKeyRange"; import { BridgeIDBIndex } from "../BridgeIDBIndex"; -import { Event } from "../util/FakeEvent"; import { BridgeIDBObjectStore } from "../BridgeIDBObjectStore"; +import { Event } from "../idbtypes"; -interface EventInCallback extends Event { - target: any; - error: Error | null; -} - -export type EventCallback = (event: EventInCallback) => void; - +/** @public */ export type EventType = | "abort" | "blocked" @@ -37,39 +31,52 @@ export type EventType = | "upgradeneeded" | "versionchange"; +/** @public */ export type CursorSource = BridgeIDBIndex | BridgeIDBObjectStore; +/** @public */ export interface FakeDOMStringList extends Array<string> { contains: (value: string) => boolean; item: (i: number) => string | undefined; } +/** + * @public + */ export type BridgeIDBCursorDirection = | "next" | "nextunique" | "prev" | "prevunique"; +/** @public */ export type KeyPath = string | string[]; +/** @public */ export type Key = any; +/** @public */ export type CursorRange = Key | BridgeIDBKeyRange | undefined; +/** @public */ export type Value = any; +/** @public */ export interface Record { key: Key; value: Key | Value; // For indexes, will be Key. For object stores, will be Value. } +/** @public */ export type TransactionMode = "readonly" | "readwrite" | "versionchange"; +/** @public */ export interface BridgeIDBDatabaseInfo { name: string; version: number; } +/** @public */ export interface RequestObj { operation: () => Promise<any>; request?: BridgeIDBRequest | undefined; |