import * as monaco from 'monaco-editor/esm/vs/editor/editor.api.js'; import { ICompletionInfo } from '../type'; export declare const getEmptyCompletion: (currentWord: string) => { suggestions: { label: string; kind: monaco.languages.CompletionItemKind; insertText: string; }[]; } | null; /** * 一个简单的可取消的promise */ declare class CancelablePromise { private cancelMethod; promise: Promise; constructor(executor: (resolve: (value: T | PromiseLike) => void, reject: (reason?: any) => void) => void); cancel(): void; then(onFulfilled: (value: T) => void): Promise; } /** * 用于请求字段的值的工具类。 */ export declare class ValueCompletion { editor: monaco.editor.IStandaloneCodeEditor; currentSpl: string; currentField: string; currentSuggestions: monaco.languages.CompletionItem[] | null; getFieldValue?: (spl: string, field: string) => Promise; currentRequest: CancelablePromise | null; initValueCompletionRequest({ spl, field, position, currentWord, completionInfo }: { spl: string; currentWord: string; field: string; position: monaco.Position; completionInfo: ICompletionInfo; }): void; getValueSuggestiongs(spl: string, field: string): monaco.languages.CompletionItem[] | undefined; setGetFieldValue(getFieldValue: (spl: string, field: string) => Promise): void; constructor(editor: monaco.editor.IStandaloneCodeEditor, getFieldValue?: (spl: string, field: string) => Promise); } export {};