From 0f79f71dd2f0a47c616cbfa0c63474355e50fded Mon Sep 17 00:00:00 2001 From: BluJ Date: Mon, 3 Apr 2023 13:05:15 -0600 Subject: [PATCH] chore: remove the subtype, and remove inputtype from number --- lib/config/builder/index.test.ts | 6 ------ lib/config/builder/list.ts | 11 +---------- lib/config/config-types.ts | 9 ++------- 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/lib/config/builder/index.test.ts b/lib/config/builder/index.test.ts index bebc368..3f034bc 100644 --- a/lib/config/builder/index.test.ts +++ b/lib/config/builder/index.test.ts @@ -4,12 +4,6 @@ import { List } from "./list"; import { Value } from "./value"; import { Variants } from "./variants"; -describe("test", () => { - test("test", () => { - expect(true).toEqual(true); - }); -}); - describe("builder tests", () => { test("String", () => { const bitcoinPropertiesBuilt: { diff --git a/lib/config/builder/list.ts b/lib/config/builder/list.ts index fb743d8..8b1326f 100644 --- a/lib/config/builder/list.ts +++ b/lib/config/builder/list.ts @@ -1,12 +1,6 @@ import { BuilderExtract, IBuilder } from "./builder"; import { Config } from "./config"; -import { - InputSpec, - ListValueSpecNumber, - ListValueSpecString, - UniqueBy, - ValueSpecList, -} from "../config-types"; +import { InputSpec, ListValueSpecNumber, ListValueSpecString, UniqueBy, ValueSpecList } from "../config-types"; import { guardAll } from "../../util"; /** * Used as a subtype of Value.list @@ -77,8 +71,6 @@ export class List extends IBuilder { range?: string; units?: string | null; placeholder?: string | null; - /** Default = 'numeric */ - inputmode?: "numeric" | "decimal"; } ) { const spec = { @@ -86,7 +78,6 @@ export class List extends IBuilder { placeholder: null, range: "(*,*)", units: null, - inputmode: "numeric" as const, ...aSpec, }; return new List({ diff --git a/lib/config/config-types.ts b/lib/config/config-types.ts index 8c6ded7..1103f34 100644 --- a/lib/config/config-types.ts +++ b/lib/config/config-types.ts @@ -111,8 +111,7 @@ export type ListValueSpecOf = T extends "string" /** represents a spec for a list */ export type ValueSpecList = ValueSpecListOf; -export interface ValueSpecListOf - extends WithStandalone { +export interface ValueSpecListOf extends WithStandalone { type: "list"; spec: ListValueSpecOf; range: string; // '[0,1]' (inclusive) OR '[0,*)' (right unbounded), normal math rules @@ -128,10 +127,7 @@ export interface ValueSpecListOf } // sometimes the type checker needs just a little bit of help -export function isValueSpecListOf( - t: ValueSpecList, - s: S -): t is ValueSpecListOf { +export function isValueSpecListOf(t: ValueSpecList, s: S): t is ValueSpecListOf { return t.spec.type === s; } @@ -150,7 +146,6 @@ export interface ListValueSpecNumber { range: string; integral: boolean; // default = false units: string | null; - inputmode: "numeric" | "decimal"; // default = 'decimal' placeholder: string | null; }