UNPKG

1.56 kBTypeScriptView Raw
1import { TextDocument } from 'vscode-languageserver-textdocument';
2import { Range, Position } from 'vscode-languageserver-types';
3import * as ast from './main';
4import { ParserDirective } from './parserDirective';
5import { ImageTemplate } from './imageTemplate';
6import { Instruction } from './instruction';
7import { Arg } from './instructions/arg';
8export declare class Dockerfile extends ImageTemplate implements ast.Dockerfile {
9 private readonly document;
10 private readonly initialInstructions;
11 private readonly buildStages;
12 private currentBuildStage;
13 private directives;
14 /**
15 * Whether a FROM instruction has been added to this Dockerfile or not.
16 */
17 private foundFrom;
18 constructor(document: TextDocument);
19 getEscapeCharacter(): string;
20 getInitialARGs(): Arg[];
21 getContainingImage(position: Position): ImageTemplate | null;
22 addInstruction(instruction: Instruction): void;
23 setDirectives(directives: ParserDirective[]): void;
24 getDirective(): ParserDirective | null;
25 getDirectives(): ParserDirective[];
26 resolveVariable(variable: string, line: number): string | null | undefined;
27 getAvailableVariables(currentLine: number): string[];
28 private getParentStage;
29 getStageHierarchy(line: number): ImageTemplate[];
30 getAvailableWorkingDirectories(line: number): string[];
31 /**
32 * Internally reorganize the comments in the Dockerfile and allocate
33 * them to the relevant build stages that they belong to.
34 */
35 organizeComments(): void;
36 getRange(): Range | null;
37}