pulse/interfaces/formatter.interface.ts

17 lines
416 B
TypeScript

import type { FeedItem } from './feed.types.js';
export type OutputFormat = 'terminal' | 'html' | 'json';
export interface FormatterError {
code: 'SERIALIZE_ERROR' | 'UNKNOWN';
message: string;
}
export interface IFormatter {
/**
* Format items to the specified output format.
* Returns string for terminal/html/json output.
*/
format(items: FeedItem[], format: OutputFormat): Promise<string>;
}