declare class EventEmitter { private events; on(eventName: string, listener: Function): void; off(eventName: string, listener: Function): void; emit(eventName: string, ...args: any[]): void; setMaxListeners(n: number): void; } import { IKernel, IKernelOptions } from "./types"; export { KernelEvents } from "./types"; export type { IKernel, IKernelOptions, IFileSystemMountOptions, IKernelExecuteOptions, IMessage, IEventData, IEventEmitter, INativeFSHandle } from "./types"; export { KernelMode, KernelLanguage } from "./manager"; export declare class Kernel extends EventEmitter implements IKernel { private pyodide; private initialized; private initPromise; private filesystemOptions; private lockFileURL?; private _kernel; private _interpreter; private _stdout_stream; private _stderr_stream; private _resolveInputReply; private _parent_header; private executionCount; private _status; private _interruptBuffer; private _interruptSupported; private environmentVariables; private nativeFsHandles; private autoSyncFs; private readonly kernelId; constructor(); getStatus(): Promise<"active" | "busy" | "unknown">; /** * Initialize the kernel with maximum performance optimizations * OPTIMIZED: Full parallelization with smart caching and performance monitoring */ initialize(options?: IKernelOptions): Promise; /** * Initialize the kernel with maximum performance optimizations * OPTIMIZED: Full parallelization with smart caching and performance monitoring */ private _initializeInternal; /** * Mount the local filesystem to the Pyodide environment */ private mountFileSystem; /** * Initialize the Pyodide package manager with optimized wheel loading * OPTIMIZED: Smart caching and parallel wheel installation */ private initPackageManager; /** * Initialize the kernel with required Python packages * OPTIMIZED: Maximum parallelization with intelligent dependency resolution */ private initKernel; /** * Install packages with intelligent optimization and advanced caching * OPTIMIZED: Smart source selection, parallel installation, and performance monitoring */ private installPackagesWithIntelligentOptimization; /** * Install package via pip with performance optimizations */ private installViaPipWithOptimizations; /** * Analyze installation results and provide performance insights */ private analyzeInstallationResults; /** * Initialize global objects from the pyodide_kernel package * Based on the PyodideRemoteKernel implementation */ private initGlobals; /** * Setup all necessary callbacks for the Python environment */ private setupCallbacks; /** * Process a message from Python environment */ private _sendMessage; /** * Process a message by emitting the appropriate event */ private _processMessage; /** * Check if the kernel has been initialized */ isInitialized(): boolean; /** * Makes sure pyodide is ready before continuing, and cache the parent message. */ private setup; /** * Execute code in the kernel with proper message-based completion detection * * @param code The code to execute * @param parent Parent message header * @returns The result of the execution */ execute(code: string, parent?: any): Promise<{ success: boolean; outputs?: any; error?: Error; ename?: string; evalue?: string; traceback?: any; }>; /** * Format the result from the Pyodide evaluation * Based on PyodideRemoteKernel implementation */ private formatResult; /** * Convert a Map to a JavaScript object recursively * Based on PyodideRemoteKernel implementation */ private mapToObject; /** * Handle input reply from user */ inputReply(content: { value: string; }): Promise; /** * Send a input request to the front-end. */ private sendInputRequest; /** * Get password input (with hidden input) */ private getpass; /** * Get text input */ private input; /** * Send a comm message to the front-end. */ private sendComm; /** * Complete the code submitted by a user. */ complete(code: string, cursor_pos: number, parent?: any): Promise; /** * Inspect the code submitted by a user. */ inspect(code: string, cursor_pos: number, detail_level: 0 | 1, parent?: any): Promise; /** * Check code for completeness. */ isComplete(code: string, parent?: any): Promise; /** * Get information about available comms. */ commInfo(target_name: string | null, parent?: any): Promise; /** * Open a COMM */ commOpen(content: any, parent?: any): Promise; /** * Send a message through a COMM */ commMsg(content: any, parent?: any): Promise; /** * Close a COMM */ commClose(content: any, parent?: any): Promise; /** * Execute Python code with streaming output * @param code The Python code to execute * @param parent Parent message header * @returns AsyncGenerator yielding intermediate outputs and finally the execution result */ executeStream(code: string, parent?: any): AsyncGenerator; interrupt(): Promise; setInterruptBuffer(buffer: Uint8Array): void; /** * Verify and request permission for a file system handle * @private */ private verifyPermission; /** * Mount a native file system directory into the Pyodide filesystem * @param mountPath The path where the directory should be mounted in the Python filesystem * @param dirHandle Optional FileSystemDirectoryHandle. If null/undefined, shows directory picker * @param permission Permission mode: * - 'read': Read-only access, no syncing capabilities, auto-sync will be skipped (default) * - 'readwrite': Full read/write access with syncing capabilities * @returns Promise resolving to a handle with syncfs() method for syncing changes * @note syncfs() will throw an error if called on a read-only mounted filesystem * @note Many browsers only offer read permission initially. Explicitly request 'readwrite' if you need write access. */ mountFS(mountPath: string, dirHandle?: FileSystemDirectoryHandle | null, permission?: 'read' | 'readwrite'): Promise<{ syncfs: () => Promise; }>; /** * Sync all mounted native filesystems with permission recovery * Only syncs filesystems mounted with 'readwrite' permission * @private */ private syncAllNativeFs; /** * Get information about mounted native filesystems and their permission status * @returns Array of mounted filesystem information */ getMountedFileSystems(): Array<{ mountPath: string; permission: 'read' | 'readwrite'; canSync: boolean; }>; /** * Manually sync a specific mounted filesystem * @param mountPath The path of the mounted filesystem to sync * @returns Promise resolving to success status */ syncFileSystem(mountPath: string): Promise<{ success: boolean; error?: string; }>; /** * Upgrade a mounted filesystem from read-only to read-write permission * @param mountPath The path of the mounted filesystem to upgrade * @returns Promise resolving to success status */ upgradeFileSystemPermission(mountPath: string): Promise<{ success: boolean; error?: string; }>; /** * Set environment variables with performance optimization * OPTIMIZED: Parallel variable setting and validation with proper escaping and edge case handling */ private setEnvironmentVariables; } export { KernelManager } from "./manager"; //# sourceMappingURL=index.d.ts.map