1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/packages/core/src/extensions/extension-discovery/bundled-extension-token.ts
Sebastian Malton e3c0bc34fd Introduce clearer boundry between extensions
- Bundled extensions are always enabled, and are always compatible
- Have bundled extensions be loaded asyncronously to support
  typescript dynamic import (which is typed) as opposed to require

Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-03-01 12:32:33 -05:00

18 lines
650 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 { BundledLensExtensionManifest, BundledLensExtensionContructor } from "../lens-extension";
export interface BundledExtension {
readonly manifest: BundledLensExtensionManifest;
main: () => Promise<BundledLensExtensionContructor | null>;
renderer: () => Promise<BundledLensExtensionContructor | null>;
}
export const bundledExtensionInjectionToken = getInjectionToken<BundledExtension>({
id: "bundled-extension-path",
});