| 123456789101112131415161718192021222324252627282930313233 |
- import {
- Describe,
- Command,
- } from "../internal";
- export abstract class Operation<T = unknown> {
- protected _command: Command;
- abstract apply(resource: T): void;
- abstract clone(): Operation;
- abstract toJSON(): Operation.Serialize;
- public getCommand(): Command {
- return this._command;
- }
- public setCommand(command: Command): void {
- this._command = command;
- }
- public replaceOperations(...operations: Operation[]) {
- const command = this._command;
- if (command) {
- command.replaceOperations(this, operations);
- }
- }
- }
- export namespace Operation {
- export interface Serialize extends Describe {}
- }
|