import { CollectionNameFromModels, FetchResult, Models, SchemaQuery } from '@triplit/db'; /** * The fully selected type of an entity, including all fields but not relations * * @template M The type of the defined schema * @template CN The collection name * * @example * ```ts * type MyEntity = Entity * ``` */ export type Entity = Models, CN extends CollectionNameFromModels = CollectionNameFromModels> = QueryResult; /** * The type for the result returned from a query. This is also useful for creating types for data. * * @template M The type of the defined schema * @template Q A valid query for the schema M * * @example * ```ts * type MyFilteredEntity = QueryResult< * typeof schema, * { * collectionName: 'todos'; * select: ['id', 'title', 'done']; * include: { assignee: true }; * }>; * ``` */ export type QueryResult = Models, Q extends SchemaQuery = SchemaQuery> = NonNullable>;