import type { SwapEvtType, UnpackEvt, NonPostableEvtLike} from "./types"; /** * https://docs.evt.land/api/evt/loosentype */ export function loosenType, SupersetOfT>( evt: E ): UnpackEvt extends SupersetOfT ? SwapEvtType : "NOT A SUPERSET" { return evt as any; } /* import { Evt } from "./Evt"; const x: Evt = loosenType(new Evt()); x; const y: Evt = loosenType(new Evt()); y; */