interface BaseNode { type: string; } interface ParseOptions { wait: boolean; comments: boolean; scope: boolean; locations: boolean; ranges: boolean; onCreateNode: null | ((node: BaseNode) => void); onCreateScope: null | (() => void); onLocalDeclaration: null | ((name: string) => void); luaVersion: "5.1" | "5.2" | "5.3" | "5.4" | "FiveM5.4"; encodingMode: "none" | "pseudo-latin1" | "x-user-defined"; } interface ParseResult { globals: any[]; scopes: any[]; body: any; } const enum TokenTypes { EOF = 1, StringLiteral = 2, Keyword = 4, Identifier = 8, NumericLiteral = 16, Punctuator = 32, BooleanLiteral = 64, NilLiteral = 128, VarargLiteral = 256, } const enum Errors { unexpected = "unexpected %1 '%2' near '%3'", unexpectedEOF = "unexpected symbol near ''", expected = "'%1' expected near '%2'", expectedToken = "%1 expected near '%2'", unfinishedString = "unfinished string near '%1'", malformedNumber = "malformed number near '%1'", decimalEscapeTooLarge = "decimal escape too large near '%1'", invalidEscape = "invalid escape sequence near '%1'", hexadecimalDigitExpected = "hexadecimal digit expected near '%1'", braceExpected = "missing '%1' near '%2'", tooLargeCodepoint = "UTF-8 value too large near '%1'", unfinishedLongString = "unfinished long string (starting at line %1) near '%2'", unfinishedLongComment = "unfinished long comment (starting at line %1) near '%2'", ambiguousSyntax = "ambiguous syntax (function call x new statement) near '%1'", noLoopToBreak = "no loop to break near '%1'", labelAlreadyDefined = "label '%1' already defined on line %2", labelNotVisible = "no visible label '%1' for ", gotoJumpInLocalScope = " jumps into the scope of local '%2'", cannotUseVararg = "cannot use '...' outside a vararg function near '%1'", invalidCodeUnit = "code unit U+%1 is not allowed in the current encoding mode", unknownAttribute = "unknown attribute '%1'", } declare module "fivem-luaparse" { export const version: string; export const tokenTypes: TokenTypes; export const errors: Errors; export function parse( code: string, options?: Partial ): ParseResult; }