@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
131 lines • 3.67 kB
TypeScript
/**
* @typedef {import("@helios-lang/ir").SourceMappedStringI} SourceMappedStringI
*/
export const RE_IR_PARAMETRIC_NAME: RegExp;
/**
* Type type parameter prefix
* @internal
*/
export const TTPP: "__T";
/**
* Func type parameter prefix
* @internal
*/
export const FTPP: "__F";
/**
* @internal
*/
export class ParametricName {
/**
* @param {string} base
* @param {number} nTtps
* @param {string} fn
* @param {number} nFtps
* @returns
*/
static newTemplate(base: string, nTtps: number, fn?: string, nFtps?: number): ParametricName;
/**
* @example
* IRParametricName.matches("__helios__map[__T0@__T1]__fold[__F2@__F3]") == true
* @example
* IRParametricName.matches("__helios__int") == false
* @example
* IRParametricName.matches("__helios__option[__T0]__none__new") == true
* @param {string} str
* @returns {boolean}
*/
static matches(str: string): boolean;
/**
* @param {string} name
* @returns {boolean}
*/
static isTemplate(name: string): boolean;
/**
* @example
* IRParametricName.parse("__helios__map[__T0@__T1]__fold[__F0@__F1]").toString() == "__helios__map[__T0@__T1]__fold[__F0@__F1]"
* @example
* IRParametricName.parse("__helios__map[__helios__bytearray@__helios__map[__helios__bytearray@__helios__int]]__fold[__F0@__F1]").toString() == "__helios__map[__helios__bytearray@__helios__map[__helios__bytearray@__helios__int]]__fold[__F0@__F1]"
* @example
* IRParametricName.parse("__helios__map[__helios__bytearray@__helios__map[__helios__bytearray@__helios__list[__T0]]]__fold[__F0@__F1]").toString() == "__helios__map[__helios__bytearray@__helios__map[__helios__bytearray@__helios__list[__T0]]]__fold[__F0@__F1]"
* @param {string} str
* @param {boolean} preferType
* @returns {ParametricName}
*/
static parse(str: string, preferType?: boolean): ParametricName;
/**
* @param {string} base
* @param {string[]} ttp
* @param {string} fn
* @param {string[]} ftp
*/
constructor(base: string, ttp: string[], fn?: string, ftp?: string[]);
/**
* Base type name
* @private
* @readonly
* @type {string}
*/
private readonly _base;
/**
* Type type parameters
* Note: nested type names can stay strings
* Note: can be empty
* @private
* @readonly
* @type {string[]}
*/
private readonly _ttp;
/**
* Function name
* @private
* @readonly
* @type {string}
*/
private readonly _fn;
/**
* Function type parameters
* Note: can be empty
* @private
* @readonly
* @type {string[]}
*/
private readonly _ftp;
/**
* @type {string[]}
*/
get ttp(): string[];
/**
* @type {string[]}
*/
get ftp(): string[];
/**
* @type {string}
*/
get base(): string;
/**
* @type {string}
*/
get fn(): string;
/**
* @param {string[]} ttp
* @param {string[]} ftp
* @returns {ParametricName}
*/
toImplementation(ttp: string[], ftp?: string[]): ParametricName;
/**
* @returns {string}
*/
toString(): string;
/**
* @param {boolean} emptyParameters
* @return {string}
*/
toTemplate(emptyParameters?: boolean): string;
/**
* @param {SourceMappedStringI} ir
* @returns {SourceMappedStringI}
*/
replaceTemplateNames(ir: SourceMappedStringI): SourceMappedStringI;
}
export type SourceMappedStringI = import("@helios-lang/ir").SourceMappedStringI;
//# sourceMappingURL=ParametricName.d.ts.map