binaryconstconst binary: () => BinaryTypeBytes.
The business datatypes (commons data 0003-governance FR-002): what kind of fact an attribute holds, in terms that name no database. A tagged union, matched exhaustively; code names a code list. How a datatype is stored is for the logical and the physical layers.
binaryconstconst binary: () => BinaryTypeBytes.
BinaryTypetypeno test imports ittype BinaryType = { readonly kind: "binary" };Bytes.
booleanconstconst boolean: () => BooleanTypeTrue or false.
BooleanTypetypeno test imports ittype BooleanType = { readonly kind: "boolean" };True or false.
codeOfconstconst codeOf: <L extends AnyCodeList>(list: L) => CodeType<L>One code of a code list.
CodeTypetypeno test imports ittype CodeType<L extends AnyCodeList = AnyCodeList> = { readonly kind: "code"; readonly list: L };One code of a code list L.
Datatypetypetype Datatype =
| TextType
| IntegerType
| DecimalType
| BooleanType
| DateType
| InstantType
| IdentifierType
| CodeType
| StructuredType
| BinaryType
| VectorType;A business datatype.
dateconstconst date: () => DateTypeA calendar day.
DateTypetypeno test imports ittype DateType = { readonly kind: "date" };A calendar day.
decimalconstconst decimal: (options?: { readonly precision?: number | undefined; readonly scale?: number | undefined; }) => DecimalTypeA decimal number, with its precision and scale where they matter.
DecimalTypetypeno test imports ittype DecimalType = { readonly kind: "decimal"; readonly precision?: number; readonly scale?: number };A decimal number.
describeDatatypefunctionfunction describeDatatype(d: Datatype): stringA datatype in a few words, for a dictionary or a message; the switch fails to compile where a case is left out.
| Parameter | What it is |
|---|---|
d | the datatype |
Returns: its description
identifierconstconst identifier: () => IdentifierTypeAn identifier: a value that names a thing and has no other meaning.
IdentifierTypetypeno test imports ittype IdentifierType = { readonly kind: "identifier" };An identifier.
instantconstconst instant: () => InstantTypeA moment in time.
InstantTypetypeno test imports ittype InstantType = { readonly kind: "instant" };A moment in time.
integerconstconst integer: () => IntegerTypeA whole number.
IntegerTypetypeno test imports ittype IntegerType = { readonly kind: "integer" };A whole number.
structuredconstconst structured: () => StructuredTypeA structured document of no fixed shape.
vectorconstconst vector: (dimensions: number) => VectorTypeA vector of a number of dimensions (a whole number of at least one, which domain() checks).
VectorTypetypeno test imports ittype VectorType = { readonly kind: "vector"; readonly dimensions: number };A vector of numbers of a fixed number of dimensions: what a model makes of a text or an image, to be compared by distance.
StructuredTypetypeno test imports ittype StructuredType = { readonly kind: "structured" };A structured document.
textconstconst text: (options?: { readonly max?: number | undefined; }) => TextTypeText, with the longest it may be where that matters.
TextTypetypeno test imports ittype TextType = { readonly kind: "text"; readonly max?: number };Text.