convex
Version:
Client for the Convex Cloud
47 lines • 1.56 kB
TypeScript
import { GenericId } from "../values/index.js";
import { BetterOmit, 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<BetterOmit<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"];
};
/**
* Convex automatically appends "_creationTime" to the end of every index to
* break ties if all of the other fields are identical.
* @public
*/
export declare type IndexTiebreakerField = "_creationTime";
//# sourceMappingURL=system_fields.d.ts.map