1 | import { Disposable, TextDocument, ProviderResult, Range as VRange, Color as VColor, ColorPresentation as VColorPresentation, ColorInformation as VColorInformation, DocumentColorProvider } from 'vscode';
|
2 | import { ClientCapabilities, CancellationToken, ServerCapabilities, DocumentSelector, DocumentColorRegistrationOptions, DocumentColorOptions } from 'vscode-languageserver-protocol';
|
3 | import { TextDocumentLanguageFeature, FeatureClient } from './features';
|
4 | export interface ProvideDocumentColorsSignature {
|
5 | (document: TextDocument, token: CancellationToken): ProviderResult<VColorInformation[]>;
|
6 | }
|
7 | export interface ProvideColorPresentationSignature {
|
8 | (color: VColor, context: {
|
9 | document: TextDocument;
|
10 | range: VRange;
|
11 | }, token: CancellationToken): ProviderResult<VColorPresentation[]>;
|
12 | }
|
13 | export interface ColorProviderMiddleware {
|
14 | provideDocumentColors?: (this: void, document: TextDocument, token: CancellationToken, next: ProvideDocumentColorsSignature) => ProviderResult<VColorInformation[]>;
|
15 | provideColorPresentations?: (this: void, color: VColor, context: {
|
16 | document: TextDocument;
|
17 | range: VRange;
|
18 | }, token: CancellationToken, next: ProvideColorPresentationSignature) => ProviderResult<VColorPresentation[]>;
|
19 | }
|
20 | export declare class ColorProviderFeature extends TextDocumentLanguageFeature<boolean | DocumentColorOptions, DocumentColorRegistrationOptions, DocumentColorProvider, ColorProviderMiddleware> {
|
21 | constructor(client: FeatureClient<ColorProviderMiddleware>);
|
22 | fillClientCapabilities(capabilities: ClientCapabilities): void;
|
23 | initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void;
|
24 | protected registerLanguageProvider(options: DocumentColorRegistrationOptions): [Disposable, DocumentColorProvider];
|
25 | }
|