@helios-lang/compiler
Version:
Helios is a Domain Specific Language that compiles to Plutus-Core (i.e. Cardano on-chain validator scripts). Helios is a non-Haskell alternative to Plutus. With this library you can compile Helios scripts and build Cardano transactions, all you need to bu
205 lines • 6.83 kB
TypeScript
/**
* @typedef {import("@helios-lang/compiler-utils").Site} Site
* @typedef {import("@helios-lang/ir").SourceMappedStringI} SourceMappedStringI
* @typedef {import("@helios-lang/uplc").UplcData} UplcData
* @typedef {import("../codegen/index.js").Definitions} Definitions
* @typedef {import("../typecheck/index.js").DataType} DataType
* @typedef {import("../typecheck/index.js").ScriptTypes} ScriptTypes
* @typedef {import("../typecheck/index.js").Type} Type
* @typedef {import("../typecheck/index.js").TypeSchema} TypeSchema
*/
/**
* @typedef {{
* name: string
* purpose: string
* currentScriptIndex: number | undefined
* mainArgTypes: DataType[]
* mainFunc: FuncStatement
* moduleDependencies: string[]
* mainImportedModules: Module[]
* mainModule: MainModule
* userTypes: Record<string, Record<string, DataType>>
* paramTypes: Record<string, DataType>
* paramsDetails(): Record<string, string>
* requiredParams: Set<string>
* changeParam(name: string, data: UplcData): boolean
* evalTypes(scriptTypes: ScriptTypes): void
* toIR(ctx: ToIRContext, extra?: Definitions | undefined): SourceMappedStringI
* toString(): string
* }} EntryPoint
*/
export class EntryPointImpl {
/**
* @param {ModuleCollection} modules
*/
constructor(modules: ModuleCollection);
/**
* @protected
* @type {ModuleCollection}
*/
protected modules: ModuleCollection;
/**
* Used to retrieve current script index
* @protected
* @type {GlobalScope | undefined}
*/
protected globalScope: GlobalScope | undefined;
/**
* @private
* @type {TopScope | undefined}
*/
private _topScope;
/**
* @type {number | undefined}
*/
get currentScriptIndex(): number | undefined;
/**
* @type {string}
*/
get name(): string;
/**
* @type {Record<string, DataType>}
*/
get paramTypes(): Record<string, import("../typecheck/common.js").DataType>;
/**
* @protected
* @type {[Statement, boolean][]} - boolean value marks if statement is import or not
*/
protected get allStatements(): [Statement, boolean][];
/**
* @type {Record<string, Record<string, DataType>>}
*/
get userTypes(): Record<string, Record<string, import("../typecheck/common.js").DataType>>;
/**
* @protected
* @type {string[]}
*/
protected get mainArgNames(): string[];
/**
* @type {DataType[]}
*/
get mainArgTypes(): import("../typecheck/common.js").DataType[];
/**
* @type {FuncStatement}
*/
get mainFunc(): FuncStatement;
/**
* @type {Module[]}
*/
get mainImportedModules(): Module[];
/**
* @type {MainModule}
*/
get mainModule(): MainModule;
/**
* @protected
* @type {string}
*/
protected get mainPath(): string;
/**
* @protected
* @type {Site}
*/
protected get mainRetExprSite(): import("@helios-lang/compiler-utils").Site;
/**
* @protected
* @type {Statement[]}
*/
protected get mainStatements(): Statement[];
/**
* @type {string[]}
*/
get moduleDependencies(): string[];
/**
* Change the literal value of a const statements
* @param {string} name
* @param {UplcData} data
* @returns {boolean} - returns false if not found
*/
changeParam(name: string, data: UplcData): boolean;
/**
* Presents all the parameter values as an object with keys mapping the parameter names
* to Helios declarations for each const statement, with their current settings
* @returns {Record<string, string>}
* @public
*/
public paramsDetails(): Record<string, string>;
/**
* @returns {string}
*/
toString(): string;
/**
* @protected
* @param {SourceMappedStringI} ir
* @param {Definitions} definitions
* @returns {Set<string>}
*/
protected collectAllUsed(ir: SourceMappedStringI, definitions: Definitions): Set<string>;
/**
* @protected
* @param {GlobalScope} globalScope
*/
protected evalTypesInternal(globalScope: GlobalScope): void;
/**
* @protected
* @param {string} name
* @returns {ConstStatement | undefined}
*/
protected findConstStatement(name: string): ConstStatement | undefined;
/**
* Non-positional named parameters
* @protected
* @param {ToIRContext} ctx
* @param {SourceMappedStringI} ir
* @returns {Set<string>}
*/
protected getRequiredParametersInternal(ctx: ToIRContext, ir: SourceMappedStringI): Set<string>;
/**
* @protected
* @param {(name: string, statement: ConstStatement) => void} callback
*/
protected loopConstStatements(callback: (name: string, statement: ConstStatement) => void): void;
/**
* @protected
* @param {ToIRContext} ctx
* @param {SourceMappedStringI} ir
* @param {Definitions | undefined} extra
* @returns {SourceMappedStringI}
*/
protected wrapEntryPoint(ctx: ToIRContext, ir: SourceMappedStringI, extra?: Definitions | undefined): SourceMappedStringI;
}
export type Site = import("@helios-lang/compiler-utils").Site;
export type SourceMappedStringI = import("@helios-lang/ir").SourceMappedStringI;
export type UplcData = import("@helios-lang/uplc").UplcData;
export type Definitions = import("../codegen/index.js").Definitions;
export type DataType = import("../typecheck/index.js").DataType;
export type ScriptTypes = import("../typecheck/index.js").ScriptTypes;
export type Type = import("../typecheck/index.js").Type;
export type TypeSchema = import("../typecheck/index.js").TypeSchema;
export type EntryPoint = {
name: string;
purpose: string;
currentScriptIndex: number | undefined;
mainArgTypes: DataType[];
mainFunc: FuncStatement;
moduleDependencies: string[];
mainImportedModules: Module[];
mainModule: MainModule;
userTypes: Record<string, Record<string, DataType>>;
paramTypes: Record<string, DataType>;
paramsDetails(): Record<string, string>;
requiredParams: Set<string>;
changeParam(name: string, data: UplcData): boolean;
evalTypes(scriptTypes: ScriptTypes): void;
toIR(ctx: ToIRContext, extra?: Definitions | undefined): SourceMappedStringI;
toString(): string;
};
import { ModuleCollection } from "./ModuleCollection.js";
import { GlobalScope } from "../scopes/index.js";
import { Statement } from "../statements/index.js";
import { FuncStatement } from "../statements/index.js";
import { Module } from "./Module.js";
import { MainModule } from "./MainModule.js";
import { ConstStatement } from "../statements/index.js";
import { ToIRContext } from "../codegen/index.js";
//# sourceMappingURL=EntryPoint.d.ts.map