UNPKG

@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

47 lines 1.44 kB
/** * @import { StringLiteral, Word } from "@helios-lang/compiler-utils" * @typedef {import("../typecheck/index.js").DataType} DataType */ /** * Single field in struct or enum member */ export class DataField extends NameTypePair { /** * @param {Word} name * @param {Expr} typeExpr * @param {StringLiteral | undefined} encodingKey */ constructor(name: Word, typeExpr: Expr, encodingKey?: StringLiteral | undefined); /** * @readonly * @private * @type {string | undefined} */ private readonly encodingKey; /** * Throws an error if called before evalType() * @type {DataType} */ get type(): import("../typecheck/common.js").DataType; /** * @returns {boolean} */ hasEncodingKey(): boolean; /** * @type {string} */ get encodedFieldName(): string; /** * Evaluates the type, used by FuncLiteralExpr and DataDefinition * @param {Scope} scope * @returns {DataType | undefined} */ eval(scope: Scope): DataType | undefined; } export type DataType = import("../typecheck/index.js").DataType; import { NameTypePair } from "../expressions/index.js"; import { Scope } from "../scopes/index.js"; import type { Word } from "@helios-lang/compiler-utils"; import { Expr } from "../expressions/index.js"; import type { StringLiteral } from "@helios-lang/compiler-utils"; //# sourceMappingURL=DataField.d.ts.map