/** * Copyright (c) 2015 The Polymer Project Authors. All rights reserved. * This code may only be used under the BSD style license found at * http://polymer.github.io/LICENSE.txt * The complete set of authors may be found at * http://polymer.github.io/AUTHORS.txt * The complete set of contributors may be found at * http://polymer.github.io/CONTRIBUTORS.txt * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ import { SourcePosition, SourceRange, Warning } from '../model/model'; export declare type TypeaheadCompletion = ElementCompletion | AttributesCompletion; export interface ElementCompletion { kind: 'element-tags'; elements: { tagname: string; description: string; expandTo?: string; }[]; } export interface AttributesCompletion { kind: 'attributes'; attributes: AttributeCompletion[]; } export interface AttributeCompletion { name: string; description: string; type: string | undefined; sortKey: string; inheritedFrom?: string; } export declare abstract class EditorService { /** * Notify the editor service that the given file has changed, and give the * updated contents that should be used. If this method is not called, then * the editor service will assume that files do not change and their contents * will be cached. */ abstract fileChanged(localPath: string, contents: string): Promise; /** * Gives the documentation, as markdown encoded text, for the feature at * the given position in the given file. */ abstract getDocumentationAtPosition(localPath: string, position: SourcePosition): Promise; /** * Gives the location for the definition for a feature. For example, for a * v1 custom element, it will find its class. */ abstract getDefinitionForFeatureAtPosition(localPath: string, position: SourcePosition): Promise; /** * Assuming that the user is typing at the given location, what suggestions * should we give for autocomplete? */ abstract getTypeaheadCompletionsAtPosition(localPath: string, position: SourcePosition): Promise; /** * Gives all warnings, errors, info notices, etc for the given file. */ abstract getWarningsForFile(localPath: string): Promise; /** * Internal method, do not call. May be removed in a future release. * * Instructs the editor service to clear out all caches. Use very sparingly, * as this will dramatically reduce performance of the next request as all * relevant source must be re-read, parsed, scanned, and resolved. * * Useful for tests. */ abstract _clearCaches(): Promise; }