This is an extension and not part of the main GoJS library. Note that the API for this class may change at any time. If you intend to use an extension in production, you should copy the code to your own source directory. See the Extensions intro page for more information.
Optional
init: Partial<LocalStorageCommandHandler>Override
canThis functionality has been subsumed by go.CommandHandler.storageLocation in version 3.1. This predicate controls whether or not the user can invoke the pasteSelection command. This works just like go.CommandHandler.canPasteSelection, but looks at LocalStorage instead of a static variable.
Optional
pos: PointOverride
copyThis functionality has been subsumed by go.CommandHandler.storageLocation in version 3.1. Makes a copy of the given collection of go.Parts and stores it as JSON in LocalStorage.
Override
pasteThis functionality has been subsumed by go.CommandHandler.storageLocation in version 3.1. If LocalStorage holds JSON for a collection of go.Parts, and if the go.Model.dataFormat matches that stored in the clipboard, this makes a copy of the clipboard's parts and adds the copies to this go.Diagram.
a collection of newly pasted go.Parts
This CommandHandler class uses localStorage as the repository for the clipboard, rather than an in-memory global variable. It requires that the Diagram.model be serializable and deserializable using Model.toJson and Model.fromJson.
As of version 3.1, the functionality is built into the CommandHandler class. Enable it by setting CommandHandler.storageLocation to "localStorage". However, the functionality is duplicated here for compatibility with versions earlier than 3.1.
deprecated
See CommandHandler.storageLocation