mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-26 10:21:55 +00:00
chore: incr version
This commit is contained in:
@@ -63,10 +63,16 @@ export class Config<A extends InputSpec> extends IBuilder<A> {
|
||||
static empty() {
|
||||
return new Config({});
|
||||
}
|
||||
static withValue<K extends string, B extends ValueSpec>(key: K, value: Value<B>) {
|
||||
static withValue<K extends string, B extends ValueSpec>(
|
||||
key: K,
|
||||
value: Value<B>
|
||||
) {
|
||||
return Config.empty().withValue(key, value);
|
||||
}
|
||||
static addValue<K extends string, B extends ValueSpec>(key: K, value: Value<B>) {
|
||||
static addValue<K extends string, B extends ValueSpec>(
|
||||
key: K,
|
||||
value: Value<B>
|
||||
) {
|
||||
return Config.empty().withValue(key, value);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
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
|
||||
|
||||
@@ -80,7 +80,10 @@ export class Variants<
|
||||
static empty() {
|
||||
return Variants.of({});
|
||||
}
|
||||
static withVariant<K extends string, B extends InputSpec>(key: K, value: Config<B>) {
|
||||
static withVariant<K extends string, B extends InputSpec>(
|
||||
key: K,
|
||||
value: Config<B>
|
||||
) {
|
||||
return Variants.empty().withVariant(key, value);
|
||||
}
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ export function isValueSpecListOf<S extends ListValueSpecType>(
|
||||
}
|
||||
|
||||
export interface ListValueSpecString {
|
||||
type: 'string'
|
||||
type: "string";
|
||||
pattern: string | null;
|
||||
patternDescription: string | null;
|
||||
masked: boolean; // default = false
|
||||
@@ -145,7 +145,7 @@ export interface ListValueSpecString {
|
||||
}
|
||||
|
||||
export interface ListValueSpecNumber {
|
||||
type: 'number';
|
||||
type: "number";
|
||||
/** '[0,1]' (inclusive) OR '[0,*)' (right unbounded), normal math rules */
|
||||
range: string;
|
||||
integral: boolean; // default = false
|
||||
@@ -155,7 +155,7 @@ export interface ListValueSpecNumber {
|
||||
}
|
||||
|
||||
export interface ListValueSpecObject {
|
||||
type: 'object';
|
||||
type: "object";
|
||||
/** this is a mapped type of the config object at this level, replacing the object's values with specs on those values */
|
||||
spec: InputSpec;
|
||||
/** indicates whether duplicates can be permitted in the list */
|
||||
|
||||
Reference in New Issue
Block a user