UNPKG

convex

Version:

Client for the Convex Cloud

41 lines 1.36 kB
import { GenericId } from "@convex-dev/common"; import { DistributiveOmit, Expand } from "../type_utils"; import { GenericDocument } from "./data_model"; /** * The fields that Convex automatically adds to documents, not including `_id`. * * This is an object type mapping field name to field type. * @public */ export declare type SystemFields = { _creationTime: number; }; /** * The `_id` field that Convex automatically adds to documents. * @public */ export declare type IdField<TableName extends string> = { _id: GenericId<TableName>; }; /** * A Convex document with the system fields like `_id` and `_creationTime` omitted. * * @public */ export declare type WithoutSystemFields<Document extends GenericDocument> = Expand<DistributiveOmit<Document, keyof SystemFields | "_id">>; /** * A Convex document with the system fields like `_id` and `_creationTime` optional. * * @public */ export declare type WithOptionalSystemFields<Document extends GenericDocument> = Expand<WithoutSystemFields<Document> & Partial<Pick<Document, keyof SystemFields | "_id">>>; /** * The indexes that Convex automatically adds to every table. * * This is an object mapping index names to index field paths. * @public */ export declare type SystemIndexes = { by_creation_time: ["_creationTime"]; }; //# sourceMappingURL=system_fields.d.ts.map