UNPKG

alinea

Version:

[![npm](https://img.shields.io/npm/v/alinea.svg)](https://npmjs.org/package/alinea) [![install size](https://packagephobia.com/badge?p=alinea)](https://packagephobia.com/result?p=alinea)

90 lines (89 loc) 2.15 kB
import { EntryPhase, EntryRow } from './EntryRow.js'; export declare enum MutationProgress { Finished = "finished", Pending = "pending", Error = "error" } export declare enum MutationType { Edit = "update", Create = "create", Publish = "publish", Archive = "archive", Discard = "discard", Remove = "remove", Order = "order", Move = "move", Upload = "upload", FileRemove = "file-remove" } export type PendingMutation = Mutation & { mutationId: string; createdAt: number; }; export type Mutation = EditMutation | CreateMutation | PublishMutation | ArchiveMutation | RemoveEntryMutation | DiscardDraftMutation | OrderMutation | MoveMutation | UploadMutation | FileRemoveMutation; export interface EditMutation { type: MutationType.Edit; entryId: string; file: string; entry: EntryRow; previousFile?: string; update?: string; } export interface CreateMutation { type: MutationType.Create; entryId: string; file: string; entry: EntryRow; } export interface PublishMutation { type: MutationType.Publish; entryId: string; phase: EntryPhase; file: string; } export interface ArchiveMutation { type: MutationType.Archive; entryId: string; file: string; } export interface RemoveEntryMutation { type: MutationType.Remove; entryId: string; file: string; } export interface DiscardDraftMutation { type: MutationType.Discard; entryId: string; file: string; } export interface OrderMutation { type: MutationType.Order; entryId: string; file: string; index: string; } export interface MoveMutation { type: MutationType.Move; entryId: string; entryType: string; fromFile: string; toFile: string; parent: string; root: string; workspace: string; index: string; } export interface UploadMutation { type: MutationType.Upload; entryId: string; url: string; file: string; } export interface FileRemoveMutation { type: MutationType.FileRemove; entryId: string; file: string; workspace: string; location: string; replace: boolean; }