From 26b10cc4c6a6051682c1ff9e2fca2b29c0fb6dae Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Mon, 20 Mar 2023 16:01:52 -0600 Subject: [PATCH] add file and update type for valueSpecListOf --- lib/types/config-types.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/types/config-types.ts b/lib/types/config-types.ts index c7cff0e..8b69d3c 100644 --- a/lib/types/config-types.ts +++ b/lib/types/config-types.ts @@ -7,6 +7,7 @@ export type ValueType = | "enum" | "list" | "object" + | "file" | "union"; export type ValueSpec = ValueSpecOf; @@ -23,6 +24,8 @@ export type ValueSpecOf = T extends "string" ? ValueSpecList : T extends "object" ? ValueSpecObject + : T extends "file" + ? ValueSpecFile : T extends "union" ? ValueSpecUnion : never; @@ -57,6 +60,13 @@ export interface ValueSpecUnion { default: string; } +export interface ValueSpecFile extends WithStandalone { + type: 'file'; + placeholder: null | string; + nullable: boolean; + extensions: string[]; +} + export interface ValueSpecObject extends WithStandalone { type: "object"; spec: InputSpec; @@ -101,11 +111,11 @@ export interface ValueSpecListOf | string[] | number[] | DefaultString[] - | object[] + | Record[] | readonly string[] | readonly number[] | readonly DefaultString[] - | readonly object[]; + | readonly Record[]; } // sometimes the type checker needs just a little bit of help