@harmoniclabs/plu-ts-onchain
Version:
An embedded DSL for Cardano smart contracts creation coupled with a library for Cardano transactions, all in Typescript
20 lines (19 loc) • 582 B
TypeScript
import { TermType } from "../../type_system/index.js";
/**
* given a term type of a function (lambda)
* extracts all the types from the inputs to the output
*
* the last type is the final output of the funciton.
*
*
* @example
* ```ts
* const notFn = getFnTypes( int ); // [ int ];
* const simleLam = getFnTypes( lam( int, bs ) ); // [ int, bs ];
* const twoIns = getFnTypes( fn([ int, str ], bs ) ); // [ int, str, bs ];
* ```
*
* @param {TermType} fnT function term type
* @returns {TermType[]}
*/
export declare function getFnTypes(fnT: TermType): TermType[];