UNPKG

@harmoniclabs/plu-ts-onchain

Version:

An embedded DSL for Cardano smart contracts creation coupled with a library for Cardano transactions, all in Typescript

16 lines (15 loc) 883 B
import type { PDataRepresentable } from "../../../PType/PDataRepresentable.js"; import type { PBool, PDelayed, PList, TermFn } from "../../../PTypes/index.js"; import { PAlias } from "../../../PTypes/PAlias/palias.js"; import { TermType, AliasT, ListT, ToPType } from "../../../type_system/index.js"; export type ListMaybeT<T extends TermType> = AliasT<ListT<T>, { isNothing: TermFn<[PList<ToPType<T>>], PBool>; unwarpOrFail: TermFn<[PList<ToPType<T>>], ToPType<T>>; unwarpOrElse: TermFn<[PList<ToPType<T>>, PDelayed<ToPType<T>>], ToPType<T>>; }>; export type PListMaybeT<PTy extends PDataRepresentable> = PAlias<PList<PTy>, { isNothing: TermFn<[PList<PTy>], PBool>; unwarpOrFail: TermFn<[PList<PTy>], PTy>; unwarpOrElse: TermFn<[PList<PTy>, PDelayed<PTy>], PTy>; }>; export declare function PListMaybe<T extends TermType>(tyArg: T): PListMaybeT<ToPType<T>>;