import type Plugin from "../../api/plugin/Plugin.ts"; import type FetchInterface from "../../api/fetch/FetchInterface.ts"; /** * Result of a {@link loadPlugin} invocation. */ export interface PluginLoadResult { /** * `true` if the module at the specified URL is a valid {@link Plugin} implementation. */ isValidPlugin: boolean; /** * Populated with the {@link Plugin} object if {@link PluginLoadResult.isValidPlugin} is `true` */ plugin: Plugin | undefined; /** * Populated if {@link PluginLoadResult.isValidPlugin} is `false` */ error?: Error; } /** * Utility function to import a specified module and validate it is a {@link Plugin} implementation. * * If the URL specified is not local filesystem (e.g. http(s)://) and the dynamic import fails with ENOENT * then the remote item will be fetched and the contents of the response will be used as the module source * i.e. a local dynamic import will be attempted. This is because the Bun runtime does not support importing * remote modules directly as per https://github.com/oven-sh/bun/issues/38 * * @param url the URL of the module to import. */ export default function loadPlugin(url: string, cacheFolder?: string, repoName?: string, fetchFn?: FetchInterface["fetch"]): Promise>; //# sourceMappingURL=PluginLoader.d.ts.map