import type { ViewBackend, LeaderboardMetric, LeaderboardRow, LeaderboardCategory } from './views.js'; /** * Fluent builder for composable leaderboards. * * Time windowing (`since`/`until`) applies to trade-derived metrics only * (trade_count, volume, avg_trade_size). Position-derived metrics * (total_pnl, roi, win_rate, etc.) always reflect current position state. * * @example * ```ts * cache.leaderboard() * .metrics(['total_pnl', 'volume', 'win_rate']) * .slugs(['*election*']) * .since(weekAgo) * .limit(10) * .build() * ``` */ export declare class LeaderboardBuilder { private _backend; private _metrics; private _sortBy?; private _sortDir; private _conditionIds?; private _slugPatterns?; private _wallets?; private _since?; private _until?; private _limit?; constructor(backend: ViewBackend); /** Set multiple metrics to compute for each leaderboard row. */ metrics(m: LeaderboardMetric[]): this; /** Set a single metric. Convenience for `.metrics([m])`. */ metric(m: LeaderboardMetric): this; /** Which metric to sort/rank by. Defaults to the first metric. */ sortBy(m: LeaderboardMetric): this; /** Sort direction. Default: DESC (highest first). */ sort(dir: 'ASC' | 'DESC'): this; /** Filter to positions/trades in these markets (by condition_id). */ markets(conditionIds: string[]): this; /** Filter by market_slug glob patterns. `*` matches any characters. */ slugs(patterns: string[]): this; /** Apply a named category (sugar over `.slugs()`). */ category(cat: LeaderboardCategory): this; /** Rank only these wallets instead of the full watchlist. */ wallets(w: string[]): this; /** Only count trades at or after this timestamp (unix seconds). Trade metrics only. */ since(ts: number): this; /** Only count trades at or before this timestamp (unix seconds). Trade metrics only. */ until(ts: number): this; /** Return only the top N rows. */ limit(n: number): this; /** Execute the query and return ranked leaderboard rows. */ build(): LeaderboardRow[]; } //# sourceMappingURL=leaderboard-builder.d.ts.map