UNPKG

@infinite-canvas-tutorial/webcomponents

Version:
23 lines (22 loc) 696 B
/** * Borrow from https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/change.ts#L399 */ /** * Encapsulates the modifications captured as `Delta`/s. */ export interface Change<T> { /** * Inverses the `Delta`s inside while creating a new `Change`. */ inverse(): Change<T>; /** * Applies the `Change` to the previous object. * * @returns a tuple of the next object `T` with applied change, and `boolean`, indicating whether the applied change resulted in a visible change. */ applyTo(previous: T, ...options: unknown[]): [T, boolean]; /** * Checks whether there are actually `Delta`s. */ isEmpty(): boolean; }