Skip to content
Source
Sign inSign up
TanStack/db
Open History to see the last commit

InferCollectionType.md

23 lines666 Bytes

Type Alias: InferCollectionType<T>

type InferCollectionType<T> = T extends CollectionImpl<infer TOutput, infer TKey, any, any, any> ? WithVirtualProps<TOutput, TKey> : never;

Defined in: packages/db/src/query/builder/types.ts:89

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