UNPKG

libmodulor

Version:

A TypeScript library to create platform-agnostic applications

22 lines (21 loc) 525 B
import { TInt } from './TInt.js'; export class TUInt extends TInt { constructor(constraints, unit, step) { super(constraints, unit, step); if (constraints?.min !== undefined && constraints.min < 0) { throw new Error('The constraints of TUInt must be of type UInt. Got min < 0'); } } tName() { return 'UInt'; } example() { return 1; } min() { return this.constraints?.min ?? 0; } protobufType() { return 'uint32'; } }