diff --git a/index.d.ts b/index.d.ts index 3c1c9cc..7587c9f 100644 --- a/index.d.ts +++ b/index.d.ts @@ -5,6 +5,8 @@ declare type VMScriptRunAt = 'document-start' | 'document-body' | 'document-end' /** Injection mode of a script. */ declare type VMScriptInjectInto = 'auto' | 'page' | 'content'; +declare type GenericObject = Record; + declare interface VMScriptGMInfoPlatform { arch: 'arm' | 'arm64' | 'x86-32' | 'x86-64' | 'mips' | 'mips64'; /** @alias browserBrand @@ -93,10 +95,14 @@ declare function GM_log(...args: any): void; /** Retrieves a value for current script from storage. */ declare function GM_getValue(name: string, defaultValue?: T): T; +declare function GM_getValues(names: string[]): GenericObject; +declare function GM_getValues(namesWithDefaults: GenericObject): GenericObject; /** Sets a key / value pair for current script to storage. */ declare function GM_setValue(name: string, value: T): void; +declare function GM_setValues(values: GenericObject): void; /** Deletes an existing key / value pair for current script from storage. */ declare function GM_deleteValue(name: string): void; +declare function GM_deleteValues(names: string[]): void; /** Returns an array of keys of all available values within this script. */ declare function GM_listValues(): string[]; @@ -438,12 +444,17 @@ declare interface VMScriptGMObjectVMExtensions { addElement: typeof GM_addElement; addStyle: typeof GM_addStyle; addValueChangeListener: typeof GM_addValueChangeListener; + deleteValues: (names: string[]) => Promise; download: ((options: VMScriptGMDownloadOptions) => (Promise | void)) | ((url: string, name: string) => (Promise | void)); getResourceText: typeof GM_getResourceText; + getValues: + ((names: string[]) => Promise) | + ((namesWithDefaults: GenericObject) => Promise); log: typeof GM_log; removeValueChangeListener: typeof GM_removeValueChangeListener; + setValues: (values: GenericObject) => Promise; unregisterMenuCommand: typeof GM_unregisterMenuCommand; } diff --git a/package.json b/package.json index 8591011..b4707d9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@violentmonkey/types", - "version": "0.1.7", + "version": "0.1.8", "description": "Type declaration for GM functions in Violentmonkey", "author": "Gerald ", "main": "index.js",