ws-dottie
Version:
Your friendly TypeScript companion for Washington State transportation APIs - WSDOT and WSF data with smart caching and React Query integration
45 lines • 1.82 kB
TypeScript
/**
* UI and output utilities
*/
import type { CliOptions } from "./types";
/**
* Handle errors with consistent formatting and helpful context
* @param error - The error to handle (can be any type)
* @param functionName - Name of the function that caused the error
* @throws Never returns, always exits process with code 1
*/
export declare const handleError: (error: unknown, functionName: string) => never;
/**
* Display function not found error with list of available functions
* @param functionName - The function name that was not found
*/
export declare const displayFunctionNotFound: (functionName: string) => void;
/**
* Output result with formatting based on CLI options
* @param result - The result data to output
* @param options - CLI options controlling output format (pretty, head, etc.)
*/
export declare const outputResult: (result: unknown, options: CliOptions) => void;
/**
* Setup console suppression for quiet modes
* @param isQuiet - Whether to suppress console output
* @returns Object with restore method to re-enable console output
*/
export declare const setupConsoleSuppression: (isQuiet: boolean) => {
restore: () => void;
};
/**
* Generate default CLI examples for a given tool name
* @param toolName - Name of the CLI tool
* @param additionalExamples - Additional examples to include
* @returns Array of example command strings
*/
export declare const generateDefaultExamples: (toolName: string, additionalExamples?: string[]) => string[];
/**
* Generate help text with examples and available functions
* @param toolName - Name of the CLI tool
* @param examples - Array of example commands to include
* @returns Formatted help text string
*/
export declare const generateHelpText: (toolName: string, examples?: string[]) => string;
//# sourceMappingURL=ui.d.ts.map