import { TextDocument, TextDocumentChangeEvent, TextDocumentWillSaveEvent, TextEdit as VTextEdit, DocumentSelector as VDocumentSelector, Event } from 'vscode'; import { ClientCapabilities, DidChangeTextDocumentParams, DidCloseTextDocumentParams, DidOpenTextDocumentParams, DidSaveTextDocumentParams, DocumentSelector, ProtocolNotificationType, RegistrationType, ServerCapabilities, TextDocumentChangeRegistrationOptions, TextDocumentRegistrationOptions, TextDocumentSaveRegistrationOptions, TextDocumentSyncKind, TextDocumentSyncOptions, WillSaveTextDocumentParams } from 'vscode-languageserver-protocol'; import { FeatureClient, TextDocumentEventFeature, DynamicFeature, NextSignature, TextDocumentSendFeature, NotifyingFeature, RegistrationData, DynamicDocumentFeature, NotificationSendEvent } from './features'; export interface TextDocumentSynchronizationMiddleware { didOpen?: NextSignature>; didChange?: NextSignature>; willSave?: NextSignature>; willSaveWaitUntil?: NextSignature>; didSave?: NextSignature>; didClose?: NextSignature>; } export interface DidOpenTextDocumentFeatureShape extends DynamicFeature, TextDocumentSendFeature<(textDocument: TextDocument) => Promise>, NotifyingFeature { openDocuments: Iterable; } export type ResolvedTextDocumentSyncCapabilities = { resolvedTextDocumentSync?: TextDocumentSyncOptions; }; export declare class DidOpenTextDocumentFeature extends TextDocumentEventFeature implements DidOpenTextDocumentFeatureShape { private readonly _syncedDocuments; constructor(client: FeatureClient, syncedDocuments: Map); get openDocuments(): IterableIterator; fillClientCapabilities(capabilities: ClientCapabilities): void; initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void; get registrationType(): RegistrationType; register(data: RegistrationData): void; protected getTextDocument(data: TextDocument): TextDocument; protected notificationSent(textDocument: TextDocument, type: ProtocolNotificationType, params: DidOpenTextDocumentParams): void; } export interface DidCloseTextDocumentFeatureShape extends DynamicFeature, TextDocumentSendFeature<(textDocument: TextDocument) => Promise>, NotifyingFeature { } export declare class DidCloseTextDocumentFeature extends TextDocumentEventFeature implements DidCloseTextDocumentFeatureShape { private readonly _syncedDocuments; private readonly _pendingTextDocumentChanges; constructor(client: FeatureClient, syncedDocuments: Map, pendingTextDocumentChanges: Map); get registrationType(): RegistrationType; fillClientCapabilities(capabilities: ClientCapabilities): void; initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void; protected callback(data: TextDocument): Promise; protected getTextDocument(data: TextDocument): TextDocument; protected notificationSent(textDocument: TextDocument, type: ProtocolNotificationType, params: DidCloseTextDocumentParams): void; unregister(id: string): void; } export interface DidChangeTextDocumentFeatureShape extends DynamicFeature, TextDocumentSendFeature<(event: TextDocumentChangeEvent) => Promise>, NotifyingFeature { } export declare class DidChangeTextDocumentFeature extends DynamicDocumentFeature implements DidChangeTextDocumentFeatureShape { private _listener; private readonly _changeData; private readonly _onNotificationSent; private readonly _onPendingChangeAdded; private readonly _pendingTextDocumentChanges; private _syncKind; constructor(client: FeatureClient, pendingTextDocumentChanges: Map); get onNotificationSent(): Event>; get onPendingChangeAdded(): Event; get syncKind(): TextDocumentSyncKind; get registrationType(): RegistrationType; fillClientCapabilities(capabilities: ClientCapabilities): void; initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void; register(data: RegistrationData): void; getDocumentSelectors(): IterableIterator; private callback; notificationSent(textDocument: TextDocument, type: ProtocolNotificationType, params: DidChangeTextDocumentParams): void; unregister(id: string): void; clear(): void; getPendingDocumentChanges(excludes: Set): TextDocument[]; getProvider(document: TextDocument): { send: (event: TextDocumentChangeEvent) => Promise; } | undefined; private updateSyncKind; } export declare class WillSaveFeature extends TextDocumentEventFeature { constructor(client: FeatureClient); get registrationType(): RegistrationType; fillClientCapabilities(capabilities: ClientCapabilities): void; initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void; protected getTextDocument(data: TextDocumentWillSaveEvent): TextDocument; } export declare class WillSaveWaitUntilFeature extends DynamicDocumentFeature { private _listener; private readonly _selectors; constructor(client: FeatureClient); protected getDocumentSelectors(): IterableIterator; get registrationType(): RegistrationType; fillClientCapabilities(capabilities: ClientCapabilities): void; initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void; register(data: RegistrationData): void; private callback; unregister(id: string): void; clear(): void; } export interface DidSaveTextDocumentFeatureShape extends DynamicFeature, TextDocumentSendFeature<(textDocument: TextDocument) => Promise>, NotifyingFeature { } export declare class DidSaveTextDocumentFeature extends TextDocumentEventFeature implements DidSaveTextDocumentFeatureShape { private _includeText; constructor(client: FeatureClient); get registrationType(): RegistrationType; fillClientCapabilities(capabilities: ClientCapabilities): void; initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void; register(data: RegistrationData): void; protected getTextDocument(data: TextDocument): TextDocument; }