Preparing search index...

    Represents ownership of a resource. If this object is garbage collected, or dispose() method is called – the associated resource is freed.

        // IGuard represents ownership of a registered resource.
    // Store the guard and call dispose() in stop() to unregister cleanly.
    const registry = this.pluginSystem.findInterface(
    Editor.IContextActionRegistry.interfaceId
    ) as Editor.IContextActionRegistry;
    if (Editor.isNull(registry)) {
    console.log('IContextActionRegistry not available');
    return;
    }

    const guard: Editor.IGuard = registry.registerAction(
    (ctx: Editor.IContext) => {
    console.log('Context action triggered');
    return undefined as unknown as Editor;
    }
    );
    this.guards.push(guard);
    console.log('Context action registered, guard stored for cleanup');

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    • Free the guarded resource immediately.

      Returns void

    • Returns true if the object is of the specified type.

      Parameters

      • type: string

      Returns boolean