Preparing search index...

    Descriptor for a URI handler plugin, including a predicate function to determine if the handler can process a given URI.

    // UriHandlerPlugin Descriptor extends BaseDescriptor with:
    //
    // canHandle: (uri: string) => boolean
    // Callback that determines whether this handler can process the given URI.
    // Set this before returning the descriptor from the static descriptor() method.

    export class UriHandlerDescriptorExampleHandler extends UriHandlerPlugin {
    connections: any[];
    static descriptor() {
    const d = new Descriptor();
    d.id = 'com.docs.UriHandlerDescriptorExample';
    d.name = 'URI Descriptor Example';
    d.description = 'Demonstrates UriHandlerPlugin Descriptor with canHandle';
    // canHandle filters which URIs route to this plugin
    d.canHandle = (uri: string) => {
    return uri.startsWith('lensstudio://docs/');
    };
    return d;
    }
    constructor(pluginSystem: Editor.PluginSystem, descriptor?: Descriptor) {
    super(pluginSystem, descriptor);
    this.connections = [];
    }
    handle(uri: string): boolean {
    const path = uri.replace('lensstudio://docs/', '');
    console.log(`Handling docs URI path: ${path}`);
    return true;
    }
    }

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    canHandle: (arg1: string) => any

    Callback that determines whether this handler can instantiate the given asset.

    dependencies: InterfaceId[]

    Array of interface IDs that this plugin requires to function.

    description: string

    Human-readable description of the plugin shown in the plugin manager.

    id: string

    Unique identifier for the plugin, typically in reverse domain notation.

    interfaces: InterfaceId[]

    Array of interface IDs that this plugin provides or implements.

    name: string

    Display name of the plugin.

    Methods

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

      Parameters

      • type: string

      Returns boolean