UNPKG

1.7 kBTypeScriptView Raw
1import * as PP from "./preprocessor";
2import { ExecutionOptions } from "./interpreter";
3import * as LexerParser from "./LexerParser";
4import * as _lexer from "./lexer";
5export { _lexer as lexer };
6import * as BrsTypes from "./brsTypes";
7export { BrsTypes as types };
8export { PP as preprocessor };
9import * as _parser from "./parser";
10export { _parser as parser };
11/**
12 * Executes a BrightScript file by path and writes its output to the streams
13 * provided in `options`.
14 *
15 * @param filename the absolute path to the `.brs` file to be executed
16 * @param options configuration for the execution, including the streams to use for `stdout` and
17 * `stderr` and the base directory for path resolution
18 *
19 * @returns a `Promise` that will be resolve if `filename` is successfully
20 * executed, or be rejected if an error occurs.
21 */
22export declare function execute(filenames: string[], options: Partial<ExecutionOptions>): Promise<LexerParser.types.BrsType[]>;
23/**
24 * A synchronous version of the lexer-parser flow.
25 *
26 * @param filename the paths to BrightScript files to lex and parse synchronously
27 * @param options configuration for the execution, including the streams to use for `stdout` and
28 * `stderr` and the base directory for path resolution
29 *
30 * @returns the AST produced from lexing and parsing the provided files
31 */
32export declare function lexParseSync(filenames: string[], options: Partial<ExecutionOptions>): _parser.Stmt.Statement[];
33/**
34 * Launches an interactive read-execute-print loop, which reads input from
35 * `stdin` and executes it.
36 *
37 * **NOTE:** Currently limited to single-line inputs :(
38 */
39export declare function repl(): void;