Skip to content

Instantly share code, notes, and snippets.

@tmcw
Created August 30, 2022 20:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmcw/69afb85828afa11b979f9884b06474a3 to your computer and use it in GitHub Desktop.
Save tmcw/69afb85828afa11b979f9884b06474a3 to your computer and use it in GitHub Desktop.
export interface MomentInput {
note?: string;
putFeatures: IWrappedFeatureInput[];
deleteFeatures: IWrappedFeature["id"][];
putFolders: IFolderInput[];
deleteFolders: IFolder["id"][];
}
export interface IPersistence {
useHistoryControl(): (direction: "undo" | "redo") => Promise<void>;
/**
* The main method for making changes to the map: give this
* a partial moment which can delete or add features and folders,
* and it'll implement it. Unless you specify that the change
* is quiet, the change is pushed onto the undo history.
*/
useTransact(): (
moment: Partial<MomentInput> & TransactOptions
) => Promise<void>;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment