import { Point, TextEditor, Range } from "atom"; import { CancellationToken, CancellationTokenSource } from "vscode-jsonrpc"; export declare type ReportBusyWhile = (title: string, f: () => Promise) => Promise; /** Obtain the range of the word at the given editor position. Uses the non-word characters from the position's grammar scope. */ export declare function getWordAtPosition(editor: TextEditor, position: Point): Range; export declare function escapeRegExp(string: string): string; /** * For the given connection and cancellationTokens map, cancel the existing CancellationToken for that connection then * create and store a new CancellationToken to be used for the current request. */ export declare function cancelAndRefreshCancellationToken(key: T, cancellationTokens: WeakMap): CancellationToken; export declare function doWithCancellationToken(key: T1, cancellationTokens: WeakMap, work: (token: CancellationToken) => Promise): Promise; export declare function assertUnreachable(_: never): never; export declare function promiseWithTimeout(ms: number, promise: Promise): Promise; export declare const rootPathDefault: string; export declare const exeExtentionDefault: string; /** * Finds an exe file in the package assuming it is placed under `rootPath/platform-arch/exe`. If the exe file did not * exist, the given name is returned. For example on Windows x64, if the `exeName` is `serve-d`, it returns the absolute * path to `./bin/win32-x64/exeName.exe`, and if the file did not exist, `serve-d` is returned. * * @param exeName Name of the exe file * @param rootPath The path of the folder of the exe file. Defaults to 'join("bin", `${process.platform}-${process.arch}`)' * @param exeExtention The extention of the exe file. Defaults to `process.platform === "win32" ? ".exe" : ""` */ export declare function getExePath(exeName: string, rootPath?: string, exeExtention?: string): string;