@@ -231,6 +231,7 @@ import {
231231 type ReducerEventContextInterface as __ReducerEventContextInterface ,
232232 type RemoteModule as __RemoteModule ,
233233 type SubscriptionEventContextInterface as __SubscriptionEventContextInterface ,
234+ type SubscriptionHandleImpl as __SubscriptionHandleImpl ,
234235} from " spacetimedb" ;
235236
236237// Import and reexport all reducer arg types
@@ -325,7 +326,7 @@ export { NamespaceTestC };
325326import NamespaceTestF from " ./namespace_test_f_type" ;
326327export { NamespaceTestF };
327328
328-
329+ /** The schema information for all tables in this module. This is defined the same was as the tables would have been defined in the server. */
329330const tablesSchema = __schema (
330331 __table ({
331332 name: ' has_special_stuff' ,
@@ -350,9 +351,9 @@ const tablesSchema = __schema(
350351 constraints: [
351352 { name: ' logged_out_player_identity_key' , constraint: ' unique' , columns: [' identity' ] },
352353 { name: ' logged_out_player_name_key' , constraint: ' unique' , columns: [' name' ] },
353- { name: ' logged_out_player_player_id_key' , constraint: ' unique' , columns: [' player_id ' ] },
354+ { name: ' logged_out_player_player_id_key' , constraint: ' unique' , columns: [' playerId ' ] },
354355 ],
355- }, PlayerRow ),
356+ }, LoggedOutPlayerRow ),
356357 __table ({
357358 name: ' person' ,
358359 indexes: [
@@ -398,7 +399,7 @@ const tablesSchema = __schema(
398399 constraints: [
399400 { name: ' player_identity_key' , constraint: ' unique' , columns: [' identity' ] },
400401 { name: ' player_name_key' , constraint: ' unique' , columns: [' name' ] },
401- { name: ' player_player_id_key' , constraint: ' unique' , columns: [' player_id ' ] },
402+ { name: ' player_player_id_key' , constraint: ' unique' , columns: [' playerId ' ] },
402403 ],
403404 }, PlayerRow ),
404405 __table ({
@@ -411,7 +412,7 @@ const tablesSchema = __schema(
411412 ],
412413 constraints: [
413414 ],
414- }, PointRow ),
415+ }, PointsRow ),
415416 __table ({
416417 name: ' private_table' ,
417418 indexes: [
@@ -427,7 +428,7 @@ const tablesSchema = __schema(
427428 ] },
428429 ],
429430 constraints: [
430- { name: ' repeating_test_arg_scheduled_id_key' , constraint: ' unique' , columns: [' scheduled_id ' ] },
431+ { name: ' repeating_test_arg_scheduled_id_key' , constraint: ' unique' , columns: [' scheduledId ' ] },
431432 ],
432433 }, RepeatingTestArgRow ),
433434 __table ({
@@ -467,16 +468,17 @@ const tablesSchema = __schema(
467468 ],
468469 constraints: [
469470 ],
470- }, TestFoobarRow ),
471+ }, TestFRow ),
471472 __table ({
472473 name: ' my_player' ,
473474 indexes: [
474475 ],
475476 constraints: [
476477 ],
477- }, PlayerRow ),
478+ }, MyPlayerRow ),
478479);
479480
481+ /** The schema information for all reducers in this module. This is defined the same way as the reducers would have been defined in the server, except the body of the reducer is omitted in code generation. */
480482const reducersSchema = __reducers (
481483 __reducerSchema (" add" , Add ),
482484 __reducerSchema (" add_player" , AddPlayer ),
@@ -493,6 +495,7 @@ const reducersSchema = __reducers(
493495 __reducerSchema (" test_btree_index_args" , TestBtreeIndexArgs ),
494496);
495497
498+ /** The remote SpacetimeDB module schema, both runtime and type information. */
496499const REMOTE_MODULE = {
497500 versionInfo: {
498501 cliVersion: " 1.9.0" as const ,
@@ -504,27 +507,37 @@ const REMOTE_MODULE = {
504507 typeof reducersSchema .reducersType
505508> ;
506509
510+ /** The tables available in this remote SpacetimeDB module. */
507511export const tables = __convertToAccessorMap (tablesSchema .schemaType .tables );
508- export const reducers = __convertToAccessorMap (reducersSchema .reducersType .reducers );
509512
513+ /** The reducers available in this remote SpacetimeDB module. */
514+ export const reducers = __convertToAccessorMap (reducersSchema .reducersType .reducers );
510515
516+ /** The context type returned in callbacks for all possible events. */
511517export type EventContext = __EventContextInterface <typeof REMOTE_MODULE >;
518+ /** The context type returned in callbacks for reducer events. */
512519export type ReducerEventContext = __ReducerEventContextInterface <typeof REMOTE_MODULE >;
520+ /** The context type returned in callbacks for subscription events. */
513521export type SubscriptionEventContext = __SubscriptionEventContextInterface <typeof REMOTE_MODULE >;
522+ /** The context type returned in callbacks for error events. */
514523export type ErrorContext = __ErrorContextInterface <typeof REMOTE_MODULE >;
524+ /** The subscription handle type to manage active subscriptions created from a {@link SubscriptionBuilder } . */
525+ export type SubscriptionHandle = __SubscriptionHandleImpl <typeof REMOTE_MODULE >;
515526
516- export class SubscriptionBuilder extends __SubscriptionBuilderImpl <
517- typeof REMOTE_MODULE
518- > {}
527+ /** Builder class to configure a new subscription to the remote SpacetimeDB instance. */
528+ export class SubscriptionBuilder extends __SubscriptionBuilderImpl <typeof REMOTE_MODULE > {}
519529
520- export class DbConnectionBuilder extends __DbConnectionBuilder <
521- DbConnection
522- > {}
530+ /** Builder class to configure a new database connection to the remote SpacetimeDB instance. */
531+ export class DbConnectionBuilder extends __DbConnectionBuilder <DbConnection > {}
523532
533+ /** The typed database connection to manage connections to the remote SpacetimeDB instance. This class has type information specific to the generated module. */
524534export class DbConnection extends __DbConnectionImpl <typeof REMOTE_MODULE > {
535+ /** Creates a new {@link DbConnectionBuilder } to configure and connect to the remote SpacetimeDB instance. */
525536 static builder = (): DbConnectionBuilder => {
526537 return new DbConnectionBuilder (REMOTE_MODULE , (config : __DbConnectionConfig <typeof REMOTE_MODULE >) => new DbConnection (config ));
527538 };
539+
540+ /** Creates a new {@link SubscriptionBuilder } to configure a subscription to the remote SpacetimeDB instance. */
528541 subscriptionBuilder = (): SubscriptionBuilder => {
529542 return new SubscriptionBuilder (this );
530543 };
0 commit comments