Preparing search index...

    Constructs a URI handler plugin instance bound to the given plugin system and optional descriptor.

    // UriHandlerPlugin is the base class for plugins that respond to custom
    // URI deep-links.
    //
    // Members:
    // handle(uri: string): boolean — process the URI, return true if handled
    // pluginSystem (readonly) — access to the plugin system

    export class UriHandlerPluginClassExampleHandler extends UriHandlerPlugin {
    connections: any[];
    static descriptor() {
    const d = new Descriptor();
    d.id = 'com.docs.UriHandlerPluginClassExample';
    d.name = 'URI Handler Class Example';
    d.description = 'Demonstrates UriHandlerPlugin class with handle()';
    d.canHandle = (uri: string) => uri.startsWith('lensstudio://action/');
    return d;
    }
    constructor(pluginSystem: Editor.PluginSystem, descriptor?: Descriptor) {
    super(pluginSystem, descriptor);
    this.connections = [];
    }
    handle(uri: string): boolean {
    const action = uri.replace('lensstudio://action/', '');
    console.log(`Processing action: ${action}`);
    // Return true to indicate the URI was handled
    return true;
    }
    }

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    id: string
    pluginSystem: PluginSystem

    The PluginSystem instance this plugin is registered with.

    Methods

    • Returns the name of this object's type.

      Returns string

    • Handles a URI string and returns whether it was successfully processed.

      Parameters

      • uri: string

      Returns boolean

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

      Parameters

      • type: string

      Returns boolean

    • Returns true if this object refers to the same instance as the given object.

      Parameters

      Returns boolean