import { M as MaybePromise, F as FilterPattern, p as ServerStorageName, l as SuccessResponse, m as FailResponse } from './env-config-3be2ee5d.js'; import * as _kvs_storage from '@kvs/storage'; import { Response } from 'express'; import { z } from 'zod'; interface TunnelOptions { remoteHost?: string; remotePort?: number; localHost?: string; localPort: number; shareToken?: string; } declare class Tunnel { private tunnelProcess; GRADIO_API_SERVER_URL: string; url: string | null; private remoteHost; private remotePort; private localHost; private localPort; private shareToken; constructor(options: TunnelOptions); initProcess(): Promise; startTunnel(): Promise; kill(): void; } declare function compareVersion(a: string, b: string): 1 | 0 | -1; declare function checkNodeVersion(): string | undefined; declare function canUseNodeFetchWithoutCliFlag(): boolean; declare function getRunServerEnv(): { NODE_OPTIONS: string; NODE_NO_WARNINGS: string; } | { NODE_OPTIONS?: undefined; NODE_NO_WARNINGS?: undefined; }; type LaunchEditorName = 'Atom' | 'Atom Beta' | 'subl' | 'sublime' | 'sublime_text' | 'wstorm' | 'charm' | 'notepad++' | 'vim' | 'mvim' | 'joe' | 'gvim' | 'emacs' | 'emacsclient' | 'rmate' | 'mate' | 'mine' | 'Code' | 'Code - Insiders' | 'codium' | 'vscodium' | 'VSCodium' | 'appcode' | 'clion' | 'clion64' | 'idea' | 'idea64' | 'phpstorm' | 'phpstorm64' | 'pycharm' | 'pycharm64' | 'rubymine' | 'rubymine64' | 'webstorm' | 'webstorm64' | 'goland' | 'goland64' | 'rider' | 'rider64'; interface LaunchEditorParams { path: string; lineNum?: number; columnNum?: number; editorName?: LaunchEditorName; onError?: (error: any) => void; } declare function launchEditor(params: LaunchEditorParams): Promise; interface LaunchEditorByPathAndContentParams { path: string; matchContent?: string; editorName?: LaunchEditorName; onError?: (error: any) => void; } declare function launchEditorByPathAndContent(params: LaunchEditorByPathAndContentParams): Promise<{ lineNum: number; columnNum: number; }>; interface ReadFileParams { filePath: string | undefined; valid?: boolean; } interface WriteFileParams { filePath: string; content: string; overwrite?: boolean; valid?: boolean; } interface EnsurePathParams { filePath: string; } interface MovePathParams { oldPath: string; newPath: string; } interface TravelFilesParams { filePath: string; isValidPath: (filePath: string) => MaybePromise; callback: (filePath: string) => MaybePromise; } interface TravelFilesByFilterPatternParams extends TravelFilesParams { /** * @default [] */ exts?: string[]; /** * @default null */ includes?: FilterPattern; /** * @default null */ excludes?: FilterPattern; } declare class FileUtils { static readFile(params: ReadFileParams): Promise; static writeFile(params: WriteFileParams): Promise; static deletePath(fullPath: string): Promise; static ensurePath(params: EnsurePathParams): Promise; static movePath(params: MovePathParams): Promise; static travelFiles(params: TravelFilesParams): Promise; static travelFilesByFilterPattern(params: TravelFilesByFilterPatternParams): Promise; } declare function getGlobalCacheDir(name: string): Promise; declare function getStorage(storageName: ServerStorageName): Promise<{ cacheDir: string; storage: _kvs_storage.KvsStorage | null>>; }>; interface OpenInBrowserProps { url: string; } declare function openInBrowser(props: OpenInBrowserProps): void; interface GetPortProps { defaultPort?: number; autoFreePort?: boolean; excludePorts?: number[]; } declare function getPort(props: GetPortProps): Promise; declare function getLocalHostname(): string; declare class PathUtils { static getCurrentDirName(importMetaUrl: string, getDirname: () => string): string; static join(...paths: string[]): string; static resolve(...paths: string[]): string; static relative(from: string, to: string): string; static dirname(filePath: string): string; static extname(filePath: string): string; static isFile(filePath: string): boolean; static isDirectory(filePath: string): boolean; static includeExt(filePath: string, exts: string[] | undefined | null): boolean; static isExit(filePath: string): boolean; static isAccessible(filePath: string, mode?: 'F' | 'R' | 'W' | 'X'): boolean; static getDirPath(filePath: string): string; } declare function addNodejsPolyfill(): void; declare function getDefaultProxyUrl(): Promise; declare function sendSuccessResponse(res: Response, options: Omit, 'type'>): Response; declare function sendFailResponse(res: Response, options: Omit, 'type'>): Response; declare function verifyParamsByZod(params: T, schema: z.ZodSchema): void; export { EnsurePathParams, FileUtils, GetPortProps, LaunchEditorByPathAndContentParams, LaunchEditorName, LaunchEditorParams, MovePathParams, OpenInBrowserProps, PathUtils, ReadFileParams, TravelFilesByFilterPatternParams, TravelFilesParams, Tunnel, WriteFileParams, addNodejsPolyfill, canUseNodeFetchWithoutCliFlag, checkNodeVersion, compareVersion, getDefaultProxyUrl, getGlobalCacheDir, getLocalHostname, getPort, getRunServerEnv, getStorage, launchEditor, launchEditorByPathAndContent, openInBrowser, sendFailResponse, sendSuccessResponse, verifyParamsByZod };