import { FUGLE_MARKETDATA_WS_SUPPORTED_VERSIONS } from '../constants'; export type WebSocketProduct = keyof typeof FUGLE_MARKETDATA_WS_SUPPORTED_VERSIONS; export type WebSocketVersion = typeof FUGLE_MARKETDATA_WS_SUPPORTED_VERSIONS[WebSocketProduct][number]; /** * Per-product form. Each product is narrowed to the versions it actually * serves, so `{ stock: 'v1.1' }` is a compile-time error. A product left out * of the map — including the empty map — gets that product's latest. */ export type WebSocketVersionMap = { [P in WebSocketProduct]?: typeof FUGLE_MARKETDATA_WS_SUPPORTED_VERSIONS[P][number]; }; /** * The `version` option: always a per-product map. * * A bare version string used to be accepted as "this version for every * product", but which product it applied to wasn't known until a client was * taken off the factory, so an unsupported pairing only surfaced then — and * with the products serving different version sets, the only scalar that never * throws is the one every product happens to share. The map form says the same * thing without the trap. */ export type WebSocketVersionOption = WebSocketVersionMap; /** * Resolve the streaming version for a product from the `version` option. * * Omitted entirely, an empty map, or omitted for this product all mean the same * thing: that product's latest. Nothing is ever silently clamped — asking for a * version a product doesn't serve throws rather than quietly handing back an * older one. */ export declare const resolveVersion: (product: WebSocketProduct, version?: WebSocketVersionOption) => string; /** Appended to `baseUrl` rejections, pointing at the option that owns the version. */ export declare const VERSION_OPTION_HINT = "The version comes from the `version` option, e.g. version: { futopt: 'v1.1' }.";