mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
1 parent
24b5352614
commit
62df81d955
7 files changed
+183
-3
No files matched your search
@@ -2,6 +2,7 @@ import type { InstalledExtension } from "./extension-discovery";
|
||||
import { action, observable, reaction } from "mobx";
|
||||
import { filesystemProvisionerStore } from "../main/extension-filesystem";
|
||||
import logger from "../main/logger";
|
||||
import { LensProtocolRouter, RouteHandler } from "../main/protocol-handler";
|
||||
|
||||
export type LensExtensionId = string; // path to manifest (package.json)
|
||||
export type LensExtensionConstructor = new (...args: ConstructorParameters<typeof LensExtension>) => LensExtension;
|
||||
@@ -49,6 +50,12 @@ export class LensExtension {
|
||||
return filesystemProvisionerStore.requestDirectory(this.id);
|
||||
}
|
||||
|
||||
onProtocolRequest(pathSchema: string, handler: RouteHandler): void {
|
||||
const lpr = LensProtocolRouter.getInstance<LensProtocolRouter>();
|
||||
|
||||
lpr.extensionOn(this.id, pathSchema, handler);
|
||||
}
|
||||
|
||||
get description() {
|
||||
return this.manifest.description;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user