diff --git a/examples/quickstart/client/src/module_bindings/message.ts b/examples/quickstart/client/src/module_bindings/message.ts index 7791a4f..3cce384 100644 --- a/examples/quickstart/client/src/module_bindings/message.ts +++ b/examples/quickstart/client/src/module_bindings/message.ts @@ -23,10 +23,10 @@ export class Message extends DatabaseTable { public static db: ClientDB = __SPACETIMEDB__.clientDB; public static tableName = "Message"; public sender: Identity; - public sent: BigInt; + public sent: bigint; public text: string; - constructor(sender: Identity, sent: BigInt, text: string) { + constructor(sender: Identity, sent: bigint, text: string) { super(); this.sender = sender; this.sent = sent; diff --git a/src/algebraic_value.ts b/src/algebraic_value.ts index cd2cb99..7694a64 100644 --- a/src/algebraic_value.ts +++ b/src/algebraic_value.ts @@ -63,10 +63,10 @@ export interface ValueAdapter { readU16: () => number; readI32: () => number; readU32: () => number; - readI64: () => BigInt; - readU64: () => BigInt; - readU128: () => BigInt; - readI128: () => BigInt; + readI64: () => bigint; + readU64: () => bigint; + readU128: () => bigint; + readI128: () => bigint; readF32: () => number; readF64: () => number; @@ -161,16 +161,16 @@ export class BinaryAdapter implements ValueAdapter { readU32(): number { return this.reader.readU32(); } - readI64(): BigInt { + readI64(): bigint { return this.reader.readI64(); } - readU64(): BigInt { + readU64(): bigint { return this.reader.readU64(); } - readU128(): BigInt { + readU128(): bigint { return this.reader.readU128(); } - readI128(): BigInt { + readI128(): bigint { return this.reader.readI128(); } readF32(): number { @@ -281,16 +281,16 @@ export class JSONAdapter implements ValueAdapter { readU32(): number { return this.value; } - readI64(): BigInt { + readI64(): bigint { return this.value; } - readU64(): BigInt { + readU64(): bigint { return this.value; } - readU128(): BigInt { + readU128(): bigint { return this.value; } - readI128(): BigInt { + readI128(): bigint { return this.value; } readF32(): number { @@ -305,10 +305,10 @@ export class JSONAdapter implements ValueAdapter { export class SumValue { /** A tag representing the choice of one variant of the sum type's variants. */ public tag: number; - /** - * Given a variant `Var(Ty)` in a sum type `{ Var(Ty), ... }`, - * this provides the `value` for `Ty`. - */ + /** + * Given a variant `Var(Ty)` in a sum type `{ Var(Ty), ... }`, + * this provides the `value` for `Ty`. + */ public value: AlgebraicValue; constructor(tag: number, value: AlgebraicValue) { @@ -329,12 +329,12 @@ export class SumValue { } } -/** -* A product value is made of a list of -* "elements" / "fields" / "factors" of other `AlgebraicValue`s. -* -* The type of product value is a [product type](`ProductType`). -*/ +/** + * A product value is made of a list of + * "elements" / "fields" / "factors" of other `AlgebraicValue`s. + * + * The type of product value is a [product type](`ProductType`). + */ export class ProductValue { elements: AlgebraicValue[]; @@ -360,7 +360,7 @@ type BuiltinValueType = | string | number | AlgebraicValue[] - | BigInt + | bigint | Map | Uint8Array; @@ -430,8 +430,8 @@ export class BuiltinValue { return this.value as boolean; } - public asBigInt(): BigInt { - return this.value as BigInt; + public asBigInt(): bigint { + return this.value as bigint; } public asBoolean(): boolean { @@ -529,7 +529,7 @@ export class AlgebraicValue { return (this.builtin as BuiltinValue).asBool(); } - public asBigInt(): BigInt { + public asBigInt(): bigint { this.assertBuiltin(); return (this.builtin as BuiltinValue).asBigInt(); } diff --git a/src/binary_reader.ts b/src/binary_reader.ts index c68ae52..fb2a2d6 100644 --- a/src/binary_reader.ts +++ b/src/binary_reader.ts @@ -75,19 +75,19 @@ export default class BinaryReader { return value; } - readI64(): BigInt { + readI64(): bigint { const value = this.buffer.getBigInt64(this.offset, true); this.offset += 8; return value; } - readU64(): BigInt { + readU64(): bigint { const value = this.buffer.getBigUint64(this.offset, true); this.offset += 8; return value; } - readU128(): BigInt { + readU128(): bigint { const lowerPart = this.buffer.getBigUint64(this.offset, true); const upperPart = this.buffer.getBigUint64(this.offset + 8, true); this.offset += 16; @@ -95,7 +95,7 @@ export default class BinaryReader { return (upperPart << BigInt(64)) + lowerPart; } - readI128(): BigInt { + readI128(): bigint { const lowerPart = this.buffer.getBigInt64(this.offset, true); const upperPart = this.buffer.getBigInt64(this.offset + 8, true); this.offset += 16;