@senx/warpview-editor
Version:
WarpView Editor Elements
41 lines (40 loc) • 1.62 kB
TypeScript
/**
* Parsing result of // @command parameter in the beginning of the WarpScript
*/
export interface specialCommentCommands {
endpoint?: string;
timeunit?: string;
localmacrosubstitution?: boolean;
displayPreviewOpt?: string;
listOfMacroInclusion?: string[];
listOfMacroInclusionRange?: any[];
theme?: string;
}
/**
* Little class to store statement and its offset in the text
*/
export declare class wsStatement {
statement: string;
offset: number;
constructor(statement: string, offset: number);
}
export declare class WarpScriptParser {
/**
* Look for a statement position in the recursive tree of macros markers.
*
* @param macroPositions the table of macro positions (output of parseWarpScriptMacros)
* @param offset the absolute position of the start of statement you are looking for
* @param numberOfMacros the expected number of macros
*/
static findMacrosBeforePosition(macroPositions: any, offset: number, numberOfMacros: number): any[];
/**
* Unlike parseWarpScriptMacros, this function return a very simple list of statements (as strings), ignoring comments.
* [ '"HELLO"' '"WORLD"' '+' '2' '2' '*' ]
*
* When called with withPosition true, it returns a list of list than include start and end position of the statement:
* [ [ '"HELLO"' 4 11 ] [ '"WORLD"' 22 29 ] ]
*/
static parseWarpScriptStatements(ws: String, withPosition?: boolean): any[];
static extractSpecialComments(executedWarpScript: string): specialCommentCommands;
static IsWsLitteralString(s: String): boolean;
}