whodis-mcp-server
Version:
Whodis MCP Server for checking the availability of domain names using WHOIS lookups.
58 lines (57 loc) • 2.2 kB
TypeScript
/**
* Standardized formatting utilities for consistent output across all CLI and Tool interfaces.
* These functions should be used by all formatters to ensure consistent formatting.
*/
/**
* Format a date in a standardized way: YYYY-MM-DD HH:MM:SS UTC
* @param dateString - ISO date string or Date object
* @returns Formatted date string
*/
export declare function formatDate(dateString?: string | Date): string;
/**
* Format a relative time (e.g., "2 days ago")
* @param dateString - ISO date string or Date object
* @returns Relative time string
*/
export declare function formatRelativeTime(dateString?: string | Date): string;
/**
* Format a URL as a markdown link
* @param url - URL to format
* @param title - Link title
* @returns Formatted markdown link
*/
export declare function formatUrl(url?: string, title?: string): string;
/**
* Format pagination information in a standardized way
* @param totalItems - Number of items in the current result set
* @param hasMore - Whether there are more results available
* @param nextCursor - Cursor for the next page of results
* @returns Formatted pagination information
*/
export declare function formatPagination(totalItems: number, hasMore: boolean, nextCursor?: string): string;
/**
* Format a heading with consistent style
* @param text - Heading text
* @param level - Heading level (1-6)
* @returns Formatted heading
*/
export declare function formatHeading(text: string, level?: number): string;
/**
* Format a list of key-value pairs as a bullet list
* @param items - Object with key-value pairs
* @param keyFormatter - Optional function to format keys
* @returns Formatted bullet list
*/
export declare function formatBulletList(items: Record<string, unknown>, keyFormatter?: (key: string) => string): string;
/**
* Format a separator line
* @returns Separator line
*/
export declare function formatSeparator(): string;
/**
* Format a numbered list of items
* @param items - Array of items to format
* @param formatter - Function to format each item
* @returns Formatted numbered list
*/
export declare function formatNumberedList<T>(items: T[], formatter: (item: T, index: number) => string): string;