import * as C from "./configTypesRaw"; export type ValueType = C.ValueType; // prettier-ignore export type WithOutOptionals = A extends Record ? {[k in keyof A]: A[k]} : A; export type InputSpec = Record>; export type ValueSpec = WithOutOptionals; /** core spec types. These types provide the metadata for performing validations */ export type ValueSpecOf = WithOutOptionals< C.ValueSpecOf >; export type ValueSpecString = WithOutOptionals; export type ValueSpecTextarea = WithOutOptionals; export type ValueSpecNumber = WithOutOptionals; export type ValueSpecSelect = WithOutOptionals; export type ValueSpecMultiselect = WithOutOptionals; export type ValueSpecBoolean = WithOutOptionals; export type ValueSpecUnion = WithOutOptionals; export type ValueSpecFile = WithOutOptionals; export type ValueSpecObject = WithOutOptionals; export type WithStandalone = WithOutOptionals; export type SelectBase = WithOutOptionals; export type ListValueSpecType = WithOutOptionals; /** represents a spec for the values of a list */ export type ListValueSpecOf = WithOutOptionals< C.ListValueSpecOf >; /** represents a spec for a list */ export type ValueSpecList = WithOutOptionals; export type ValueSpecListOf = WithOutOptionals< C.ValueSpecListOf >; // sometimes the type checker needs just a little bit of help export function isValueSpecListOf( t: ValueSpecListOf, s: S ): t is ValueSpecListOf & { spec: ListValueSpecOf } { return t.spec.type === s; } export type ListValueSpecString = WithOutOptionals; export type ListValueSpecNumber = WithOutOptionals; export type ListValueSpecObject = WithOutOptionals; export type UniqueBy = WithOutOptionals; export type DefaultString = WithOutOptionals; export const unionSelectKey = "unionSelectKey" as const; export type UnionSelectKey = typeof unionSelectKey; export const unionValueKey = "unionValueKey" as const; export type UnionValueKey = typeof unionValueKey;