/** * Public API types for the 大案牍库 SDK. * These mirror the server's contract schemas as plain TypeScript interfaces. */ interface Entry { id: string; title: string; content: string | null; url: string | null; source: string; category: "finance" | "news" | "tech" | "social" | "blog" | "podcast" | "uncategorized"; tags: string[]; author: string | null; language: string; published: string; created_at?: string; } interface SearchRequest { q: string; category?: string; source?: string; from?: string; to?: string; limit?: number; offset?: number; } interface SearchResult { id: string; title: string; source: string; category: string; published: string; score: number; } interface SearchResponse { results: SearchResult[]; total: number; query: string; tier: "anonymous" | "free" | "premium"; tierCutoff: string | null; } interface FeedsRequest { category?: string; source?: string; from?: string; to?: string; limit?: number; offset?: number; } interface FeedsResponse { entries: Entry[]; total: number; } interface CategoryStat { category: string; count: number; } interface SourceStat { source: string; count: number; } interface StatsResponse { total: number; byCategory: CategoryStat[]; bySource: SourceStat[]; lastUpdated: string | null; } interface DakClientOptions { baseUrl: string; apiKey?: string; } declare class DakClient { private baseUrl; private headers; constructor(options: DakClientOptions); private request; private buildQuery; search(params: SearchRequest): Promise; getFeeds(params?: Partial): Promise; getFeed(id: string): Promise; getFeedsByCategory(category: string, params?: Omit, "category">): Promise; getFeedsBySource(source: string, params?: Omit, "source">): Promise; getStats(): Promise; } declare class DakError extends Error { status: number; body: unknown; constructor(message: string, status: number, body: unknown); } export { type CategoryStat, DakClient, type DakClientOptions, DakError, type Entry, type FeedsRequest, type FeedsResponse, type SearchRequest, type SearchResponse, type SearchResult, type SourceStat, type StatsResponse };