/** * @license * Copyright (c) 2017 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 { Document, ParsedDocument, Replacement, SourceRange } from 'prax-analyzer'; /** * A utility for more easily writing long strings inline in code. * * Strips leading and trailing whitespace, and converts newlines followed * by whitespace into a single space. Use like: * * stripWhitespace(` * hello * world * `); * * This evaluates to "hello world". */ export declare function stripWhitespace(str: string): string; /** * A utility for writing long multiline strings inline in code. * * Determines the initial indentation based on the first indented line, * and removes it from all other lines, then trims off leading and trailing * whitespace. Use like: * * stripIndentation(` * hello * world * `); * * This evaluates to "hello\n world" */ export declare function stripIndentation(str: string): string; export declare function minBy(it: Iterable, score: (t: T) => number): { min: T; minScore: number; } | undefined; export declare function closestSpelling(word: string, options: Iterable): { min: string; minScore: number; } | undefined; export declare function getDocumentContaining(sourceRange: SourceRange | undefined, document: Document): ParsedDocument | undefined; /** * A utility for indenting a sourceRange */ export declare function indentSourceRange(sourceRange: SourceRange, indentation: string, _document: ParsedDocument): Replacement[];