UNPKG

histoire

Version:

A fast story book powered by Vite

18 lines • 1.38 kB
import type { Context } from '../context.js'; import type { UiChannelServer } from '../server/ui-channel/types.js'; import { z } from 'zod'; /** Stable registration signature for generation-owned marketplace services. */ export type MarketplaceRegistrar = (ctx: Context, channel: UiChannelServer, isActive: () => boolean) => void; /** Correlation and public validation details that differ between service events. */ interface CorrelatedOptions { /** Captured generation remains the only owner of replies. */ isActive: () => boolean; /** Public validation failure for this operation. */ invalidMessage?: string; /** Job actions use jobId only for failed replies. */ identity?: 'requestId' | 'jobId'; /** Optional public error for oversized review output. */ capacityMessage?: string; } /** Parse correlation first, then validate feature data and publish one bounded private reply. */ export declare function registerCorrelated<Schema extends z.ZodTypeAny>(channel: UiChannelServer, event: string, resultEvent: string, schema: Schema, run: (request: z.output<Schema>) => Promise<Record<string, unknown>>, fallbackMessage: string, options: CorrelatedOptions): void; /** Attach marketplace services to the captured development generation only. */ export declare const registerMarketplaceChannels: MarketplaceRegistrar; export {}; //# sourceMappingURL=channel.d.ts.map