import { type Type } from '@frontmcp/di'; import { type ChannelContext } from '../interfaces'; import { type ChannelMetadata } from '../metadata'; /** * Discriminator enum for channel record types. */ export declare enum ChannelKind { /** Channel defined as a class decorated with @Channel */ CLASS_TOKEN = "CLASS_TOKEN", /** Channel defined using channel() function builder */ FUNCTION = "FUNCTION" } /** * Record for class-based channels decorated with @Channel. * * @example * ```typescript * @Channel({ * name: 'deploy-alerts', * source: { type: 'webhook', path: '/hooks/deploy' }, * }) * export class DeployChannel extends ChannelContext { ... } * ``` */ export interface ChannelClassTokenRecord { kind: ChannelKind.CLASS_TOKEN; provide: Type; metadata: ChannelMetadata; } /** * Record for function-based channels created with channel(). * * @example * ```typescript * const ErrorChannel = channel({ * name: 'error-alerts', * source: { type: 'app-event', event: 'error' }, * })((payload) => ({ * content: `Error: ${payload.message}`, * })); * ``` */ export interface ChannelFunctionTokenRecord { kind: ChannelKind.FUNCTION; provide: (...args: any[]) => any | Promise; metadata: ChannelMetadata; } /** * Union type of all possible channel record types. */ export type ChannelRecord = ChannelClassTokenRecord | ChannelFunctionTokenRecord; //# sourceMappingURL=channel.record.d.ts.map