alinea
Version:
Headless git-based CMS
54 lines (53 loc) • 2.02 kB
TypeScript
import type { Infer } from 'alinea';
import type { Type } from 'alinea/core/Type';
import type { UploadResponse } from '../Connection.js';
import type { EntryFields } from '../EntryFields.js';
import { Graph } from '../Graph.js';
import type { Mutation } from './Mutation.js';
import { type ArchiveQuery, type CreateQuery, type DiscardQuery, type MoveQuery, type Operation, type PublishQuery, type UnpublishQuery, type UpdateQuery, type UploadQuery } from './Operation.js';
export declare abstract class WriteableGraph extends Graph {
abstract mutate(mutations: Array<Mutation>): Promise<{
sha: string;
}>;
abstract prepareUpload(file: string): Promise<UploadResponse>;
create<Definition>(create: CreateQuery<Definition>): Promise<EntryFields & Infer<Type<Definition>>>;
update<Definition>(update: UpdateQuery<Definition>): Promise<EntryFields & Infer<Type<Definition>>>;
remove(...entryIds: Array<string>): Promise<void>;
publish(publish: PublishQuery): Promise<void>;
unpublish(unpublish: UnpublishQuery): Promise<void>;
archive(archive: ArchiveQuery): Promise<void>;
move(query: MoveQuery): Promise<{
index: string;
}>;
discard(query: DiscardQuery): Promise<void>;
upload(query: UploadQuery): Promise<{
_id: string;
_type: string;
_index: string;
_workspace: string;
_root: string;
_status: import("../Entry.js").EntryStatus;
_parentId: string | null;
_locale: string | null;
_path: string;
_url: string;
_active: boolean;
title: string;
path: string;
location: string;
previewUrl: string;
extension: string;
size: number;
hash: string;
width: number;
height: number;
preview: string;
averageColor: string;
focus: {
x: number;
y: number;
};
thumbHash: string;
}>;
commit(...operations: Array<Operation>): Promise<void>;
}