UNPKG

roblox-ts

Version:

<div align="center"><img width=25% src="https://i.imgur.com/yCjHmng.png"></div> <h1 align="center"><a href="https://roblox-ts.github.io/">roblox-ts</a></h1> <div align="center">A TypeScript-to-Lua Compiler for Roblox</div> <br> <div align="center"> <a hr

38 lines (37 loc) 2.07 kB
import * as ts from "ts-morph"; export declare function isValidLuaIdentifier(id: string): boolean; export declare function safeLuaIndex(parent: string, child: string): string; export declare function isCompiledIdentifier(s: string): boolean; export declare function joinIndentedLines(lines: Array<string>, numTabs?: number): string; export declare function stripExtensions(fileName: string): string; export declare function clearContextCache(): void; export declare enum ScriptType { Server = 0, Client = 1, Module = 2 } export declare function getScriptType(file: ts.SourceFile): ScriptType; export declare enum ScriptContext { None = 0, Client = 1, Server = 2, Both = 3 } export declare function getScriptContext(file: ts.SourceFile, seen?: Set<string>): ScriptContext; export declare function red(text: string): string; export declare function yellow(text: string): string; export declare function bold(text: string): string; export declare function suggest(text: string): string; export declare function isIdentifierWhoseDefinitionMatchesNode(node: ts.Node<ts.ts.Node>, potentialDefinition: ts.Identifier): node is ts.Identifier; /** Skips over Null/Parenthesis expressions. * Be aware that this can change the type of your expression to be potentially undefined. */ export declare function skipNodesDownwards<T extends ts.Node>(exp: T, dontSkipParenthesis?: boolean): T; export declare function skipNodesDownwards<T extends ts.Node>(exp?: T, dontSkipParenthesis?: boolean): T | undefined; /** Skips over Null/Parenthesis expressions. * Be aware that this can change the type of your expression to be potentially undefined. */ export declare function skipNodesUpwards<T extends ts.Node>(exp: T, dontSkipParenthesis?: boolean): T; export declare function skipNodesUpwards<T extends ts.Node>(exp?: T, dontSkipParenthesis?: boolean): T | undefined; export declare function makeSetStatement(varToSet: string, value: string): string; export declare function transformPathToLua(rootPath: string, outPath: string, filePath: string): string;