From 08947b131ad672ad8149d72ed795b41b17ea0d29 Mon Sep 17 00:00:00 2001 From: Akshar Patel Date: Fri, 4 Dec 2015 21:04:05 +0530 Subject: [PATCH] Added parameter option interfaces for creating Objectstore and Index --- baselines/dom.generated.d.ts | 15 +++++++++++-- baselines/webworker.generated.d.ts | 15 +++++++++++-- inputfiles/addedTypes.json | 34 ++++++++++++++++++++++++++++++ inputfiles/overridingTypes.json | 16 +++++++++----- 4 files changed, 71 insertions(+), 9 deletions(-) diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index 2c3a3aba8..8caad14a0 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -6923,7 +6923,7 @@ interface IDBDatabase extends EventTarget { onerror: (ev: Event) => any; version: string; close(): void; - createObjectStore(name: string, optionalParameters?: any): IDBObjectStore; + createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore; deleteObjectStore(name: string): void; transaction(storeNames: any, mode?: string): IDBTransaction; addEventListener(type: "abort", listener: (ev: Event) => any, useCapture?: boolean): void; @@ -6952,6 +6952,7 @@ interface IDBIndex { name: string; objectStore: IDBObjectStore; unique: boolean; + multiEntry: boolean; count(key?: any): IDBRequest; get(key: any): IDBRequest; getKey(key: any): IDBRequest; @@ -6988,7 +6989,7 @@ interface IDBObjectStore { add(value: any, key?: any): IDBRequest; clear(): IDBRequest; count(key?: any): IDBRequest; - createIndex(name: string, keyPath: string | string[], optionalParameters?: any): IDBIndex; + createIndex(name: string, keyPath: string | string[], optionalParameters?: IDBIndexParameters): IDBIndex; delete(key: any): IDBRequest; deleteIndex(indexName: string): void; get(key: any): IDBRequest; @@ -12575,6 +12576,16 @@ interface XMLHttpRequestEventTarget { addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } +interface IDBObjectStoreParameters { + keyPath?: string | string[]; + autoIncrement?: boolean; +} + +interface IDBIndexParameters { + unique?: boolean; + multiEntry?: boolean; +} + interface NodeListOf extends NodeList { length: number; item(index: number): TNode; diff --git a/baselines/webworker.generated.d.ts b/baselines/webworker.generated.d.ts index a8235bf53..cb63e2758 100644 --- a/baselines/webworker.generated.d.ts +++ b/baselines/webworker.generated.d.ts @@ -311,7 +311,7 @@ interface IDBDatabase extends EventTarget { onerror: (ev: Event) => any; version: string; close(): void; - createObjectStore(name: string, optionalParameters?: any): IDBObjectStore; + createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore; deleteObjectStore(name: string): void; transaction(storeNames: any, mode?: string): IDBTransaction; addEventListener(type: "abort", listener: (ev: Event) => any, useCapture?: boolean): void; @@ -340,6 +340,7 @@ interface IDBIndex { name: string; objectStore: IDBObjectStore; unique: boolean; + multiEntry: boolean; count(key?: any): IDBRequest; get(key: any): IDBRequest; getKey(key: any): IDBRequest; @@ -376,7 +377,7 @@ interface IDBObjectStore { add(value: any, key?: any): IDBRequest; clear(): IDBRequest; count(key?: any): IDBRequest; - createIndex(name: string, keyPath: string | string[], optionalParameters?: any): IDBIndex; + createIndex(name: string, keyPath: string | string[], optionalParameters?: IDBIndexParameters): IDBIndex; delete(key: any): IDBRequest; deleteIndex(indexName: string): void; get(key: any): IDBRequest; @@ -892,6 +893,16 @@ interface WorkerUtils extends Object, WindowBase64 { setTimeout(handler: any, timeout?: any, ...args: any[]): number; } +interface IDBObjectStoreParameters { + keyPath?: string | string[]; + autoIncrement?: boolean; +} + +interface IDBIndexParameters { + unique?: boolean; + multiEntry?: boolean; +} + interface BlobPropertyBag { type?: string; endings?: string; diff --git a/inputfiles/addedTypes.json b/inputfiles/addedTypes.json index 50fe7984d..7edd74454 100644 --- a/inputfiles/addedTypes.json +++ b/inputfiles/addedTypes.json @@ -1,4 +1,38 @@ [ + { + "kind": "interface", + "name": "IDBObjectStoreParameters", + "properties": [ + { + "name": "keyPath?", + "type": "string | string[]" + }, + { + "name": "autoIncrement?", + "type": "boolean" + } + ] + }, + { + "kind": "interface", + "name": "IDBIndexParameters", + "properties": [ + { + "name": "unique?", + "type": "boolean" + }, + { + "name": "multiEntry?", + "type": "boolean" + } + ] + }, + { + "kind": "property", + "interface": "IDBIndex", + "name": "multiEntry", + "type": "boolean" + }, { "kind": "property", "interface": "Window", diff --git a/inputfiles/overridingTypes.json b/inputfiles/overridingTypes.json index 8bb85176b..7a75e01c1 100644 --- a/inputfiles/overridingTypes.json +++ b/inputfiles/overridingTypes.json @@ -3,13 +3,19 @@ "kind": "method", "interface": "IDBObjectStore", "name": "createIndex", - "signatures": ["createIndex(name: string, keyPath: string | string[], optionalParameters?: any): IDBIndex"] + "signatures": ["createIndex(name: string, keyPath: string | string[], optionalParameters?: IDBIndexParameters): IDBIndex"] }, { - "kind": "property", - "interface": "IDBIndex", - "name": "keyPath", - "type": "string | string[]" + "kind": "property", + "interface": "IDBIndex", + "name": "keyPath", + "type": "string | string[]" + }, + { + "kind": "method", + "interface": "IDBDatabase", + "name": "createObjectStore", + "signatures": ["createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore"] }, { "kind": "method",