Forger Help

Tuples

Tuples are forged positionally: each position uses the type declared at that position, and the length is fixed by the tuple itself.

Fixed shape, mixed types

const entry = Forger.create<[string, number, boolean]>()!; // ['}$!&[0\\^<{', 295, true]

Position 0 is always a string, position 1 a number, position 2 a boolean — the values are random, the shape is not.

Any member types

Tuple members follow the same rules as standalone types — objects, unions, dates, enums, even other tuples:

const row = Forger.create<[Student, Date, 'asc' | 'desc']>()!; // [ { …full student… }, Date(…), 'desc' ]

Tuples inside other types

Tuple-typed properties and arrays of tuples work as expected:

interface Table { header: [string, string]; rows: [number, string][]; } const table = Forger.create<Table>()!; // { // header: ['…', '…'], // rows: [ [417, '…'], [295, '…'], [862, '…'] ] // }

Tuples vs arrays

Use a tuple when positions have distinct meanings ([latitude, longitude]); use an array when all elements share one type. arrayLength does not apply to tuples — their length comes from the type declaration.

08 September 2026