From 4db9a85d1325fb4b7cf4b24f44db6785321259bd Mon Sep 17 00:00:00 2001 From: Oleg Valter Date: Sat, 14 May 2022 00:24:27 +0300 Subject: [PATCH] 0.2.5 --- README.md | 2 +- STACKAPPS.md | 6 +++--- lib/configurer.d.ts | 4 +++- package-lock.json | 4 ++-- package.json | 2 +- spec/index.test-d.ts | 6 +++++- 6 files changed, 15 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 34b7302..9944767 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ | Name | @userscripters/global-types | | Description | Type definitions for global UserScripters objects | | License | [GPL-3.0-or-later](https://spdx.org/licenses/GPL-3.0-or-later) | -| Version | 0.2.4 | +| Version | 0.2.5 | # Support diff --git a/STACKAPPS.md b/STACKAPPS.md index f572f1d..ab25030 100644 --- a/STACKAPPS.md +++ b/STACKAPPS.md @@ -4,7 +4,7 @@ library - + @@ -22,7 +22,7 @@ The script is licensed under the [GPL-3.0-or-later](https://spdx.org/licenses/GP ### Download -Latest version: 0.2.4 +Latest version: 0.2.5 [Install](https://www.npmjs.com/package/@userscripters/global-types) @@ -38,7 +38,7 @@ Version number means "last tested on": | Version | Description | | ---------- | ----------- | -| 0.2.4 | | +| 0.2.5 | | ## Contact diff --git a/lib/configurer.d.ts b/lib/configurer.d.ts index 8402536..2f9a1bd 100644 --- a/lib/configurer.d.ts +++ b/lib/configurer.d.ts @@ -1,11 +1,13 @@ import Store, { type AsyncStorage } from "@userscripters/storage"; +export type UserscriptOptionType = "text" | "select" | "checkbox"; + export interface UserscriptOption { name: string; desc: string; def?: unknown; type: UserscriptOptionType; -}; +} export declare class Userscript extends Store { option(name: string, config: Omit): Userscript; diff --git a/package-lock.json b/package-lock.json index 8a3bbb0..55527dd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@userscripters/global-types", - "version": "0.2.4", + "version": "0.2.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@userscripters/global-types", - "version": "0.2.4", + "version": "0.2.5", "license": "GPL-3.0-or-later", "devDependencies": { "@userscripters/generate-readme": "^2.3.1", diff --git a/package.json b/package.json index f61c801..2d686b4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@userscripters/global-types", "description": "Type definitions for global UserScripters objects", - "version": "0.2.4", + "version": "0.2.5", "scripts": { "test": "tsd", "readme": "generate-readme", diff --git a/spec/index.test-d.ts b/spec/index.test-d.ts index 6e45708..aa2e345 100644 --- a/spec/index.test-d.ts +++ b/spec/index.test-d.ts @@ -10,7 +10,11 @@ const userscript = configurer?.register("test-script"); expectType | undefined>(userscript); -expectType>(userscript!.option("test-option", "Option for tsd testing", "ok")); +expectType>(userscript!.option("test-option", { + desc: "Option for tsd testing", + def: "ok", + type: "text" +})); expectType>(userscript!.load("test-option")); expectType>(userscript!.save("test-option", "not ok"));