extensions-api -- in-progress

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman committed 2020-08-31 21:37:53 +03:00
1 parent a8ce263dc9
commit e56f8f3362
6 files changed
+20 -3

No files matched your search

@@ -0,0 +1,8 @@
import { LensExtension } from "@lens"; // todo: handle runtime import
export class ExampleExtension extends LensExtension {
async init(): Promise<any> {
console.log('Example extension: init')
return super.init();
}
}
@@ -2,7 +2,7 @@
"name": "extension-example",
"version": "1.0.0",
"description": "Example extension",
"main": "extension-example.ts",
"main": "example-extension.ts",
"dependencies": {
}
}
Whitespace-only changes.
+1 -2
View File
@@ -46,9 +46,8 @@ export class ExtensionStore extends BaseStore<ExtensionStoreModel> {
async removeById(id: ExtensionId) {
const extension = this.getById(id);
if (extension) {
const unInstallStatus = await extension.uninstall()
await extension.uninstall();
this.extensions.delete(id);
return unInstallStatus;
}
}
+4
View File
@@ -29,6 +29,10 @@ export class LensExtension implements ExtensionModel {
this.isEnabled = enabled;
}
async init(){
// todo?
}
async install() {
// todo
}
+6
View File
@@ -0,0 +1,6 @@
// todo: re-export / expose more apis
// todo: generate as Lens.d.js + add real runtime exports
declare module "@lens" {
export { LensExtension, ExtensionId, ExtensionVersion } from "./extension";
}