Add project revision foundation
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
export type ProjectRevisionSource =
|
||||
| "user"
|
||||
| "undo"
|
||||
| "redo"
|
||||
| "restore"
|
||||
| "migration";
|
||||
|
||||
export type ProjectChangeJsonValue =
|
||||
| null
|
||||
| boolean
|
||||
| number
|
||||
| string
|
||||
| ProjectChangeJsonValue[]
|
||||
| { [key: string]: ProjectChangeJsonValue };
|
||||
|
||||
export interface ProjectChangePayload {
|
||||
schemaVersion: number;
|
||||
data: ProjectChangeJsonValue;
|
||||
}
|
||||
|
||||
export interface AppendProjectRevisionInput {
|
||||
projectId: string;
|
||||
expectedRevision: number;
|
||||
source: ProjectRevisionSource;
|
||||
commandType: string;
|
||||
description?: string;
|
||||
actorId?: string;
|
||||
forward: ProjectChangePayload;
|
||||
inverse: ProjectChangePayload;
|
||||
}
|
||||
|
||||
export interface AppendedProjectRevision {
|
||||
revisionId: string;
|
||||
changeSetId: string;
|
||||
projectId: string;
|
||||
revisionNumber: number;
|
||||
createdAtIso: string;
|
||||
}
|
||||
|
||||
export interface ProjectRevisionStore {
|
||||
getCurrentRevision(projectId: string): number | null;
|
||||
append(input: AppendProjectRevisionInput): AppendedProjectRevision;
|
||||
}
|
||||
Reference in New Issue
Block a user