import { MessageConnection } from "vscode-jsonrpc"; import { AutorestExtensionLogger } from "./extension-logger"; import { Mapping, Message, RawSourceMap } from "./types"; /** * Sepecify that the source file and current file is a 1:1 mapping. */ export interface IdentitySourceMap { type: "identity"; /**1 * Name of the file that this file is mapping to. */ source: string; } export interface WriteFileOptions { /** * @param filename Name of the file. */ filename: string; /** * @param content Content of the file. */ content: string; /** * @param sourceMap Source map that can be used to trace back source position in case of error. */ sourceMap?: Mapping[] | RawSourceMap | IdentitySourceMap; /** * @param artifactType Artifact type */ artifactType?: string; } export interface AutorestExtensionHost { logger: AutorestExtensionLogger; protectFiles(path: string): Promise; readFile(filename: string): Promise; getValue(key: string): Promise; listInputs(artifactType?: string): Promise>; writeFile({ filename, content, sourceMap, artifactType }: WriteFileOptions): void; message(message: Message): void; /** * @deprecated */ UpdateConfigurationFile(filename: string, content: string): void; /** * @deprecated */ GetConfigurationFile(filename: string): Promise; /** * @deprecated use #writeFile */ WriteFile(filename: string, content: string): void; /** * @deprecated use #getValue */ GetValue(key: string): any; /** * @deprecated use #message */ Message(message: Message): any; } export declare class AutorestExtensionRpcHost implements AutorestExtensionHost { private channel; private sessionId; logger: AutorestExtensionLogger; constructor(channel: MessageConnection, sessionId: string); /** * Protect files that will not be cleared when using clear-output-folder. * @param path Path to the file/folder to protect. */ protectFiles(path: string): Promise; readFile(filename: string): Promise; /** * Get a configuration key form the resolved configuration. * @param key Path to the configuration entry. (Keys dot seperated) * @returns Value of the configuration. */ getValue(key: string): Promise; /** * List inputs * @param artifactType @optional Filter by artifact type. * @returns name of the input files. */ listInputs(artifactType?: string): Promise>; /** * Write a file. */ writeFile({ filename, content, sourceMap, artifactType }: WriteFileOptions): void; /** * Send a message. * @param message Message to send. */ message(message: Message): void; /** * @deprecated */ WriteFile(filename: string, content: string): void; /** * @deprecated */ GetValue(key: string): Promise; /** * @deprecated */ Message(message: Message): void; /** * @deprecated */ UpdateConfigurationFile(filename: string, content: string): void; /** * @deprecated */ GetConfigurationFile(filename: string): Promise; } //# sourceMappingURL=extension-host.d.ts.map