@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
75 lines • 2.4 kB
TypeScript
/**
* Wraps 'inner' IR source with some definitions (used for top-level statements and for builtins)
* @param {SourceMappedStringI} inner
* @param {Definitions} definitions - name -> definition
* @returns {SourceMappedStringI}
*/
export function wrapWithDefs(inner: SourceMappedStringI, definitions: Definitions): SourceMappedStringI;
/**
* @typedef {{
* dependsOnOwnHash: boolean
* purpose?: string
* name: string
* hashDependencies: Record<string, string>
* validatorTypes?: ScriptTypes
* validatorIndices?: Record<string, number>
* currentScriptValue?: string
* makeParamsSubstitutable: boolean
* }} ExtraDefOptions
*/
/**
* @param {ExtraDefOptions} options
* @returns {Definitions}
*/
export function genExtraDefs(options: ExtraDefOptions): Definitions;
/**
* @protected
* @param {SourceMappedStringI} ir
* @param {Definitions} definitions
* @returns {Set<string>}
*/
export function collectAllUsed(ir: SourceMappedStringI, definitions: Definitions): Set<string>;
/**
* @typedef {import("@helios-lang/compiler-utils").Site} Site
* @typedef {import("@helios-lang/ir").SourceMappedStringI} SourceMappedStringI
* @typedef {import("../typecheck/index.js").ScriptTypes} ScriptTypes
*/
/**
* `keySite` is an optional way to give the key a proper name
* @typedef {{
* content: SourceMappedStringI
* keySite?: Site
* }} Definition
*/
/**
* TODO: this should be wrapped by a class
* @typedef {Map<string, Definition>} Definitions
*/
export const TAB: " ";
export const PARAM_IR_PREFIX: "__";
export const PARAM_IR_MACRO: "__param";
export type ExtraDefOptions = {
dependsOnOwnHash: boolean;
purpose?: string;
name: string;
hashDependencies: Record<string, string>;
validatorTypes?: ScriptTypes;
validatorIndices?: Record<string, number>;
currentScriptValue?: string;
makeParamsSubstitutable: boolean;
};
export type Site = import("@helios-lang/compiler-utils").Site;
export type SourceMappedStringI = import("@helios-lang/ir").SourceMappedStringI;
export type ScriptTypes = import("../typecheck/index.js").ScriptTypes;
/**
* `keySite` is an optional way to give the key a proper name
*/
export type Definition = {
content: SourceMappedStringI;
keySite?: Site;
};
/**
* TODO: this should be wrapped by a class
*/
export type Definitions = Map<string, Definition>;
//# sourceMappingURL=Definitions.d.ts.map