This commit is contained in:
BluJ
2023-03-27 17:07:17 -06:00
parent ce0170b808
commit 72c9e5fd26
10 changed files with 73 additions and 62 deletions

View File

@@ -7,6 +7,7 @@ import {
ValueSpecList,
ValueSpecListOf,
} from "../config-types";
import { guardAll, typeFromProps } from "../../util";
/**
* Used as a subtype of Value.list
@@ -39,7 +40,7 @@ export class List<A extends ValueSpecList> extends IBuilder<A> {
default: string[];
range: string;
spec: {
masked: boolean | null;
masked: boolean;
placeholder: string | null;
pattern: string | null;
patternDescription: string | null;
@@ -51,7 +52,7 @@ export class List<A extends ValueSpecList> extends IBuilder<A> {
type: "list" as const,
subtype: "string" as const,
...a,
} as ValueSpecListOf<"string">);
});
}
static number<
A extends {
@@ -143,4 +144,8 @@ export class List<A extends ValueSpecList> extends IBuilder<A> {
...value,
});
}
public validator() {
return guardAll(this.a);
}
}