Skip to content

Commit 1d5fe88

Browse files
committed
Merge pull request #28 from aksharpatel47/IndexedDB_Definitions
Added Interface and Property definitions of IndexedDB Database API
2 parents 722da4f + 08947b1 commit 1d5fe88

File tree

4 files changed

+71
-9
lines changed

4 files changed

+71
-9
lines changed

baselines/dom.generated.d.ts

+13-2
Original file line numberDiff line numberDiff line change
@@ -6923,7 +6923,7 @@ interface IDBDatabase extends EventTarget {
69236923
onerror: (ev: Event) => any;
69246924
version: string;
69256925
close(): void;
6926-
createObjectStore(name: string, optionalParameters?: any): IDBObjectStore;
6926+
createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore;
69276927
deleteObjectStore(name: string): void;
69286928
transaction(storeNames: any, mode?: string): IDBTransaction;
69296929
addEventListener(type: "abort", listener: (ev: Event) => any, useCapture?: boolean): void;
@@ -6952,6 +6952,7 @@ interface IDBIndex {
69526952
name: string;
69536953
objectStore: IDBObjectStore;
69546954
unique: boolean;
6955+
multiEntry: boolean;
69556956
count(key?: any): IDBRequest;
69566957
get(key: any): IDBRequest;
69576958
getKey(key: any): IDBRequest;
@@ -6988,7 +6989,7 @@ interface IDBObjectStore {
69886989
add(value: any, key?: any): IDBRequest;
69896990
clear(): IDBRequest;
69906991
count(key?: any): IDBRequest;
6991-
createIndex(name: string, keyPath: string | string[], optionalParameters?: any): IDBIndex;
6992+
createIndex(name: string, keyPath: string | string[], optionalParameters?: IDBIndexParameters): IDBIndex;
69926993
delete(key: any): IDBRequest;
69936994
deleteIndex(indexName: string): void;
69946995
get(key: any): IDBRequest;
@@ -12575,6 +12576,16 @@ interface XMLHttpRequestEventTarget {
1257512576
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
1257612577
}
1257712578

12579+
interface IDBObjectStoreParameters {
12580+
keyPath?: string | string[];
12581+
autoIncrement?: boolean;
12582+
}
12583+
12584+
interface IDBIndexParameters {
12585+
unique?: boolean;
12586+
multiEntry?: boolean;
12587+
}
12588+
1257812589
interface NodeListOf<TNode extends Node> extends NodeList {
1257912590
length: number;
1258012591
item(index: number): TNode;

baselines/webworker.generated.d.ts

+13-2
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ interface IDBDatabase extends EventTarget {
311311
onerror: (ev: Event) => any;
312312
version: string;
313313
close(): void;
314-
createObjectStore(name: string, optionalParameters?: any): IDBObjectStore;
314+
createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore;
315315
deleteObjectStore(name: string): void;
316316
transaction(storeNames: any, mode?: string): IDBTransaction;
317317
addEventListener(type: "abort", listener: (ev: Event) => any, useCapture?: boolean): void;
@@ -340,6 +340,7 @@ interface IDBIndex {
340340
name: string;
341341
objectStore: IDBObjectStore;
342342
unique: boolean;
343+
multiEntry: boolean;
343344
count(key?: any): IDBRequest;
344345
get(key: any): IDBRequest;
345346
getKey(key: any): IDBRequest;
@@ -376,7 +377,7 @@ interface IDBObjectStore {
376377
add(value: any, key?: any): IDBRequest;
377378
clear(): IDBRequest;
378379
count(key?: any): IDBRequest;
379-
createIndex(name: string, keyPath: string | string[], optionalParameters?: any): IDBIndex;
380+
createIndex(name: string, keyPath: string | string[], optionalParameters?: IDBIndexParameters): IDBIndex;
380381
delete(key: any): IDBRequest;
381382
deleteIndex(indexName: string): void;
382383
get(key: any): IDBRequest;
@@ -892,6 +893,16 @@ interface WorkerUtils extends Object, WindowBase64 {
892893
setTimeout(handler: any, timeout?: any, ...args: any[]): number;
893894
}
894895

896+
interface IDBObjectStoreParameters {
897+
keyPath?: string | string[];
898+
autoIncrement?: boolean;
899+
}
900+
901+
interface IDBIndexParameters {
902+
unique?: boolean;
903+
multiEntry?: boolean;
904+
}
905+
895906
interface BlobPropertyBag {
896907
type?: string;
897908
endings?: string;

inputfiles/addedTypes.json

+34
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,38 @@
11
[
2+
{
3+
"kind": "interface",
4+
"name": "IDBObjectStoreParameters",
5+
"properties": [
6+
{
7+
"name": "keyPath?",
8+
"type": "string | string[]"
9+
},
10+
{
11+
"name": "autoIncrement?",
12+
"type": "boolean"
13+
}
14+
]
15+
},
16+
{
17+
"kind": "interface",
18+
"name": "IDBIndexParameters",
19+
"properties": [
20+
{
21+
"name": "unique?",
22+
"type": "boolean"
23+
},
24+
{
25+
"name": "multiEntry?",
26+
"type": "boolean"
27+
}
28+
]
29+
},
30+
{
31+
"kind": "property",
32+
"interface": "IDBIndex",
33+
"name": "multiEntry",
34+
"type": "boolean"
35+
},
236
{
337
"kind": "property",
438
"interface": "Window",

inputfiles/overridingTypes.json

+11-5
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,19 @@
33
"kind": "method",
44
"interface": "IDBObjectStore",
55
"name": "createIndex",
6-
"signatures": ["createIndex(name: string, keyPath: string | string[], optionalParameters?: any): IDBIndex"]
6+
"signatures": ["createIndex(name: string, keyPath: string | string[], optionalParameters?: IDBIndexParameters): IDBIndex"]
77
},
88
{
9-
"kind": "property",
10-
"interface": "IDBIndex",
11-
"name": "keyPath",
12-
"type": "string | string[]"
9+
"kind": "property",
10+
"interface": "IDBIndex",
11+
"name": "keyPath",
12+
"type": "string | string[]"
13+
},
14+
{
15+
"kind": "method",
16+
"interface": "IDBDatabase",
17+
"name": "createObjectStore",
18+
"signatures": ["createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore"]
1319
},
1420
{
1521
"kind": "method",

0 commit comments

Comments
 (0)