DB Docs
API Reference
- Core API Reference
- Collection
- createCollection
- liveQueryCollectionOptions
- createLiveQueryCollection
- createOptimisticAction
- createTransaction
- Electric DB Collection
- electricCollectionOptions
- Query DB Collection
- queryCollectionOptions
- RxDB DB Collection
- rxdbCollectionOptions
- PowerSync Collection
- powerSyncCollectionOptions
- createIndexedDB
- indexedDBCollectionOptions
- React Hooks
- useLiveQuery
AI/LLM: This documentation page is available in plain markdown format at/db/latest/docs/reference/type-aliases/InferCollectionType.md
InferCollectionType
ts
type InferCollectionType<T> = T extends CollectionImpl<infer TOutput, infer TKey, any, any, any> ? WithVirtualProps<TOutput, TKey> : T extends CollectionOptionsIdentity<infer TOutput, infer TKey, any, any, any> ? WithVirtualProps<TOutput, TKey> : never;Defined in: packages/db/src/query/builder/types.ts:108
InferCollectionType - Extracts the TypeScript type from a CollectionImpl
This helper ensures we get the same type that was used when creating the collection itself. This can be an explicit type passed by the user or the schema output type.
Type Parameters#
T#
T