IF Commons GitHub

governance/datatype

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0003-governance FR-002

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.

Source: commons/data/governance/datatype.ts

13 of 24 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

binaryconst
const binary: () => BinaryType

Bytes.

Imported by 45 tests of the run (45 passed, 0 failed): the library's results

BinaryTypetypeno test imports it
type BinaryType = { readonly kind: "binary" };

Bytes.

booleanconst
const boolean: () => BooleanType

True or false.

Imported by 65 tests of the run (65 passed, 0 failed): the library's results

BooleanTypetypeno test imports it
type BooleanType = { readonly kind: "boolean" };

True or false.

codeOfconst
const codeOf: <L extends AnyCodeList>(list: L) => CodeType<L>

One code of a code list.

Imported by 62 tests of the run (62 passed, 0 failed): the library's results

CodeTypetypeno test imports it
type CodeType<L extends AnyCodeList = AnyCodeList> = { readonly kind: "code"; readonly list: L };

One code of a code list L.

Datatypetype
type Datatype =
  | TextType
  | IntegerType
  | DecimalType
  | BooleanType
  | DateType
  | InstantType
  | IdentifierType
  | CodeType
  | StructuredType
  | BinaryType
  | VectorType;

A business datatype.

Imported by 18 tests of the run (18 passed, 0 failed): the library's results

dateconst
const date: () => DateType

A calendar day.

Imported by 82 tests of the run (82 passed, 0 failed): the library's results

DateTypetypeno test imports it
type DateType = { readonly kind: "date" };

A calendar day.

decimalconst
const decimal: (options?: { readonly precision?: number | undefined; readonly scale?: number | undefined; }) => DecimalType

A decimal number, with its precision and scale where they matter.

Imported by 63 tests of the run (63 passed, 0 failed): the library's results

DecimalTypetypeno test imports it
type DecimalType = { readonly kind: "decimal"; readonly precision?: number; readonly scale?: number };

A decimal number.

describeDatatypefunction
function describeDatatype(d: Datatype): string

A datatype in a few words, for a dictionary or a message; the switch fails to compile where a case is left out.

ParameterWhat it is
dthe datatype

Returns: its description

Imported by 9 tests of the run (9 passed, 0 failed): the library's results

identifierconst
const identifier: () => IdentifierType

An identifier: a value that names a thing and has no other meaning.

Imported by 144 tests of the run (144 passed, 0 failed): the library's results

IdentifierTypetypeno test imports it
type IdentifierType = { readonly kind: "identifier" };

An identifier.

instantconst
const instant: () => InstantType

A moment in time.

Imported by 57 tests of the run (57 passed, 0 failed): the library's results

InstantTypetypeno test imports it
type InstantType = { readonly kind: "instant" };

A moment in time.

integerconst
const integer: () => IntegerType

A whole number.

Imported by 100 tests of the run (100 passed, 0 failed): the library's results

IntegerTypetypeno test imports it
type IntegerType = { readonly kind: "integer" };

A whole number.

structuredconst
const structured: () => StructuredType

A structured document of no fixed shape.

Imported by 55 tests of the run (55 passed, 0 failed): the library's results

vectorconst
const vector: (dimensions: number) => VectorType

A vector of a number of dimensions (a whole number of at least one, which domain() checks).

Imported by 20 tests of the run (20 passed, 0 failed): the library's results

VectorTypetypeno test imports it
type 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 it
type StructuredType = { readonly kind: "structured" };

A structured document.

textconst
const text: (options?: { readonly max?: number | undefined; }) => TextType

Text, with the longest it may be where that matters.

Imported by 142 tests of the run (142 passed, 0 failed): the library's results

TextTypetypeno test imports it
type TextType = { readonly kind: "text"; readonly max?: number };

Text.

Titles, headings, exports, tables, columns and requirements. Esc closes.