dockerfile-ast
Version:
Parse a Dockerfile into an array of instructions and comments.
53 lines (52 loc) • 2.12 kB
TypeScript
import { TextDocument } from 'vscode-languageserver-textdocument';
import { Range } from 'vscode-languageserver-types';
import { Argument } from './argument';
export declare class Property {
private document;
private escapeChar;
private readonly range;
private readonly nameRange;
private readonly name;
private readonly assignmentOperatorRange;
private readonly assignmentOperator;
private readonly valueRange;
private readonly value;
constructor(document: TextDocument, escapeChar: string, arg: Argument, arg2?: Argument);
getRange(): Range;
getName(): string;
getNameRange(): Range;
getValue(): string | null;
getValueRange(): Range | null;
/**
* Retrieves the operator used for delimiting between the name and
* value of this property. This will either be the "=" character
* or null if a character was not used or if this property has no
* value defined.
*/
getAssignmentOperator(): string | null;
getAssignmentOperatorRange(): Range | null;
/**
* Returns the value of this property including any enclosing
* single or double quotes and relevant escape characters.
* Escaped newlines and its associated contiguous whitespace
* characters however will not be returned as they are deemed to
* be uninteresting to clients trying to return a Dockerfile.
*
* @return the unescaped value of this property or null if this
* property has no associated value
*/
getUnescapedValue(): string | null;
private static getNameRange;
private static getValueRange;
/**
* Returns the actual value of this key-value pair. The value will
* have its escape characters removed if applicable. If the value
* spans multiple lines and there are comments nested within the
* lines, they too will be removed.
*
* @return the value that this key-value pair will actually be, may
* be null if no value is defined, may be the empty string
* if the value only consists of whitespace
*/
private static getValue;
}