alinea
Version:
Headless git-based CMS
40 lines (39 loc) • 1.02 kB
TypeScript
import type { EntryStatus } from './Entry.js';
import type { Entry } from './Entry.js';
export interface EntryMeta {
_id: string;
_type: string;
_index: string;
_root?: string;
_seeded?: string;
}
export interface EntryRecord extends EntryMeta {
[field: string]: unknown;
}
export declare namespace EntryRecord {
const id = "_id";
const type = "_type";
const index = "_index";
const root = "_root";
const seeded = "_seeded";
}
export interface RequiredEntryFields extends Partial<Entry> {
id: string;
type: string;
index: string;
data: Record<string, any>;
}
export declare function parseRecord(record: EntryRecord): {
meta: {
id: string;
type: string;
index: string;
root: string | undefined;
seeded: string | undefined;
};
data: {
[field: string]: unknown;
};
v0Id: string | undefined;
};
export declare function createRecord(entry: RequiredEntryFields, status: EntryStatus): EntryRecord;