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

56 lines (55 loc) 2.56 kB
import * as ts from "ts-morph"; import { RojoProject } from "./RojoProject"; import { ProjectInfo } from "./types"; import { ScriptContext } from "./utility"; export declare type PrecedingStatementContext = Array<string> & { isPushed: boolean; }; export interface DeclarationContext { isIdentifier: boolean; needsLocalizing?: boolean; set: string; } export declare class CompilerState { readonly rootDirPath: string; readonly outDirPath: string; readonly projectInfo: ProjectInfo; readonly rojoProject?: RojoProject | undefined; readonly modulesDir?: ts.Directory | undefined; readonly runtimeOverride?: string | undefined; constructor(rootDirPath: string, outDirPath: string, projectInfo: ProjectInfo, rojoProject?: RojoProject | undefined, modulesDir?: ts.Directory | undefined, runtimeOverride?: string | undefined); declarationContext: Map<ts.Node<ts.ts.Node>, DeclarationContext>; pushToDeclarationOrNewId(node: ts.Node, expStr: string, condition?: (declaration: DeclarationContext) => boolean): string; currentConditionalContext: string; private precedingStatementContexts; getCurrentPrecedingStatementContext(node: ts.Node): PrecedingStatementContext; enterPrecedingStatementContext(newContext?: string[]): PrecedingStatementContext; exitPrecedingStatementContext(): PrecedingStatementContext; exitPrecedingStatementContextAndJoin(numTabs?: number): string; pushPrecedingStatements(node: ts.Node, ...statements: Array<string>): number; pushPrecedingStatementToNewId(node: ts.Node, compiledSource: string, newId?: string): string; pushPrecedingStatementToReuseableId(node: ts.Node, compiledSource: string, nextCachedStrs?: Array<string>): string; indent: string; pushIndent(): void; popIndent(): void; idStack: number[]; pushIdStack(): void; popIdStack(): void; getNewId(): string; hoistStack: Set<string>[]; pushHoistStack(name: string): void; popHoistStack(result: string): string; exportStack: Set<string>[]; pushExport(name: string, node: ts.Node & ts.ExportableNode): void; getNameForContext(myNamespace: ts.NamespaceDeclaration | undefined): string; getExportContextName(node: ts.VariableStatement | ts.Node): string; variableAliases: Map<string, string>; getAlias(name: string): string; namespaceStack: Map<string, string>; continueId: number; isModule: boolean; scriptContext: ScriptContext; roactIndent: number; hasRoactImport: boolean; usesTSLibrary: boolean; }