@harmoniclabs/plu-ts-onchain
Version:
An embedded DSL for Cardano smart contracts creation coupled with a library for Cardano transactions, all in Typescript
17 lines (16 loc) • 967 B
TypeScript
import { PType } from "../../../PType/index.js";
import { PAsData, PBool, PPair, TermFn } from "../../../PTypes/index.js";
import { Term } from "../../../Term/index.js";
import { UtilityTermOf } from "./addUtilityForType.js";
import { PappArg } from "../../pappArg.js";
import { TermBool } from "./TermBool.js";
import { BaseUtilityTermExtension } from "./BaseUtilityTerm.js";
type UnwrapPAsData<PT extends PType> = PT extends PAsData<infer PTy extends PType> ? PTy : PT;
export type TermPair<PFst extends PType, PSnd extends PType> = Term<PPair<PFst, PSnd>> & BaseUtilityTermExtension & {
readonly fst: UtilityTermOf<UnwrapPAsData<PFst>>;
readonly snd: UtilityTermOf<UnwrapPAsData<PSnd>>;
readonly peq: TermFn<[PPair<PFst, PSnd>], PBool>;
readonly eq: (other: PappArg<PPair<PFst, PSnd>>) => TermBool;
};
export declare function addPPairMethods<PFst extends PType, PSnd extends PType>(_pair: Term<PPair<PFst, PSnd>>): TermPair<PFst, PSnd>;
export {};