Skip to content

EditorVersions beta ​

Class of @v12-engine/editor

ts
export declare class EditorVersions

The versions of the map open (campaign plan EQ15): a snapshot of its file kept in this browser at each save (IndexedDB, gzipped; the last MAP_VERSIONS), what changed from one to the map as it is now in the words of map diff --text (mapChanges), and one taken back as a change to save, over the map open but not over its file. What the Versions panel shows, in code

A part of the editor, as it gives it (editor.versions)

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the EditorVersions class.

Members ​

diff ​

ts
diff(version: MapVersion): Promise<string[]>;

What changed from a version to the map as it is now, a line each (as map diff --text says it): none for the same

entries ​

ts
entries(): MapVersion[];

The versions of the map open as last listed (list), the newest first: listed again when another map is open

keep ​

ts
keep(): Promise<MapVersion | undefined>;

Keeps the map as it is now as a version of it, as it was just saved (what the editor does at each save): nothing for a map kept nowhere, or one the same as its newest version. Gives back what was kept

list ​

ts
list(): Promise<MapVersion[]>;

The versions kept of the map open, the newest first, read from the browser

read ​

ts
read(version: MapVersion): Promise<GameMap>;

A version's map, read from its file as it was saved

remove ​

ts
remove(version: MapVersion): Promise<void>;

Forgets a version of the map open

restore ​

ts
restore(version: MapVersion): Promise<boolean>;

Takes a version back in the place of the map open, once that may be let go of: the same map, its file and the files it brings, as a change to save (its file is not written: Ctrl+S does). False when it was not