Improve typing

Signed-off-by: Philipp Hugenroth <philipph@spotify.com>
This commit is contained in:
Philipp Hugenroth
2023-07-18 14:53:57 +02:00
committed by Patrik Oldsberg
parent 879b1aa6f5
commit 12c3fadb6d
2 changed files with 9 additions and 2 deletions
+8 -1
View File
@@ -14,9 +14,16 @@
* limitations under the License.
*/
type Modules = Array<{
name: string;
module: object; // Loaded Webpack Module of Backstage Plugin
}>;
function getAvailablePlugins() {
return __webpack_require__(
const { modules }: { modules: Modules } = __webpack_require__(
'./node_modules/backstage-autodetected-plugins.js',
);
return modules;
}
export { getAvailablePlugins };
@@ -79,7 +79,7 @@ export const InfoContent = () => {
const { about, loading, error } = useInfo();
const plugins = autodetect.getAvailablePlugins();
const availablePlugins: PackageDependency[] = (
plugins.modules as Array<Record<string, any>>
plugins as Array<Record<string, any>>
).map(({ name, module }) => {
const pluginImpl: any = Object.values(module).find((v: any) => !!v?.getId);