1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/src/extensions/extension-discovery/bundled-extension-token.ts
Sebastian Malton 2000d9b32e
Massively simplify bundled extension loading (#6787)
* Switch bundled extension declarations to injection token

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Change how bundled extensions are loaded

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix token file name

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix spelling

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Improve interface name

Signed-off-by: Sebastian Malton <sebastian@malton.name>

Signed-off-by: Sebastian Malton <sebastian@malton.name>
2022-12-21 16:46:51 +02:00

18 lines
600 B
TypeScript

/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectionToken } from "@ogre-tools/injectable";
import type { LensExtensionConstructor, LensExtensionManifest } from "../lens-extension";
export interface BundledExtension {
readonly manifest: LensExtensionManifest;
main: () => LensExtensionConstructor | null;
renderer: () => LensExtensionConstructor | null;
}
export const bundledExtensionInjectionToken = getInjectionToken<BundledExtension>({
id: "bundled-extension-path",
});