/** * Service layer for interacting with Urban Dictionary API */ import { UrbanDefinition } from "../types/index.js"; /** * Custom error class for Urban Dictionary API errors */ export declare class UrbanDictionaryError extends Error { originalError?: Error | undefined; constructor(message: string, originalError?: Error | undefined); } /** * Fetches definitions for a given term from Urban Dictionary * @param term - The slang term to look up * @returns Array of definitions * @throws UrbanDictionaryError if the API request fails */ export declare function fetchDefinitions(term: string): Promise; /** * Fetches a random word and its definitions from Urban Dictionary * @returns Array of definitions for a random word * @throws UrbanDictionaryError if the API request fails */ export declare function fetchRandomWord(): Promise; /** * Sorts definitions by popularity (thumbs_up count) * @param definitions - Array of definitions to sort * @returns Sorted array (descending by thumbs_up) */ export declare function sortByPopularity(definitions: UrbanDefinition[]): UrbanDefinition[]; /** * Limits the number of definitions returned * @param definitions - Array of definitions * @param limit - Maximum number to return * @returns Sliced array */ export declare function limitDefinitions(definitions: UrbanDefinition[], limit: number): UrbanDefinition[]; //# sourceMappingURL=urbanDictionary.d.ts.map