@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
95 lines • 2.4 kB
TypeScript
/**
* @typedef {import("@helios-lang/compiler-utils").Site} Site
* @typedef {import("./common.js").Func} Func
* @typedef {import("./common.js").Named} Named
* @typedef {import("./common.js").Type} Type
* @typedef {import("./common.js").Typed} Typed
*/
/**
* Used by print, error, and assert
* @implements {Func}
* @implements {Named}
*/
export class BuiltinFunc extends Common implements Func, Named {
/**
*
* @param {{
* name: string,
* type: FuncType
* }} props
*/
constructor({ name, type }: {
name: string;
type: FuncType;
});
/**
* @private
* @readonly
* @type {string}
*/
private readonly _name;
/**
* @private
* @readonly
* @type {FuncType}
*/
private readonly _type;
/**
* @type {string}
*/
get name(): string;
/**
* @type {string}
*/
get path(): string;
/**
* @type {Type}
*/
get type(): import("./common.js").Type;
/**
* @type {FuncType}
*/
get funcType(): FuncType;
/**
* @type {Func}
*/
get asFunc(): import("./common.js").Func;
/**
* @type {Named}
*/
get asNamed(): import("./common.js").Named;
/**
* @type {Typed}
*/
get asTyped(): import("./common.js").Typed;
/**
* Can mutate the args and the namedArgs in case of casting
* @param {Site} site
* @param {Typed[]} args
* @param {{[name: string]: Typed}} namedArgs
* @returns {Typed}
*/
call(site: Site, args: Typed[], namedArgs?: {
[name: string]: Typed;
}): Typed;
}
/**
* Special builtin function that throws an error if condition is false and returns Void
*/
export const AssertFunc: BuiltinFunc;
/**
* Special builtin function that throws an error and returns ErrorInstance (special case of Void)
*/
export const ErrorFunc: BuiltinFunc;
/**
* Special builtin function that prints a message and returns void
*/
export const PrintFunc: BuiltinFunc;
export type Site = import("@helios-lang/compiler-utils").Site;
export type Func = import("./common.js").Func;
export type Named = import("./common.js").Named;
export type Type = import("./common.js").Type;
export type Typed = import("./common.js").Typed;
import { Common } from "./common.js";
import { FuncType } from "./common.js";
//# sourceMappingURL=builtin-funcs.d.ts.map