@picahq/ai
Version:
Pica AI SDK for Vercel AI SDK integration
26 lines (25 loc) • 892 B
TypeScript
/**
* Paginate results from a fetch function
* @param fetchFn - The function to fetch the results
* @param limit - The number of results to fetch per page
* @returns An array of all results
*/
export declare function paginateResults<T>(fetchFn: (skip: number, limit: number) => Promise<{
rows: T[];
total: number;
skip: number;
limit: number;
}>, limit?: number): Promise<T[]>;
/**
* Normalize an action ID
* @param raw - The raw action ID
* @returns The normalized action ID
*/
export declare function normalizeActionId(raw: string): string;
/**
* Replace path variables in a path
* @param path - The path to replace variables in
* @param variables - The variables to replace in the path
* @returns The path with the variables replaced
*/
export declare function replacePathVariables(path: string, variables: Record<string, string | number | boolean>): string;