import { createContext } from '.' export interface ImportableLauncher { name: string path: string instances: string[] } export interface InstanceImportProvider { /** Returns launchers with instances already populated (one round trip on mount) */ getDetectedLaunchers: () => Promise /** Only needed for manually-added launcher paths */ getImportableInstances: (launcherName: string, path: string) => Promise /** Perform the actual import */ importInstances: ( selections: { launcher: string; path: string; instanceNames: string[] }[], ) => Promise /** Open a directory picker (platform-specific) */ selectDirectory: () => Promise } export const [injectInstanceImport, provideInstanceImport] = createContext('InstanceImport')