@adobe/data - v0.10.30
    Preparing search index...

    Interface UndoRedoService<C>

    A service is an object that provides functionality to an application. Services are never dependent upon user interface components. Services come in several varieties:

    • Frontend Services
      • Only contain void actions and observe functions.
      • Async nature enforces unidirectional control flow and decouples the service from the UI.
    • Backend Services
      • Usually consumed by other services.
      • May also contain Promise or AsyncGenerator functions.

    A service's shape can be described by a Schema (an object schema whose property schemas describe each member). The schema is authored beside the service (e.g. MyService.schema) and validated with IsValidWithCompleteSchema; a factory may also expose it at runtime via the optional schema slot for introspection. It is Observe<Schema> — observable — because a service's discoverable interface can change at runtime (e.g. once an iframe-projected service loads and reveals a different surface). Both serviceName and schema are base-Service metadata, so they are excluded from AsyncDataService.IsValid (which is why schema need not be Data) and reserved as member names. See async-data-service/is-valid-with-*-schema.ts.

    interface UndoRedoService<C = unknown> {
        redo: () => void;
        redoEnabled: Observe<boolean>;
        schema?: Observe<Schema.Schema>;
        serviceName?: string;
        undo: () => void;
        undoEnabled: Observe<boolean>;
        undoStack: Observe<TransactionResult<C>[]>;
        undoStackIndex: Observe<number>;
    }

    Type Parameters

    • C = unknown

    Hierarchy (View Summary)

    Index

    Properties

    redo: () => void
    redoEnabled: Observe<boolean>

    Optional observable of the service's schema (its authored contract), which may change at runtime as the service's discoverable interface evolves.

    serviceName?: string
    undo: () => void
    undoEnabled: Observe<boolean>
    undoStack: Observe<TransactionResult<C>[]>
    undoStackIndex: Observe<number>