Skip to main content

LensStudio:UriHandlerPlugin

Module

Module providing URI handling plugin infrastructure for extending Lens Studio with custom URI scheme handlers.

Example

// The LensStudio:UriHandlerPlugin module lets plugins register as handlers
// for custom URI schemes. When Lens Studio receives a matching deep-link,
// the plugin's handle(uri) method is called.
//
// Descriptor adds:
// canHandle(uri: string): boolean — filter which URIs this plugin handles
//
// UriHandlerPlugin class:
// handle(uri: string): boolean — process the URI, return true if handled

export class UriHandlerPluginModuleExampleHandler extends UriHandlerPlugin {
connections: any[];
static descriptor() {
const d = new Descriptor();
d.id = 'com.docs.UriHandlerPluginModuleExample';
d.name = 'URI Handler Overview';
d.description = 'Demonstrates a minimal UriHandlerPlugin';
d.canHandle = (uri: string) => uri.startsWith('lensstudio://example/');
return d;
}
constructor(pluginSystem: Editor.PluginSystem, descriptor?: Descriptor) {
super(pluginSystem, descriptor);
this.connections = [];
}
handle(uri: string): boolean {
console.log(`Received URI: ${uri}`);
return true;
}
}

Classes

ClassDescription
DescriptorDescriptor for a URI handler plugin, including a predicate function to determine if the handler can process a given URI.
UriHandlerPluginConstructs a URI handler plugin instance bound to the given plugin system and optional descriptor.