UNPKG

libmodulor

Version:

A TypeScript library to create platform-agnostic applications

24 lines (23 loc) 1.2 kB
import type { UCOPIBase } from './opi.js'; import type { UCOutputPart, UCOutputPartDef } from './output-part.js'; import type { UCOutputSideEffect } from './side-effect.js'; export type UCOutputPartIdx = 0 | 1; export type UCOutputPartKey<OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined> = keyof UCOutput<OPI0, OPI1>['parts']; export interface UCOutput<OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined> { parts: { _0: UCOutputPart<NonNullable<OPI0>>; _1?: UCOutputPart<NonNullable<OPI1>>; }; } export type UCOutputOrNothing<OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined> = UCOutput<OPI0, OPI1> | void; /** * Definition of a use case output */ export interface UCOutputDef<OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined> { parts?: { _0: UCOutputPartDef<NonNullable<OPI0>>; _1?: UCOutputPartDef<NonNullable<OPI1>>; }; sideEffects?: UCOutputSideEffect[]; } export declare function buildSingleItemOutput<OPI0 extends UCOPIBase>(item: OPI0): UCOutput<OPI0>;