import { $Fetch } from 'ofetch'; import { BarsLatestQuery, BarsLatestResponse, BarsQuery, BarsResponse } from './bars.type'; export interface IBarsServiceOptions { /** The CMS `$Fetch` instance (one of `sdk.apis`). */ api: $Fetch; /** Lazy flag — when true, the service returns fake data. */ mock: () => boolean; } export interface IBarsService { getBars(query: BarsQuery): Promise; /** * Latest M1 bar per symbol — `POST /api/v1/chart/bars/latest`. * Wire contract (verified against the live demo server): body * `{ symbols, serverName }` (camelCase); response is a map keyed by * SYMBOL, each value a `BarsLatestItem`. Unknown symbols are omitted. */ getLatestBars(query: BarsLatestQuery): Promise; } /** * Chart-bars service (read-only). Wraps `GET /api/v1/chart/bars` — the * canonical OHLC read path for chart rendering of any timeframe. Storage * is always M1; larger timeframes are derived on demand via bucket-and-reduce. * Also wraps `POST /api/v1/chart/bars/latest` (latest bar per symbol). * * Endpoint contracts (`eaera_cms/chart/routes.py`, doc §5.5): * GET /api/v1/chart/bars → BarsResponse * POST /api/v1/chart/bars/latest → BarsLatestResponse * * While `mock()` returns true, all methods resolve against the local fake * dataset and never touch `api`. */ export declare function createBarsService(opts: IBarsServiceOptions): IBarsService; //# sourceMappingURL=index.d.ts.map