import type { FileHandlerInfo, FileOpenResult } from "@edenapp/types"; import { AppAssociationManager } from "../app-associations"; import { FilesystemManager } from "../filesystem"; import { I18nManager } from "../i18n/I18nManager"; import { CommandRegistry, EdenEmitter, IPCBridge } from "../ipc"; import { PackageCatalog } from "../package-manager/PackageCatalog"; import { ProcessManager } from "../process-manager"; import { ViewManager } from "../view-manager"; /** * Events emitted by the FileOpenManager */ interface FileNamespaceEvents { opened: { path: string; isDirectory: boolean; appId: string; }; } /** * FileOpenManager * * Manages file type associations and handles opening files with appropriate applications. */ export declare class FileOpenManager extends EdenEmitter { private appAssociationManager; private packageCatalog; private processManager; private viewManager; private fsManager; private i18nManager; private fileOpenHandler; private mimeDetectorPromise?; private static readonly DIRECTORY_PREFERENCE_KEY; private static readonly DIRECTORY_ASSOCIATION_KEY; private static readonly MIME_DETECTION_BYTES; constructor(appAssociationManager: AppAssociationManager, packageCatalog: PackageCatalog, processManager: ProcessManager, viewManager: ViewManager, fsManager: FilesystemManager, i18nManager: I18nManager, ipcBridge: IPCBridge, commandRegistry: CommandRegistry); /** * Initialize with user preferences loaded from disk */ initialize(): Promise; /** * Normalize a file extension (lowercase, without leading dot) */ private normalizeExtension; /** * Normalize a MIME type for comparisons */ private normalizeMimeType; /** * Normalize the internal preference key for a MIME type */ private getMimePreferenceKey; /** * Normalize the internal preference key for a file extension */ private getExtensionPreferenceKey; private getPublicPreferenceKey; private getAssociationKind; /** * Get the file extension from a path (lowercase, without dot) */ private getExtension; /** * Resolve file metadata used for matching and preference lookup */ private getFileContext; /** * Lazily create the shared WASMagic MIME detector */ private getMimeDetector; /** * Detect the MIME type from file contents */ private detectMimeType; /** * Get installed apps that expose file handlers */ private getInstalledFileHandlers; /** * Check whether a handler supports a file extension */ private handlerSupportsExtension; /** * Score a MIME pattern match for sorting */ private getMimeMatchScore; /** * Get matching handlers for the provided file metadata */ private getMatchingHandlers; /** * Resolve the handler app ID for a file or directory */ private resolveUserPreference; /** * Resolve the handler app ID for a file or directory */ private resolveHandler; /** * Get the default handler app for a file path */ getHandlerForPath(filePath: string): Promise; /** * Set user preference for a file path */ setDefaultHandler(filePath: string, appId: string): Promise; /** * Remove user preference for a file path (revert to default) */ removeDefaultHandler(filePath: string): Promise; /** * Helper to resolve localized app name to string */ private getAppName; /** * Get all apps that can handle a specific file path */ getSupportedHandlers(filePath: string): Promise; /** * Get all file type associations */ getAllAssociations(): Record; /** * Open a file with its default handler */ private focusRunningApp; /** * Open a file with its default handler */ openFile(filePath: string): Promise; /** * Open a file with a specific app */ openFileWith(filePath: string, appId: string): Promise; } export {}; //# sourceMappingURL=FileOpenManager.d.ts.map