Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions crates/bindings-typescript/src/angular/connection_state.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { InjectionToken, type WritableSignal } from '@angular/core';
import type { ConnectionId } from '../lib/connection_id';
import type { Identity } from '../lib/identity';
import type { DbConnectionImpl } from '../sdk/db_connection_impl';
import type { ConnectionId } from '../lib/connection_id.ts';
import type { Identity } from '../lib/identity.ts';
import type { DbConnectionImpl } from '../sdk/db_connection_impl.ts';

export interface ConnectionState {
isActive: boolean;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { assertInInjectionContext, inject, effect } from '@angular/core';
import { SPACETIMEDB_CONNECTION } from '../connection_state';
import type { ParamsType } from '../../sdk';
import type { UntypedReducerDef } from '../../sdk/reducers';
import { SPACETIMEDB_CONNECTION } from '../connection_state.ts';
import type { ParamsType } from '../../sdk/index.ts';
import type { UntypedReducerDef } from '../../sdk/reducers.ts';

export function injectReducer<ReducerDef extends UntypedReducerDef>(
reducerDef: ReducerDef
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
computed,
type Signal,
} from '@angular/core';
import { SPACETIMEDB_CONNECTION } from '../connection_state';
import { SPACETIMEDB_CONNECTION } from '../connection_state.ts';

export function injectSpacetimeDBConnected(): Signal<boolean> {
assertInInjectionContext(injectSpacetimeDBConnected);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { assertInInjectionContext, inject, type Signal } from '@angular/core';
import {
SPACETIMEDB_CONNECTION,
type ConnectionState,
} from '../connection_state';
} from '../connection_state.ts';

export function injectSpacetimeDB(): Signal<ConnectionState> {
assertInInjectionContext(injectSpacetimeDB);
Expand Down
12 changes: 6 additions & 6 deletions crates/bindings-typescript/src/angular/injectors/inject-table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ import {
effect,
type Signal,
} from '@angular/core';
import type { RowType, UntypedTableDef } from '../../lib/table';
import type { Prettify } from '../../lib/type_util';
import { SPACETIMEDB_CONNECTION } from '../connection_state';
import type { RowType, UntypedTableDef } from '../../lib/table.ts';
import type { Prettify } from '../../lib/type_util.ts';
import { SPACETIMEDB_CONNECTION } from '../connection_state.ts';
import {
type Query,
type BooleanExpr,
toSql,
evaluateBooleanExpr,
getQueryAccessorName,
getQueryWhereClause,
} from '../../lib/query';
import type { EventContextInterface } from '../../sdk';
import type { UntypedRemoteModule } from '../../sdk/spacetime_module';
} from '../../lib/query.ts';
import type { EventContextInterface } from '../../sdk/index.ts';
import type { UntypedRemoteModule } from '../../sdk/spacetime_module.ts';

export type RowTypeDef<TableDef extends UntypedTableDef> = Prettify<
RowType<TableDef>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import type {
DbConnectionImpl,
ErrorContextInterface,
RemoteModuleOf,
} from '../../sdk/db_connection_impl';
} from '../../sdk/db_connection_impl.ts';
import {
SPACETIMEDB_CONNECTION,
type ConnectionState,
} from '../connection_state';
import { ConnectionId } from '../../lib/connection_id';
} from '../connection_state.ts';
import { ConnectionId } from '../../lib/connection_id.ts';

let connRef: DbConnectionImpl<any> | null = null;

Expand Down
32 changes: 16 additions & 16 deletions crates/bindings-typescript/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
export * from './lib/connection_id';
export * from './lib/errors';
export * from './lib/algebraic_type';
export * from './lib/algebraic_value';
export { default as BinaryReader } from './lib/binary_reader';
export { default as BinaryWriter } from './lib/binary_writer';
export * from './lib/schedule_at';
export * from './lib/time_duration';
export * from './lib/timestamp';
export * from './lib/uuid';
export * from './lib/util';
export * from './lib/identity';
export * from './lib/option';
export * from './lib/result';
export * from './lib/query';
export * from './sdk';
export * from './lib/connection_id.ts';
export * from './lib/errors.ts';
export * from './lib/algebraic_type.ts';
export * from './lib/algebraic_value.ts';
export { default as BinaryReader } from './lib/binary_reader.ts';
export { default as BinaryWriter } from './lib/binary_writer.ts';
export * from './lib/schedule_at.ts';
export * from './lib/time_duration.ts';
export * from './lib/timestamp.ts';
export * from './lib/uuid.ts';
export * from './lib/util.ts';
export * from './lib/identity.ts';
export * from './lib/option.ts';
export * from './lib/result.ts';
export * from './lib/query.ts';
export * from './sdk/index.ts';
18 changes: 9 additions & 9 deletions crates/bindings-typescript/src/lib/algebraic_type.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { TimeDuration } from './time_duration';
import { Timestamp } from './timestamp';
import { Uuid } from './uuid';
import { ConnectionId } from './connection_id';
import BinaryReader from './binary_reader';
import BinaryWriter from './binary_writer';
import { Identity } from './identity';
import * as AlgebraicTypeVariants from './algebraic_type_variants';
import { hasOwn } from './util';
import { TimeDuration } from './time_duration.ts';
import { Timestamp } from './timestamp.ts';
import { Uuid } from './uuid.ts';
import { ConnectionId } from './connection_id.ts';
import BinaryReader from './binary_reader.ts';
import BinaryWriter from './binary_writer.ts';
import { Identity } from './identity.ts';
import * as AlgebraicTypeVariants from './algebraic_type_variants.ts';
import { hasOwn } from './util.ts';

type TypespaceType = {
types: AlgebraicTypeType[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type {
AlgebraicTypeType,
ProductTypeType,
SumTypeType,
} from './algebraic_type';
} from './algebraic_type.ts';

export type Ref = { tag: 'Ref'; value: number };
export type Sum = { tag: 'Sum'; value: SumTypeType };
Expand Down
2 changes: 1 addition & 1 deletion crates/bindings-typescript/src/lib/algebraic_value.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import BinaryReader from './binary_reader';
import BinaryReader from './binary_reader.ts';

export interface ParseableType<T> {
deserialize: (reader: BinaryReader) => T;
Expand Down
2 changes: 1 addition & 1 deletion crates/bindings-typescript/src/lib/autogen/types.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions crates/bindings-typescript/src/lib/connection_id.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { AlgebraicType } from './algebraic_type';
import { AlgebraicType } from './algebraic_type.ts';
import {
coerceToBigInt,
hexStringToU128,
u128ToHexString,
u128ToUint8Array,
} from './util';
} from './util.ts';

export type ConnectionIdAlgebraicType = {
tag: 'Product';
Expand Down
6 changes: 3 additions & 3 deletions crates/bindings-typescript/src/lib/constraints.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { table, UntypedTableDef } from './table';
import type { ColumnMetadata } from './type_builders';
import type { table, UntypedTableDef } from './table.ts';
import type { ColumnMetadata } from './type_builders.ts';

/**
* A helper type to determine if all columns in an index are unique.
Expand Down Expand Up @@ -44,5 +44,5 @@ export type ColumnIsUnique<M extends ColumnMetadata<any>> = M extends
* of constraint definitions.
*/
export type ConstraintOpts<AllowedCol extends string> = {
name?: string;
name?: string | undefined;
} & { constraint: 'unique'; columns: [AllowedCol] };
2 changes: 1 addition & 1 deletion crates/bindings-typescript/src/lib/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {
StringBuilder,
TypeBuilder,
t,
} from './type_builders';
} from './type_builders.ts';

/** Only strings and simple, payload-free enums constrain environment strings. */
export type EnvironmentString =
Expand Down
6 changes: 3 additions & 3 deletions crates/bindings-typescript/src/lib/filter.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { RowType, UntypedTableDef } from './table';
import { Timestamp } from './timestamp';
import { Uuid } from './uuid';
import type { RowType, UntypedTableDef } from './table.ts';
import { Timestamp } from './timestamp.ts';
import { Uuid } from './uuid.ts';

export type Value = string | number | boolean | Uuid | Timestamp;

Expand Down
4 changes: 2 additions & 2 deletions crates/bindings-typescript/src/lib/identity.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { AlgebraicType } from './algebraic_type';
import { AlgebraicType } from './algebraic_type.ts';
import {
coerceToBigInt,
hexStringToU256,
u256ToHexString,
u256ToUint8Array,
} from './util';
} from './util.ts';

export type IdentityAlgebraicType = {
tag: 'Product';
Expand Down
12 changes: 6 additions & 6 deletions crates/bindings-typescript/src/lib/indexes.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import type { RowType, table, UntypedTableDef } from './table';
import type { ColumnMetadata, IndexTypes } from './type_builders';
import type { CollapseTuple, Prettify } from './type_util';
import { Range } from '../server/range';
import type { ColumnIsUnique } from './constraints';
import type { RowType, table, UntypedTableDef } from './table.ts';
import type { ColumnMetadata, IndexTypes } from './type_builders.ts';
import type { CollapseTuple, Prettify } from './type_util.ts';
import { Range } from '../server/range.ts';
import type { ColumnIsUnique } from './constraints.ts';

/**
* Index helper type used *inside* {@link table} to enforce that only
* existing column names are referenced.
*/
export type IndexOpts<AllowedCol extends string> = {
accessor: string;
name?: string;
name?: string | undefined;
} & (
| { algorithm: 'btree'; columns: readonly AllowedCol[] }
| { algorithm: 'hash'; columns: readonly AllowedCol[] }
Expand Down
2 changes: 1 addition & 1 deletion crates/bindings-typescript/src/lib/option.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AlgebraicType } from './algebraic_type';
import { AlgebraicType } from './algebraic_type.ts';

export type OptionAlgebraicType<T extends AlgebraicType = AlgebraicType> = {
tag: 'Sum';
Expand Down
22 changes: 11 additions & 11 deletions crates/bindings-typescript/src/lib/query.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { ConnectionId } from './connection_id';
import { Identity } from './identity';
import type { ColumnIndex, IndexColumns, IndexOpts } from './indexes';
import type { UntypedSchemaDef } from './schema';
import type { UntypedTableDef } from './table';
import type { UntypedTableSchema } from './table_schema';
import { Timestamp } from './timestamp';
import { ConnectionId } from './connection_id.ts';
import { Identity } from './identity.ts';
import type { ColumnIndex, IndexColumns, IndexOpts } from './indexes.ts';
import type { UntypedSchemaDef } from './schema.ts';
import type { UntypedTableDef } from './table.ts';
import type { UntypedTableSchema } from './table_schema.ts';
import { Timestamp } from './timestamp.ts';
import type {
ColumnBuilder,
ColumnMetadata,
RowBuilder,
TypeBuilder,
} from './type_builders';
import type { Values } from './type_util';
import type { Bool as SatsBool } from './algebraic_type_variants';
import { Uuid } from './uuid';
} from './type_builders.ts';
import type { Values } from './type_util.ts';
import type { Bool as SatsBool } from './algebraic_type_variants.ts';
import { Uuid } from './uuid.ts';

/**
* Helper to get the set of table names.
Expand Down
10 changes: 5 additions & 5 deletions crates/bindings-typescript/src/lib/reducer_schema.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { ProductType } from './algebraic_type';
import type { RawReducerDefV9 } from './autogen/types';
import type { ParamsObj } from './reducers';
import type { RowBuilder, RowObj } from './type_builders';
import type { CamelCase } from './type_util';
import type { ProductType } from './algebraic_type.ts';
import type { RawReducerDefV9 } from './autogen/types.ts';
import type { ParamsObj } from './reducers.ts';
import type { RowBuilder, RowObj } from './type_builders.ts';
import type { CamelCase } from './type_util.ts';

/**
* Represents a handle to a database reducer, including its name and argument type.
Expand Down
16 changes: 8 additions & 8 deletions crates/bindings-typescript/src/lib/reducers.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import type { EnvironmentFor } from './environment';
import type { DbView } from '../server/db_view';
import type { Random } from '../server/rng';
import type { ConnectionId } from './connection_id';
import type { Identity } from './identity';
import { type UntypedSchemaDef } from './schema';
import { type Timestamp } from './timestamp';
import type { EnvironmentFor } from './environment.ts';
import type { DbView } from '../server/db_view.ts';
import type { Random } from '../server/rng.ts';
import type { ConnectionId } from './connection_id.ts';
import type { Identity } from './identity.ts';
import { type UntypedSchemaDef } from './schema.ts';
import { type Timestamp } from './timestamp.ts';
import {
ColumnBuilder,
type InferTypeOfRow,
type TypeBuilder,
} from './type_builders';
} from './type_builders.ts';
import { Uuid } from './uuid.ts';

/**
Expand Down
2 changes: 1 addition & 1 deletion crates/bindings-typescript/src/lib/result.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AlgebraicType } from './algebraic_type';
import { AlgebraicType } from './algebraic_type.ts';

export type ResultAlgebraicType<
T extends AlgebraicType = AlgebraicType,
Expand Down
9 changes: 6 additions & 3 deletions crates/bindings-typescript/src/lib/schedule_at.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { AlgebraicType } from './algebraic_type';
import { TimeDuration, type TimeDurationAlgebraicType } from './time_duration';
import { Timestamp, type TimestampAlgebraicType } from './timestamp';
import { AlgebraicType } from './algebraic_type.ts';
import {
TimeDuration,
type TimeDurationAlgebraicType,
} from './time_duration.ts';
import { Timestamp, type TimestampAlgebraicType } from './timestamp.ts';

export type ScheduleAtAlgebraicType = {
tag: 'Sum';
Expand Down
14 changes: 7 additions & 7 deletions crates/bindings-typescript/src/lib/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ import {
SumType,
type AlgebraicTypeType,
type AlgebraicTypeVariants,
} from './algebraic_type';
} from './algebraic_type.ts';
import type {
CaseConversionPolicy,
RawSubmoduleV10,
RawModuleDefV10,
RawModuleDefV10Section,
RawScopedTypeNameV10,
RawTableDefV10,
} from './autogen/types';
import type { UntypedIndex } from './indexes';
import type { UntypedTableDef } from './table';
import type { UntypedTableSchema } from './table_schema';
} from './autogen/types.ts';
import type { UntypedIndex } from './indexes.ts';
import type { UntypedTableDef } from './table.ts';
import type { UntypedTableSchema } from './table_schema.ts';
import {
ArrayBuilder,
OptionBuilder,
Expand All @@ -31,8 +31,8 @@ import {
type InferSpacetimeTypeOfTypeBuilder,
type RowObj,
type VariantsObj,
} from './type_builders';
import type { Values } from './type_util';
} from './type_builders.ts';
import type { Values } from './type_util.ts';

export type TableNamesOf<S extends UntypedSchemaDef> = Values<
S['tables']
Expand Down
Loading
Loading