diff --git a/crates/bindings-typescript/examples/basic-react/src/module_bindings/add_reducer.ts b/crates/bindings-typescript/examples/basic-react/src/module_bindings/add_reducer.ts index 85081559c7d..d651f05699d 100644 --- a/crates/bindings-typescript/examples/basic-react/src/module_bindings/add_reducer.ts +++ b/crates/bindings-typescript/examples/basic-react/src/module_bindings/add_reducer.ts @@ -4,6 +4,72 @@ /* eslint-disable */ /* tslint:disable */ import { +<<<<<<< HEAD + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, + type TableHandle as __TableHandle, +} from 'spacetimedb'; + +export type Add = { + name: string; +}; +let _cached_Add_type_value: __AlgebraicTypeType | null = null; + +/** + * An object for generated helper functions. + */ +export const Add = { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + if (_cached_Add_type_value) return _cached_Add_type_value; + _cached_Add_type_value = __AlgebraicTypeValue.Product({ elements: [] }); + _cached_Add_type_value.value.elements.push({ + name: 'name', + algebraicType: __AlgebraicTypeValue.String, + }); + return _cached_Add_type_value; + }, + + serialize(writer: __BinaryWriter, value: Add): void { + __AlgebraicTypeValue.serializeValue( + writer, + Add.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): Add { + return __AlgebraicTypeValue.deserializeValue( + reader, + Add.getTypeScriptAlgebraicType() + ); + }, +}; + +export default Add; +======= TypeBuilder as __TypeBuilder, t as __t, type AlgebraicTypeType as __AlgebraicTypeType, @@ -13,3 +79,4 @@ import { export default { name: __t.string(), }; +>>>>>>> origin/master diff --git a/crates/bindings-typescript/examples/basic-react/src/module_bindings/client_connected_reducer.ts b/crates/bindings-typescript/examples/basic-react/src/module_bindings/client_connected_reducer.ts index 2ca99c88fea..586bd067780 100644 --- a/crates/bindings-typescript/examples/basic-react/src/module_bindings/client_connected_reducer.ts +++ b/crates/bindings-typescript/examples/basic-react/src/module_bindings/client_connected_reducer.ts @@ -4,6 +4,70 @@ /* eslint-disable */ /* tslint:disable */ import { +<<<<<<< HEAD + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, + type TableHandle as __TableHandle, +} from 'spacetimedb'; + +export type ClientConnected = {}; +let _cached_ClientConnected_type_value: __AlgebraicTypeType | null = null; + +/** + * An object for generated helper functions. + */ +export const ClientConnected = { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + if (_cached_ClientConnected_type_value) + return _cached_ClientConnected_type_value; + _cached_ClientConnected_type_value = __AlgebraicTypeValue.Product({ + elements: [], + }); + _cached_ClientConnected_type_value.value.elements.push(); + return _cached_ClientConnected_type_value; + }, + + serialize(writer: __BinaryWriter, value: ClientConnected): void { + __AlgebraicTypeValue.serializeValue( + writer, + ClientConnected.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): ClientConnected { + return __AlgebraicTypeValue.deserializeValue( + reader, + ClientConnected.getTypeScriptAlgebraicType() + ); + }, +}; + +export default ClientConnected; +======= TypeBuilder as __TypeBuilder, t as __t, type AlgebraicTypeType as __AlgebraicTypeType, @@ -11,3 +75,4 @@ import { } from 'spacetimedb'; export default {}; +>>>>>>> origin/master diff --git a/crates/bindings-typescript/examples/basic-react/src/module_bindings/client_disconnected_reducer.ts b/crates/bindings-typescript/examples/basic-react/src/module_bindings/client_disconnected_reducer.ts index 2ca99c88fea..5165ae0ca2f 100644 --- a/crates/bindings-typescript/examples/basic-react/src/module_bindings/client_disconnected_reducer.ts +++ b/crates/bindings-typescript/examples/basic-react/src/module_bindings/client_disconnected_reducer.ts @@ -4,6 +4,70 @@ /* eslint-disable */ /* tslint:disable */ import { +<<<<<<< HEAD + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, + type TableHandle as __TableHandle, +} from 'spacetimedb'; + +export type ClientDisconnected = {}; +let _cached_ClientDisconnected_type_value: __AlgebraicTypeType | null = null; + +/** + * An object for generated helper functions. + */ +export const ClientDisconnected = { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + if (_cached_ClientDisconnected_type_value) + return _cached_ClientDisconnected_type_value; + _cached_ClientDisconnected_type_value = __AlgebraicTypeValue.Product({ + elements: [], + }); + _cached_ClientDisconnected_type_value.value.elements.push(); + return _cached_ClientDisconnected_type_value; + }, + + serialize(writer: __BinaryWriter, value: ClientDisconnected): void { + __AlgebraicTypeValue.serializeValue( + writer, + ClientDisconnected.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): ClientDisconnected { + return __AlgebraicTypeValue.deserializeValue( + reader, + ClientDisconnected.getTypeScriptAlgebraicType() + ); + }, +}; + +export default ClientDisconnected; +======= TypeBuilder as __TypeBuilder, t as __t, type AlgebraicTypeType as __AlgebraicTypeType, @@ -11,3 +75,4 @@ import { } from 'spacetimedb'; export default {}; +>>>>>>> origin/master diff --git a/crates/bindings-typescript/examples/basic-react/src/module_bindings/index.ts b/crates/bindings-typescript/examples/basic-react/src/module_bindings/index.ts index 76310c73395..074a95da641 100644 --- a/crates/bindings-typescript/examples/basic-react/src/module_bindings/index.ts +++ b/crates/bindings-typescript/examples/basic-react/src/module_bindings/index.ts @@ -1,11 +1,284 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +<<<<<<< HEAD +// This was generated using spacetimedb cli version 1.7.0 (commit 2c2d27b2a780d762d95c0eb24005a5e319c866ac). +======= // This was generated using spacetimedb cli version 1.8.0 (commit 3f1ec77822a11345de517e72dbcefe06cc9277d4). +>>>>>>> origin/master /* eslint-disable */ /* tslint:disable */ import { +<<<<<<< HEAD + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, + type TableHandle as __TableHandle, +} from 'spacetimedb'; + +// Import and reexport all reducer arg types +import { Init } from './init_reducer.ts'; +export { Init }; +import { ClientConnected } from './client_connected_reducer.ts'; +export { ClientConnected }; +import { ClientDisconnected } from './client_disconnected_reducer.ts'; +export { ClientDisconnected }; +import { Add } from './add_reducer.ts'; +export { Add }; +import { SayHello } from './say_hello_reducer.ts'; +export { SayHello }; + +// Import and reexport all table handle types +import { PersonTableHandle } from './person_table.ts'; +export { PersonTableHandle }; + +// Import and reexport all types +import { Person } from './person_type.ts'; +export { Person }; + +const REMOTE_MODULE = { + tables: { + person: { + tableName: 'person' as const, + rowType: Person.getTypeScriptAlgebraicType(), + }, + }, + reducers: { + init: { + reducerName: 'init', + argsType: Init.getTypeScriptAlgebraicType(), + }, + client_connected: { + reducerName: 'client_connected', + argsType: ClientConnected.getTypeScriptAlgebraicType(), + }, + client_disconnected: { + reducerName: 'client_disconnected', + argsType: ClientDisconnected.getTypeScriptAlgebraicType(), + }, + add: { + reducerName: 'add', + argsType: Add.getTypeScriptAlgebraicType(), + }, + say_hello: { + reducerName: 'say_hello', + argsType: SayHello.getTypeScriptAlgebraicType(), + }, + }, + versionInfo: { + cliVersion: '1.7.0', + }, + // Constructors which are used by the DbConnectionImpl to + // extract type information from the generated RemoteModule. + // + // NOTE: This is not strictly necessary for `eventContextConstructor` because + // all we do is build a TypeScript object which we could have done inside the + // SDK, but if in the future we wanted to create a class this would be + // necessary because classes have methods, so we'll keep it. + eventContextConstructor: ( + imp: __DbConnectionImpl, + event: __Event + ) => { + return { + ...(imp as DbConnection), + event, + }; + }, + dbViewConstructor: (imp: __DbConnectionImpl) => { + return new RemoteTables(imp); + }, + reducersConstructor: ( + imp: __DbConnectionImpl, + setReducerFlags: SetReducerFlags + ) => { + return new RemoteReducers(imp, setReducerFlags); + }, + setReducerFlagsConstructor: () => { + return new SetReducerFlags(); + }, +}; + +// A type representing all the possible variants of a reducer. +export type Reducer = + | never + | { name: 'Init'; args: Init } + | { name: 'ClientConnected'; args: ClientConnected } + | { name: 'ClientDisconnected'; args: ClientDisconnected } + | { name: 'Add'; args: Add } + | { name: 'SayHello'; args: SayHello }; + +export class RemoteReducers { + constructor( + private connection: __DbConnectionImpl, + private setCallReducerFlags: SetReducerFlags + ) {} + + init() { + this.connection.callReducer( + 'init', + new Uint8Array(0), + this.setCallReducerFlags.initFlags + ); + } + + onInit(callback: (ctx: ReducerEventContext) => void) { + this.connection.onReducer('init', callback); + } + + removeOnInit(callback: (ctx: ReducerEventContext) => void) { + this.connection.offReducer('init', callback); + } + + clientConnected() { + this.connection.callReducer( + 'client_connected', + new Uint8Array(0), + this.setCallReducerFlags.clientConnectedFlags + ); + } + + onClientConnected(callback: (ctx: ReducerEventContext) => void) { + this.connection.onReducer('client_connected', callback); + } + + removeOnClientConnected(callback: (ctx: ReducerEventContext) => void) { + this.connection.offReducer('client_connected', callback); + } + + clientDisconnected() { + this.connection.callReducer( + 'client_disconnected', + new Uint8Array(0), + this.setCallReducerFlags.clientDisconnectedFlags + ); + } + + onClientDisconnected(callback: (ctx: ReducerEventContext) => void) { + this.connection.onReducer('client_disconnected', callback); + } + + removeOnClientDisconnected(callback: (ctx: ReducerEventContext) => void) { + this.connection.offReducer('client_disconnected', callback); + } + + add(name: string) { + const __args = { name }; + let __writer = new __BinaryWriter(1024); + Add.serialize(__writer, __args); + let __argsBuffer = __writer.getBuffer(); + this.connection.callReducer( + 'add', + __argsBuffer, + this.setCallReducerFlags.addFlags + ); + } + + onAdd(callback: (ctx: ReducerEventContext, name: string) => void) { + this.connection.onReducer('add', callback); + } + + removeOnAdd(callback: (ctx: ReducerEventContext, name: string) => void) { + this.connection.offReducer('add', callback); + } + + sayHello() { + this.connection.callReducer( + 'say_hello', + new Uint8Array(0), + this.setCallReducerFlags.sayHelloFlags + ); + } + + onSayHello(callback: (ctx: ReducerEventContext) => void) { + this.connection.onReducer('say_hello', callback); + } + + removeOnSayHello(callback: (ctx: ReducerEventContext) => void) { + this.connection.offReducer('say_hello', callback); + } +} + +export class SetReducerFlags { + initFlags: __CallReducerFlags = 'FullUpdate'; + init(flags: __CallReducerFlags) { + this.initFlags = flags; + } + + clientConnectedFlags: __CallReducerFlags = 'FullUpdate'; + clientConnected(flags: __CallReducerFlags) { + this.clientConnectedFlags = flags; + } + + clientDisconnectedFlags: __CallReducerFlags = 'FullUpdate'; + clientDisconnected(flags: __CallReducerFlags) { + this.clientDisconnectedFlags = flags; + } + + addFlags: __CallReducerFlags = 'FullUpdate'; + add(flags: __CallReducerFlags) { + this.addFlags = flags; + } + + sayHelloFlags: __CallReducerFlags = 'FullUpdate'; + sayHello(flags: __CallReducerFlags) { + this.sayHelloFlags = flags; + } +} + +export class RemoteTables { + constructor(private connection: __DbConnectionImpl) {} + + get person(): PersonTableHandle<'person'> { + // clientCache is a private property + return new PersonTableHandle( + ( + this.connection as unknown as { clientCache: __ClientCache } + ).clientCache.getOrCreateTable(REMOTE_MODULE.tables.person) + ); + } +} + +export class SubscriptionBuilder extends __SubscriptionBuilderImpl< + RemoteTables, + RemoteReducers, + SetReducerFlags +> {} + +export class DbConnection extends __DbConnectionImpl< + RemoteTables, + RemoteReducers, + SetReducerFlags +> { + static builder = (): __DbConnectionBuilder< + DbConnection, + ErrorContext, + SubscriptionEventContext + > => { + return new __DbConnectionBuilder< + DbConnection, + ErrorContext, + SubscriptionEventContext + >(REMOTE_MODULE, (imp: __DbConnectionImpl) => imp as DbConnection); +======= DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, SubscriptionBuilderImpl as __SubscriptionBuilderImpl, @@ -104,8 +377,35 @@ export class DbConnection extends __DbConnectionImpl { (config: __DbConnectionConfig) => new DbConnection(config) ); +>>>>>>> origin/master }; subscriptionBuilder = (): SubscriptionBuilder => { return new SubscriptionBuilder(this); }; } +<<<<<<< HEAD + +export type EventContext = __EventContextInterface< + RemoteTables, + RemoteReducers, + SetReducerFlags, + Reducer +>; +export type ReducerEventContext = __ReducerEventContextInterface< + RemoteTables, + RemoteReducers, + SetReducerFlags, + Reducer +>; +export type SubscriptionEventContext = __SubscriptionEventContextInterface< + RemoteTables, + RemoteReducers, + SetReducerFlags +>; +export type ErrorContext = __ErrorContextInterface< + RemoteTables, + RemoteReducers, + SetReducerFlags +>; +======= +>>>>>>> origin/master diff --git a/crates/bindings-typescript/examples/basic-react/src/module_bindings/init_reducer.ts b/crates/bindings-typescript/examples/basic-react/src/module_bindings/init_reducer.ts index 2ca99c88fea..67bf1d4fa8b 100644 --- a/crates/bindings-typescript/examples/basic-react/src/module_bindings/init_reducer.ts +++ b/crates/bindings-typescript/examples/basic-react/src/module_bindings/init_reducer.ts @@ -4,6 +4,67 @@ /* eslint-disable */ /* tslint:disable */ import { +<<<<<<< HEAD + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, + type TableHandle as __TableHandle, +} from 'spacetimedb'; + +export type Init = {}; +let _cached_Init_type_value: __AlgebraicTypeType | null = null; + +/** + * An object for generated helper functions. + */ +export const Init = { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + if (_cached_Init_type_value) return _cached_Init_type_value; + _cached_Init_type_value = __AlgebraicTypeValue.Product({ elements: [] }); + _cached_Init_type_value.value.elements.push(); + return _cached_Init_type_value; + }, + + serialize(writer: __BinaryWriter, value: Init): void { + __AlgebraicTypeValue.serializeValue( + writer, + Init.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): Init { + return __AlgebraicTypeValue.deserializeValue( + reader, + Init.getTypeScriptAlgebraicType() + ); + }, +}; + +export default Init; +======= TypeBuilder as __TypeBuilder, t as __t, type AlgebraicTypeType as __AlgebraicTypeType, @@ -11,3 +72,4 @@ import { } from 'spacetimedb'; export default {}; +>>>>>>> origin/master diff --git a/crates/bindings-typescript/examples/basic-react/src/module_bindings/person_table.ts b/crates/bindings-typescript/examples/basic-react/src/module_bindings/person_table.ts index 0f70f74f617..baf7f284a28 100644 --- a/crates/bindings-typescript/examples/basic-react/src/module_bindings/person_table.ts +++ b/crates/bindings-typescript/examples/basic-react/src/module_bindings/person_table.ts @@ -4,6 +4,85 @@ /* eslint-disable */ /* tslint:disable */ import { +<<<<<<< HEAD + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, + type TableHandle as __TableHandle, +} from 'spacetimedb'; +import { Person } from './person_type'; +import { + type EventContext, + type Reducer, + RemoteReducers, + RemoteTables, +} from '.'; +declare type __keep = [EventContext, Reducer, RemoteReducers, RemoteTables]; + +/** + * Table handle for the table `person`. + * + * Obtain a handle from the [`person`] property on [`RemoteTables`], + * like `ctx.db.person`. + * + * Users are encouraged not to explicitly reference this type, + * but to directly chain method calls, + * like `ctx.db.person.on_insert(...)`. + */ +export class PersonTableHandle + implements __TableHandle +{ + // phantom type to track the table name + readonly tableName!: TableName; + tableCache: __TableCache; + + constructor(tableCache: __TableCache) { + this.tableCache = tableCache; + } + + count(): number { + return this.tableCache.count(); + } + + iter(): Iterable { + return this.tableCache.iter(); + } + + onInsert = (cb: (ctx: EventContext, row: Person) => void) => { + return this.tableCache.onInsert(cb); + }; + + removeOnInsert = (cb: (ctx: EventContext, row: Person) => void) => { + return this.tableCache.removeOnInsert(cb); + }; + + onDelete = (cb: (ctx: EventContext, row: Person) => void) => { + return this.tableCache.onDelete(cb); + }; + + removeOnDelete = (cb: (ctx: EventContext, row: Person) => void) => { + return this.tableCache.removeOnDelete(cb); + }; +} +======= TypeBuilder as __TypeBuilder, t as __t, type AlgebraicTypeType as __AlgebraicTypeType, @@ -13,3 +92,4 @@ import { export default __t.row({ name: __t.string(), }); +>>>>>>> origin/master diff --git a/crates/bindings-typescript/examples/basic-react/src/module_bindings/person_type.ts b/crates/bindings-typescript/examples/basic-react/src/module_bindings/person_type.ts index 1156775a3cf..abfa12efb62 100644 --- a/crates/bindings-typescript/examples/basic-react/src/module_bindings/person_type.ts +++ b/crates/bindings-typescript/examples/basic-react/src/module_bindings/person_type.ts @@ -4,6 +4,72 @@ /* eslint-disable */ /* tslint:disable */ import { +<<<<<<< HEAD + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, + type TableHandle as __TableHandle, +} from 'spacetimedb'; + +export type Person = { + name: string; +}; +let _cached_Person_type_value: __AlgebraicTypeType | null = null; + +/** + * An object for generated helper functions. + */ +export const Person = { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + if (_cached_Person_type_value) return _cached_Person_type_value; + _cached_Person_type_value = __AlgebraicTypeValue.Product({ elements: [] }); + _cached_Person_type_value.value.elements.push({ + name: 'name', + algebraicType: __AlgebraicTypeValue.String, + }); + return _cached_Person_type_value; + }, + + serialize(writer: __BinaryWriter, value: Person): void { + __AlgebraicTypeValue.serializeValue( + writer, + Person.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): Person { + return __AlgebraicTypeValue.deserializeValue( + reader, + Person.getTypeScriptAlgebraicType() + ); + }, +}; + +export default Person; +======= TypeBuilder as __TypeBuilder, t as __t, type AlgebraicTypeType as __AlgebraicTypeType, @@ -13,3 +79,4 @@ import { export default __t.object('Person', { name: __t.string(), }); +>>>>>>> origin/master diff --git a/crates/bindings-typescript/examples/basic-react/src/module_bindings/say_hello_reducer.ts b/crates/bindings-typescript/examples/basic-react/src/module_bindings/say_hello_reducer.ts index 2ca99c88fea..b175ed6f966 100644 --- a/crates/bindings-typescript/examples/basic-react/src/module_bindings/say_hello_reducer.ts +++ b/crates/bindings-typescript/examples/basic-react/src/module_bindings/say_hello_reducer.ts @@ -4,6 +4,69 @@ /* eslint-disable */ /* tslint:disable */ import { +<<<<<<< HEAD + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, + type TableHandle as __TableHandle, +} from 'spacetimedb'; + +export type SayHello = {}; +let _cached_SayHello_type_value: __AlgebraicTypeType | null = null; + +/** + * An object for generated helper functions. + */ +export const SayHello = { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + if (_cached_SayHello_type_value) return _cached_SayHello_type_value; + _cached_SayHello_type_value = __AlgebraicTypeValue.Product({ + elements: [], + }); + _cached_SayHello_type_value.value.elements.push(); + return _cached_SayHello_type_value; + }, + + serialize(writer: __BinaryWriter, value: SayHello): void { + __AlgebraicTypeValue.serializeValue( + writer, + SayHello.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): SayHello { + return __AlgebraicTypeValue.deserializeValue( + reader, + SayHello.getTypeScriptAlgebraicType() + ); + }, +}; + +export default SayHello; +======= TypeBuilder as __TypeBuilder, t as __t, type AlgebraicTypeType as __AlgebraicTypeType, @@ -11,3 +74,4 @@ import { } from 'spacetimedb'; export default {}; +>>>>>>> origin/master diff --git a/crates/bindings-typescript/examples/empty/src/module_bindings/add_reducer.ts b/crates/bindings-typescript/examples/empty/src/module_bindings/add_reducer.ts index 85081559c7d..d651f05699d 100644 --- a/crates/bindings-typescript/examples/empty/src/module_bindings/add_reducer.ts +++ b/crates/bindings-typescript/examples/empty/src/module_bindings/add_reducer.ts @@ -4,6 +4,72 @@ /* eslint-disable */ /* tslint:disable */ import { +<<<<<<< HEAD + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, + type TableHandle as __TableHandle, +} from 'spacetimedb'; + +export type Add = { + name: string; +}; +let _cached_Add_type_value: __AlgebraicTypeType | null = null; + +/** + * An object for generated helper functions. + */ +export const Add = { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + if (_cached_Add_type_value) return _cached_Add_type_value; + _cached_Add_type_value = __AlgebraicTypeValue.Product({ elements: [] }); + _cached_Add_type_value.value.elements.push({ + name: 'name', + algebraicType: __AlgebraicTypeValue.String, + }); + return _cached_Add_type_value; + }, + + serialize(writer: __BinaryWriter, value: Add): void { + __AlgebraicTypeValue.serializeValue( + writer, + Add.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): Add { + return __AlgebraicTypeValue.deserializeValue( + reader, + Add.getTypeScriptAlgebraicType() + ); + }, +}; + +export default Add; +======= TypeBuilder as __TypeBuilder, t as __t, type AlgebraicTypeType as __AlgebraicTypeType, @@ -13,3 +79,4 @@ import { export default { name: __t.string(), }; +>>>>>>> origin/master diff --git a/crates/bindings-typescript/examples/empty/src/module_bindings/client_connected_reducer.ts b/crates/bindings-typescript/examples/empty/src/module_bindings/client_connected_reducer.ts index 2ca99c88fea..586bd067780 100644 --- a/crates/bindings-typescript/examples/empty/src/module_bindings/client_connected_reducer.ts +++ b/crates/bindings-typescript/examples/empty/src/module_bindings/client_connected_reducer.ts @@ -4,6 +4,70 @@ /* eslint-disable */ /* tslint:disable */ import { +<<<<<<< HEAD + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, + type TableHandle as __TableHandle, +} from 'spacetimedb'; + +export type ClientConnected = {}; +let _cached_ClientConnected_type_value: __AlgebraicTypeType | null = null; + +/** + * An object for generated helper functions. + */ +export const ClientConnected = { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + if (_cached_ClientConnected_type_value) + return _cached_ClientConnected_type_value; + _cached_ClientConnected_type_value = __AlgebraicTypeValue.Product({ + elements: [], + }); + _cached_ClientConnected_type_value.value.elements.push(); + return _cached_ClientConnected_type_value; + }, + + serialize(writer: __BinaryWriter, value: ClientConnected): void { + __AlgebraicTypeValue.serializeValue( + writer, + ClientConnected.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): ClientConnected { + return __AlgebraicTypeValue.deserializeValue( + reader, + ClientConnected.getTypeScriptAlgebraicType() + ); + }, +}; + +export default ClientConnected; +======= TypeBuilder as __TypeBuilder, t as __t, type AlgebraicTypeType as __AlgebraicTypeType, @@ -11,3 +75,4 @@ import { } from 'spacetimedb'; export default {}; +>>>>>>> origin/master diff --git a/crates/bindings-typescript/examples/empty/src/module_bindings/client_disconnected_reducer.ts b/crates/bindings-typescript/examples/empty/src/module_bindings/client_disconnected_reducer.ts index 2ca99c88fea..5165ae0ca2f 100644 --- a/crates/bindings-typescript/examples/empty/src/module_bindings/client_disconnected_reducer.ts +++ b/crates/bindings-typescript/examples/empty/src/module_bindings/client_disconnected_reducer.ts @@ -4,6 +4,70 @@ /* eslint-disable */ /* tslint:disable */ import { +<<<<<<< HEAD + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, + type TableHandle as __TableHandle, +} from 'spacetimedb'; + +export type ClientDisconnected = {}; +let _cached_ClientDisconnected_type_value: __AlgebraicTypeType | null = null; + +/** + * An object for generated helper functions. + */ +export const ClientDisconnected = { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + if (_cached_ClientDisconnected_type_value) + return _cached_ClientDisconnected_type_value; + _cached_ClientDisconnected_type_value = __AlgebraicTypeValue.Product({ + elements: [], + }); + _cached_ClientDisconnected_type_value.value.elements.push(); + return _cached_ClientDisconnected_type_value; + }, + + serialize(writer: __BinaryWriter, value: ClientDisconnected): void { + __AlgebraicTypeValue.serializeValue( + writer, + ClientDisconnected.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): ClientDisconnected { + return __AlgebraicTypeValue.deserializeValue( + reader, + ClientDisconnected.getTypeScriptAlgebraicType() + ); + }, +}; + +export default ClientDisconnected; +======= TypeBuilder as __TypeBuilder, t as __t, type AlgebraicTypeType as __AlgebraicTypeType, @@ -11,3 +75,4 @@ import { } from 'spacetimedb'; export default {}; +>>>>>>> origin/master diff --git a/crates/bindings-typescript/examples/empty/src/module_bindings/index.ts b/crates/bindings-typescript/examples/empty/src/module_bindings/index.ts index 76310c73395..074a95da641 100644 --- a/crates/bindings-typescript/examples/empty/src/module_bindings/index.ts +++ b/crates/bindings-typescript/examples/empty/src/module_bindings/index.ts @@ -1,11 +1,284 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +<<<<<<< HEAD +// This was generated using spacetimedb cli version 1.7.0 (commit 2c2d27b2a780d762d95c0eb24005a5e319c866ac). +======= // This was generated using spacetimedb cli version 1.8.0 (commit 3f1ec77822a11345de517e72dbcefe06cc9277d4). +>>>>>>> origin/master /* eslint-disable */ /* tslint:disable */ import { +<<<<<<< HEAD + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, + type TableHandle as __TableHandle, +} from 'spacetimedb'; + +// Import and reexport all reducer arg types +import { Init } from './init_reducer.ts'; +export { Init }; +import { ClientConnected } from './client_connected_reducer.ts'; +export { ClientConnected }; +import { ClientDisconnected } from './client_disconnected_reducer.ts'; +export { ClientDisconnected }; +import { Add } from './add_reducer.ts'; +export { Add }; +import { SayHello } from './say_hello_reducer.ts'; +export { SayHello }; + +// Import and reexport all table handle types +import { PersonTableHandle } from './person_table.ts'; +export { PersonTableHandle }; + +// Import and reexport all types +import { Person } from './person_type.ts'; +export { Person }; + +const REMOTE_MODULE = { + tables: { + person: { + tableName: 'person' as const, + rowType: Person.getTypeScriptAlgebraicType(), + }, + }, + reducers: { + init: { + reducerName: 'init', + argsType: Init.getTypeScriptAlgebraicType(), + }, + client_connected: { + reducerName: 'client_connected', + argsType: ClientConnected.getTypeScriptAlgebraicType(), + }, + client_disconnected: { + reducerName: 'client_disconnected', + argsType: ClientDisconnected.getTypeScriptAlgebraicType(), + }, + add: { + reducerName: 'add', + argsType: Add.getTypeScriptAlgebraicType(), + }, + say_hello: { + reducerName: 'say_hello', + argsType: SayHello.getTypeScriptAlgebraicType(), + }, + }, + versionInfo: { + cliVersion: '1.7.0', + }, + // Constructors which are used by the DbConnectionImpl to + // extract type information from the generated RemoteModule. + // + // NOTE: This is not strictly necessary for `eventContextConstructor` because + // all we do is build a TypeScript object which we could have done inside the + // SDK, but if in the future we wanted to create a class this would be + // necessary because classes have methods, so we'll keep it. + eventContextConstructor: ( + imp: __DbConnectionImpl, + event: __Event + ) => { + return { + ...(imp as DbConnection), + event, + }; + }, + dbViewConstructor: (imp: __DbConnectionImpl) => { + return new RemoteTables(imp); + }, + reducersConstructor: ( + imp: __DbConnectionImpl, + setReducerFlags: SetReducerFlags + ) => { + return new RemoteReducers(imp, setReducerFlags); + }, + setReducerFlagsConstructor: () => { + return new SetReducerFlags(); + }, +}; + +// A type representing all the possible variants of a reducer. +export type Reducer = + | never + | { name: 'Init'; args: Init } + | { name: 'ClientConnected'; args: ClientConnected } + | { name: 'ClientDisconnected'; args: ClientDisconnected } + | { name: 'Add'; args: Add } + | { name: 'SayHello'; args: SayHello }; + +export class RemoteReducers { + constructor( + private connection: __DbConnectionImpl, + private setCallReducerFlags: SetReducerFlags + ) {} + + init() { + this.connection.callReducer( + 'init', + new Uint8Array(0), + this.setCallReducerFlags.initFlags + ); + } + + onInit(callback: (ctx: ReducerEventContext) => void) { + this.connection.onReducer('init', callback); + } + + removeOnInit(callback: (ctx: ReducerEventContext) => void) { + this.connection.offReducer('init', callback); + } + + clientConnected() { + this.connection.callReducer( + 'client_connected', + new Uint8Array(0), + this.setCallReducerFlags.clientConnectedFlags + ); + } + + onClientConnected(callback: (ctx: ReducerEventContext) => void) { + this.connection.onReducer('client_connected', callback); + } + + removeOnClientConnected(callback: (ctx: ReducerEventContext) => void) { + this.connection.offReducer('client_connected', callback); + } + + clientDisconnected() { + this.connection.callReducer( + 'client_disconnected', + new Uint8Array(0), + this.setCallReducerFlags.clientDisconnectedFlags + ); + } + + onClientDisconnected(callback: (ctx: ReducerEventContext) => void) { + this.connection.onReducer('client_disconnected', callback); + } + + removeOnClientDisconnected(callback: (ctx: ReducerEventContext) => void) { + this.connection.offReducer('client_disconnected', callback); + } + + add(name: string) { + const __args = { name }; + let __writer = new __BinaryWriter(1024); + Add.serialize(__writer, __args); + let __argsBuffer = __writer.getBuffer(); + this.connection.callReducer( + 'add', + __argsBuffer, + this.setCallReducerFlags.addFlags + ); + } + + onAdd(callback: (ctx: ReducerEventContext, name: string) => void) { + this.connection.onReducer('add', callback); + } + + removeOnAdd(callback: (ctx: ReducerEventContext, name: string) => void) { + this.connection.offReducer('add', callback); + } + + sayHello() { + this.connection.callReducer( + 'say_hello', + new Uint8Array(0), + this.setCallReducerFlags.sayHelloFlags + ); + } + + onSayHello(callback: (ctx: ReducerEventContext) => void) { + this.connection.onReducer('say_hello', callback); + } + + removeOnSayHello(callback: (ctx: ReducerEventContext) => void) { + this.connection.offReducer('say_hello', callback); + } +} + +export class SetReducerFlags { + initFlags: __CallReducerFlags = 'FullUpdate'; + init(flags: __CallReducerFlags) { + this.initFlags = flags; + } + + clientConnectedFlags: __CallReducerFlags = 'FullUpdate'; + clientConnected(flags: __CallReducerFlags) { + this.clientConnectedFlags = flags; + } + + clientDisconnectedFlags: __CallReducerFlags = 'FullUpdate'; + clientDisconnected(flags: __CallReducerFlags) { + this.clientDisconnectedFlags = flags; + } + + addFlags: __CallReducerFlags = 'FullUpdate'; + add(flags: __CallReducerFlags) { + this.addFlags = flags; + } + + sayHelloFlags: __CallReducerFlags = 'FullUpdate'; + sayHello(flags: __CallReducerFlags) { + this.sayHelloFlags = flags; + } +} + +export class RemoteTables { + constructor(private connection: __DbConnectionImpl) {} + + get person(): PersonTableHandle<'person'> { + // clientCache is a private property + return new PersonTableHandle( + ( + this.connection as unknown as { clientCache: __ClientCache } + ).clientCache.getOrCreateTable(REMOTE_MODULE.tables.person) + ); + } +} + +export class SubscriptionBuilder extends __SubscriptionBuilderImpl< + RemoteTables, + RemoteReducers, + SetReducerFlags +> {} + +export class DbConnection extends __DbConnectionImpl< + RemoteTables, + RemoteReducers, + SetReducerFlags +> { + static builder = (): __DbConnectionBuilder< + DbConnection, + ErrorContext, + SubscriptionEventContext + > => { + return new __DbConnectionBuilder< + DbConnection, + ErrorContext, + SubscriptionEventContext + >(REMOTE_MODULE, (imp: __DbConnectionImpl) => imp as DbConnection); +======= DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, SubscriptionBuilderImpl as __SubscriptionBuilderImpl, @@ -104,8 +377,35 @@ export class DbConnection extends __DbConnectionImpl { (config: __DbConnectionConfig) => new DbConnection(config) ); +>>>>>>> origin/master }; subscriptionBuilder = (): SubscriptionBuilder => { return new SubscriptionBuilder(this); }; } +<<<<<<< HEAD + +export type EventContext = __EventContextInterface< + RemoteTables, + RemoteReducers, + SetReducerFlags, + Reducer +>; +export type ReducerEventContext = __ReducerEventContextInterface< + RemoteTables, + RemoteReducers, + SetReducerFlags, + Reducer +>; +export type SubscriptionEventContext = __SubscriptionEventContextInterface< + RemoteTables, + RemoteReducers, + SetReducerFlags +>; +export type ErrorContext = __ErrorContextInterface< + RemoteTables, + RemoteReducers, + SetReducerFlags +>; +======= +>>>>>>> origin/master diff --git a/crates/bindings-typescript/examples/empty/src/module_bindings/init_reducer.ts b/crates/bindings-typescript/examples/empty/src/module_bindings/init_reducer.ts index 2ca99c88fea..67bf1d4fa8b 100644 --- a/crates/bindings-typescript/examples/empty/src/module_bindings/init_reducer.ts +++ b/crates/bindings-typescript/examples/empty/src/module_bindings/init_reducer.ts @@ -4,6 +4,67 @@ /* eslint-disable */ /* tslint:disable */ import { +<<<<<<< HEAD + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, + type TableHandle as __TableHandle, +} from 'spacetimedb'; + +export type Init = {}; +let _cached_Init_type_value: __AlgebraicTypeType | null = null; + +/** + * An object for generated helper functions. + */ +export const Init = { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + if (_cached_Init_type_value) return _cached_Init_type_value; + _cached_Init_type_value = __AlgebraicTypeValue.Product({ elements: [] }); + _cached_Init_type_value.value.elements.push(); + return _cached_Init_type_value; + }, + + serialize(writer: __BinaryWriter, value: Init): void { + __AlgebraicTypeValue.serializeValue( + writer, + Init.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): Init { + return __AlgebraicTypeValue.deserializeValue( + reader, + Init.getTypeScriptAlgebraicType() + ); + }, +}; + +export default Init; +======= TypeBuilder as __TypeBuilder, t as __t, type AlgebraicTypeType as __AlgebraicTypeType, @@ -11,3 +72,4 @@ import { } from 'spacetimedb'; export default {}; +>>>>>>> origin/master diff --git a/crates/bindings-typescript/examples/empty/src/module_bindings/person_table.ts b/crates/bindings-typescript/examples/empty/src/module_bindings/person_table.ts index 0f70f74f617..baf7f284a28 100644 --- a/crates/bindings-typescript/examples/empty/src/module_bindings/person_table.ts +++ b/crates/bindings-typescript/examples/empty/src/module_bindings/person_table.ts @@ -4,6 +4,85 @@ /* eslint-disable */ /* tslint:disable */ import { +<<<<<<< HEAD + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, + type TableHandle as __TableHandle, +} from 'spacetimedb'; +import { Person } from './person_type'; +import { + type EventContext, + type Reducer, + RemoteReducers, + RemoteTables, +} from '.'; +declare type __keep = [EventContext, Reducer, RemoteReducers, RemoteTables]; + +/** + * Table handle for the table `person`. + * + * Obtain a handle from the [`person`] property on [`RemoteTables`], + * like `ctx.db.person`. + * + * Users are encouraged not to explicitly reference this type, + * but to directly chain method calls, + * like `ctx.db.person.on_insert(...)`. + */ +export class PersonTableHandle + implements __TableHandle +{ + // phantom type to track the table name + readonly tableName!: TableName; + tableCache: __TableCache; + + constructor(tableCache: __TableCache) { + this.tableCache = tableCache; + } + + count(): number { + return this.tableCache.count(); + } + + iter(): Iterable { + return this.tableCache.iter(); + } + + onInsert = (cb: (ctx: EventContext, row: Person) => void) => { + return this.tableCache.onInsert(cb); + }; + + removeOnInsert = (cb: (ctx: EventContext, row: Person) => void) => { + return this.tableCache.removeOnInsert(cb); + }; + + onDelete = (cb: (ctx: EventContext, row: Person) => void) => { + return this.tableCache.onDelete(cb); + }; + + removeOnDelete = (cb: (ctx: EventContext, row: Person) => void) => { + return this.tableCache.removeOnDelete(cb); + }; +} +======= TypeBuilder as __TypeBuilder, t as __t, type AlgebraicTypeType as __AlgebraicTypeType, @@ -13,3 +92,4 @@ import { export default __t.row({ name: __t.string(), }); +>>>>>>> origin/master diff --git a/crates/bindings-typescript/examples/empty/src/module_bindings/person_type.ts b/crates/bindings-typescript/examples/empty/src/module_bindings/person_type.ts index 1156775a3cf..abfa12efb62 100644 --- a/crates/bindings-typescript/examples/empty/src/module_bindings/person_type.ts +++ b/crates/bindings-typescript/examples/empty/src/module_bindings/person_type.ts @@ -4,6 +4,72 @@ /* eslint-disable */ /* tslint:disable */ import { +<<<<<<< HEAD + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, + type TableHandle as __TableHandle, +} from 'spacetimedb'; + +export type Person = { + name: string; +}; +let _cached_Person_type_value: __AlgebraicTypeType | null = null; + +/** + * An object for generated helper functions. + */ +export const Person = { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + if (_cached_Person_type_value) return _cached_Person_type_value; + _cached_Person_type_value = __AlgebraicTypeValue.Product({ elements: [] }); + _cached_Person_type_value.value.elements.push({ + name: 'name', + algebraicType: __AlgebraicTypeValue.String, + }); + return _cached_Person_type_value; + }, + + serialize(writer: __BinaryWriter, value: Person): void { + __AlgebraicTypeValue.serializeValue( + writer, + Person.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): Person { + return __AlgebraicTypeValue.deserializeValue( + reader, + Person.getTypeScriptAlgebraicType() + ); + }, +}; + +export default Person; +======= TypeBuilder as __TypeBuilder, t as __t, type AlgebraicTypeType as __AlgebraicTypeType, @@ -13,3 +79,4 @@ import { export default __t.object('Person', { name: __t.string(), }); +>>>>>>> origin/master diff --git a/crates/bindings-typescript/examples/empty/src/module_bindings/say_hello_reducer.ts b/crates/bindings-typescript/examples/empty/src/module_bindings/say_hello_reducer.ts index 2ca99c88fea..b175ed6f966 100644 --- a/crates/bindings-typescript/examples/empty/src/module_bindings/say_hello_reducer.ts +++ b/crates/bindings-typescript/examples/empty/src/module_bindings/say_hello_reducer.ts @@ -4,6 +4,69 @@ /* eslint-disable */ /* tslint:disable */ import { +<<<<<<< HEAD + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, + type TableHandle as __TableHandle, +} from 'spacetimedb'; + +export type SayHello = {}; +let _cached_SayHello_type_value: __AlgebraicTypeType | null = null; + +/** + * An object for generated helper functions. + */ +export const SayHello = { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + if (_cached_SayHello_type_value) return _cached_SayHello_type_value; + _cached_SayHello_type_value = __AlgebraicTypeValue.Product({ + elements: [], + }); + _cached_SayHello_type_value.value.elements.push(); + return _cached_SayHello_type_value; + }, + + serialize(writer: __BinaryWriter, value: SayHello): void { + __AlgebraicTypeValue.serializeValue( + writer, + SayHello.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): SayHello { + return __AlgebraicTypeValue.deserializeValue( + reader, + SayHello.getTypeScriptAlgebraicType() + ); + }, +}; + +export default SayHello; +======= TypeBuilder as __TypeBuilder, t as __t, type AlgebraicTypeType as __AlgebraicTypeType, @@ -11,3 +74,4 @@ import { } from 'spacetimedb'; export default {}; +>>>>>>> origin/master diff --git a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/index.ts b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/index.ts index 54c2f50c27a..6715fa0e7ea 100644 --- a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/index.ts +++ b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/index.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.8.0 (commit 3f1ec77822a11345de517e72dbcefe06cc9277d4). +// This was generated using spacetimedb cli version 1.8.0 (commit 24702ec264b4fe265209e025cea160bbdb53320c). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/sdk/client_api/client_message_variants.ts b/crates/bindings-typescript/src/sdk/client_api/client_message_variants.ts new file mode 100644 index 00000000000..af1a16e6b45 --- /dev/null +++ b/crates/bindings-typescript/src/sdk/client_api/client_message_variants.ts @@ -0,0 +1,71 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +/* eslint-disable */ +/* tslint:disable */ +import { + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, + type TableHandle as __TableHandle, +} from '../../index'; +import { CallReducer as CallReducerType } from './call_reducer_type'; +// Mark import as potentially unused +declare type __keep_CallReducerType = CallReducerType; +import { Subscribe as SubscribeType } from './subscribe_type'; +// Mark import as potentially unused +declare type __keep_SubscribeType = SubscribeType; +import { OneOffQuery as OneOffQueryType } from './one_off_query_type'; +// Mark import as potentially unused +declare type __keep_OneOffQueryType = OneOffQueryType; +import { SubscribeSingle as SubscribeSingleType } from './subscribe_single_type'; +// Mark import as potentially unused +declare type __keep_SubscribeSingleType = SubscribeSingleType; +import { SubscribeMulti as SubscribeMultiType } from './subscribe_multi_type'; +// Mark import as potentially unused +declare type __keep_SubscribeMultiType = SubscribeMultiType; +import { Unsubscribe as UnsubscribeType } from './unsubscribe_type'; +// Mark import as potentially unused +declare type __keep_UnsubscribeType = UnsubscribeType; +import { UnsubscribeMulti as UnsubscribeMultiType } from './unsubscribe_multi_type'; +// Mark import as potentially unused +declare type __keep_UnsubscribeMultiType = UnsubscribeMultiType; +import { CallProcedure as CallProcedureType } from './call_procedure_type'; +// Mark import as potentially unused +declare type __keep_CallProcedureType = CallProcedureType; + +export type CallReducer = { tag: 'CallReducer'; value: CallReducerType }; +export type Subscribe = { tag: 'Subscribe'; value: SubscribeType }; +export type OneOffQuery = { tag: 'OneOffQuery'; value: OneOffQueryType }; +export type SubscribeSingle = { + tag: 'SubscribeSingle'; + value: SubscribeSingleType; +}; +export type SubscribeMulti = { + tag: 'SubscribeMulti'; + value: SubscribeMultiType; +}; +export type Unsubscribe = { tag: 'Unsubscribe'; value: UnsubscribeType }; +export type UnsubscribeMulti = { + tag: 'UnsubscribeMulti'; + value: UnsubscribeMultiType; +}; +export type CallProcedure = { tag: 'CallProcedure'; value: CallProcedureType }; diff --git a/crates/bindings-typescript/src/sdk/client_api/index.ts b/crates/bindings-typescript/src/sdk/client_api/index.ts index 44df46a6154..5af3873ae67 100644 --- a/crates/bindings-typescript/src/sdk/client_api/index.ts +++ b/crates/bindings-typescript/src/sdk/client_api/index.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.8.0 (commit 3f1ec77822a11345de517e72dbcefe06cc9277d4). +// This was generated using spacetimedb cli version 1.8.0 (commit 24702ec264b4fe265209e025cea160bbdb53320c). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/sdk/client_api/procedure_status_variants.ts b/crates/bindings-typescript/src/sdk/client_api/procedure_status_variants.ts new file mode 100644 index 00000000000..9b540d11bab --- /dev/null +++ b/crates/bindings-typescript/src/sdk/client_api/procedure_status_variants.ts @@ -0,0 +1,33 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +/* eslint-disable */ +/* tslint:disable */ +import { + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, + type TableHandle as __TableHandle, +} from '../../index'; + +export type Returned = { tag: 'Returned'; value: Uint8Array }; +export type OutOfEnergy = { tag: 'OutOfEnergy' }; +export type InternalError = { tag: 'InternalError'; value: string }; diff --git a/crates/bindings-typescript/src/sdk/client_api/server_message_variants.ts b/crates/bindings-typescript/src/sdk/client_api/server_message_variants.ts new file mode 100644 index 00000000000..f86d81618b7 --- /dev/null +++ b/crates/bindings-typescript/src/sdk/client_api/server_message_variants.ts @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +/* eslint-disable */ +/* tslint:disable */ +import { + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, + type TableHandle as __TableHandle, +} from '../../index'; +import { InitialSubscription as InitialSubscriptionType } from './initial_subscription_type'; +// Mark import as potentially unused +declare type __keep_InitialSubscriptionType = InitialSubscriptionType; +import { TransactionUpdate as TransactionUpdateType } from './transaction_update_type'; +// Mark import as potentially unused +declare type __keep_TransactionUpdateType = TransactionUpdateType; +import { TransactionUpdateLight as TransactionUpdateLightType } from './transaction_update_light_type'; +// Mark import as potentially unused +declare type __keep_TransactionUpdateLightType = TransactionUpdateLightType; +import { IdentityToken as IdentityTokenType } from './identity_token_type'; +// Mark import as potentially unused +declare type __keep_IdentityTokenType = IdentityTokenType; +import { OneOffQueryResponse as OneOffQueryResponseType } from './one_off_query_response_type'; +// Mark import as potentially unused +declare type __keep_OneOffQueryResponseType = OneOffQueryResponseType; +import { SubscribeApplied as SubscribeAppliedType } from './subscribe_applied_type'; +// Mark import as potentially unused +declare type __keep_SubscribeAppliedType = SubscribeAppliedType; +import { UnsubscribeApplied as UnsubscribeAppliedType } from './unsubscribe_applied_type'; +// Mark import as potentially unused +declare type __keep_UnsubscribeAppliedType = UnsubscribeAppliedType; +import { SubscriptionError as SubscriptionErrorType } from './subscription_error_type'; +// Mark import as potentially unused +declare type __keep_SubscriptionErrorType = SubscriptionErrorType; +import { SubscribeMultiApplied as SubscribeMultiAppliedType } from './subscribe_multi_applied_type'; +// Mark import as potentially unused +declare type __keep_SubscribeMultiAppliedType = SubscribeMultiAppliedType; +import { UnsubscribeMultiApplied as UnsubscribeMultiAppliedType } from './unsubscribe_multi_applied_type'; +// Mark import as potentially unused +declare type __keep_UnsubscribeMultiAppliedType = UnsubscribeMultiAppliedType; +import { ProcedureResult as ProcedureResultType } from './procedure_result_type'; +// Mark import as potentially unused +declare type __keep_ProcedureResultType = ProcedureResultType; + +export type InitialSubscription = { + tag: 'InitialSubscription'; + value: InitialSubscriptionType; +}; +export type TransactionUpdate = { + tag: 'TransactionUpdate'; + value: TransactionUpdateType; +}; +export type TransactionUpdateLight = { + tag: 'TransactionUpdateLight'; + value: TransactionUpdateLightType; +}; +export type IdentityToken = { tag: 'IdentityToken'; value: IdentityTokenType }; +export type OneOffQueryResponse = { + tag: 'OneOffQueryResponse'; + value: OneOffQueryResponseType; +}; +export type SubscribeApplied = { + tag: 'SubscribeApplied'; + value: SubscribeAppliedType; +}; +export type UnsubscribeApplied = { + tag: 'UnsubscribeApplied'; + value: UnsubscribeAppliedType; +}; +export type SubscriptionError = { + tag: 'SubscriptionError'; + value: SubscriptionErrorType; +}; +export type SubscribeMultiApplied = { + tag: 'SubscribeMultiApplied'; + value: SubscribeMultiAppliedType; +}; +export type UnsubscribeMultiApplied = { + tag: 'UnsubscribeMultiApplied'; + value: UnsubscribeMultiAppliedType; +}; +export type ProcedureResult = { + tag: 'ProcedureResult'; + value: ProcedureResultType; +}; diff --git a/crates/bindings-typescript/test-app/src/module_bindings/index.ts b/crates/bindings-typescript/test-app/src/module_bindings/index.ts index 6937e805325..5f6345b27e1 100644 --- a/crates/bindings-typescript/test-app/src/module_bindings/index.ts +++ b/crates/bindings-typescript/test-app/src/module_bindings/index.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.8.0 (commit 3f1ec77822a11345de517e72dbcefe06cc9277d4). +// This was generated using spacetimedb cli version 1.8.0 (commit 24702ec264b4fe265209e025cea160bbdb53320c). /* eslint-disable */ /* tslint:disable */