API reference
Modules

@triplit/client - v0.2.1

Classes

Interfaces

Type Aliases

ClientFetchResult

Ƭ ClientFetchResult<C>: Map<string, ClientFetchResultEntity<C>>

Results from a query based on the query's model in the format Map<id, entity>

Type parameters

NameType
Cextends ClientQuery<any, any>

Defined in

packages/client/src/triplit-client.ts:38 (opens in a new tab)


ClientQuery

Ƭ ClientQuery<M, CN>: CollectionQuery<M, CN> & { syncStatus?: SyncStatus }

Type parameters

NameType
Mextends Models<any, any> | undefined
CNextends CollectionNameFromModels<M>

Defined in

packages/client/src/triplit-client.ts:67 (opens in a new tab)


ClientQueryBuilder

Ƭ ClientQueryBuilder<M, CN>: ReturnType<typeof ClientQueryBuilder>

Type parameters

NameType
Mextends Models<any, any> | undefined
CNextends CollectionNameFromModels<M>

Defined in

packages/client/src/triplit-client.ts:99 (opens in a new tab)


CollectionNameFromModels

Ƭ CollectionNameFromModels<M>: M extends Models<any, any> ? keyof M : M extends undefined ? string : never

Type parameters

NameType
Mextends Models<any, any> | undefined

Defined in

packages/db/dist/types/db.d.ts:113


ConnectionStatus

Ƭ ConnectionStatus: "CONNECTING" | "OPEN" | "CLOSING" | "CLOSED"

Possible values reflect the WebSocket readyState: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/readyState (opens in a new tab)

  • CONNECTING: An attempt to connect is being made
  • OPEN: The connection is open and ready to communicate
  • CLOSING: The connection is in the process of closing
  • CLOSED: The connection is closed or couldn't be opened

Defined in

packages/client/src/transport/transport.ts:11 (opens in a new tab)


FetchOptions

Ƭ FetchOptions: LocalFirstFetchOptions | LocalOnlyFetchOptions | RemoteFirstFetchOptions | RemoteOnlyFetchOptions | LocalAndRemoteFetchOptions

Defined in

packages/client/src/triplit-client.ts:133 (opens in a new tab)


LocalAndRemoteFetchOptions

Ƭ LocalAndRemoteFetchOptions: Object

Type declaration

NameType
policy"local-and-remote"
timeout?number

Defined in

packages/client/src/triplit-client.ts:129 (opens in a new tab)


LocalFirstFetchOptions

Ƭ LocalFirstFetchOptions: Object

Type declaration

NameType
policy"local-first"

Defined in

packages/client/src/triplit-client.ts:117 (opens in a new tab)


LocalOnlyFetchOptions

Ƭ LocalOnlyFetchOptions: Object

Type declaration

NameType
policy"local-only"

Defined in

packages/client/src/triplit-client.ts:120 (opens in a new tab)


ModelFromModels

Ƭ ModelFromModels<M, CN>: M extends Models<any, any> ? M[CN]["schema"] : M extends undefined ? undefined : never

Type parameters

NameType
Mextends Models<any, any> | undefined
CNextends CollectionNameFromModels<M> = any

Defined in

packages/db/dist/types/db.d.ts:112


Models

Ƭ Models<CollectionName, T>: Record<CollectionName, Collection<T>>

Type parameters

NameType
CollectionNameextends string
Textends SchemaConfig

Defined in

packages/db/dist/types/schema.d.ts:52


RemoteFirstFetchOptions

Ƭ RemoteFirstFetchOptions: Object

Type declaration

NameType
policy"remote-first"

Defined in

packages/client/src/triplit-client.ts:123 (opens in a new tab)


RemoteOnlyFetchOptions

Ƭ RemoteOnlyFetchOptions: Object

Type declaration

NameType
policy"remote-only"

Defined in

packages/client/src/triplit-client.ts:126 (opens in a new tab)


ResultTypeFromModel

Ƭ ResultTypeFromModel<M>: M extends Model<any> ? { [k in keyof ReadModelFromModel<M>["properties"]]: M["properties"][k] extends DataType ? ExtractJSType<M["properties"][k]> : never } : any

Type parameters

NameType
Mextends Model<any> | undefined

Defined in

packages/db/dist/types/schema.d.ts:71


SubscriptionOptions

Ƭ SubscriptionOptions: LocalFirstFetchOptions | LocalOnlyFetchOptions | RemoteFirstFetchOptions | LocalAndRemoteFetchOptions

Defined in

packages/client/src/triplit-client.ts:140 (opens in a new tab)


SyncStatus

Ƭ SyncStatus: "pending" | "confirmed" | "all"

Defined in

packages/client/src/triplit-client.ts:65 (opens in a new tab)


TransportConnectParams

Ƭ TransportConnectParams: Object

Type declaration

NameType
clientIdstring
schema?number
secure?boolean
server?string
syncSchema?boolean
token?string

Defined in

packages/client/src/transport/transport.ts:29 (opens in a new tab)