@xbbg/core 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,694 @@
1
+ import { Table } from 'apache-arrow';
2
+
3
+ interface BlpRequestErrorOptions {
4
+ readonly service?: string;
5
+ readonly operation?: string;
6
+ readonly request_id?: string;
7
+ readonly code?: string | number;
8
+ }
9
+ interface BlpValidationErrorOptions {
10
+ readonly element?: string;
11
+ readonly suggestion?: string;
12
+ }
13
+ declare class BlpError extends Error {
14
+ constructor(message: string);
15
+ }
16
+ declare class BlpSessionError extends BlpError {
17
+ }
18
+ declare class BlpRequestError extends BlpError {
19
+ readonly service?: string;
20
+ readonly operation?: string;
21
+ readonly request_id?: string;
22
+ readonly code?: string | number;
23
+ constructor(message: string, options?: BlpRequestErrorOptions);
24
+ }
25
+ declare class BlpValidationError extends BlpError {
26
+ readonly element?: string;
27
+ readonly suggestion?: string;
28
+ constructor(message: string, options?: BlpValidationErrorOptions);
29
+ }
30
+ declare class BlpTimeoutError extends BlpError {
31
+ }
32
+ declare class BlpInternalError extends BlpError {
33
+ }
34
+ declare function wrapError(napiError: unknown): BlpError;
35
+
36
+ /**
37
+ * Date-like input accepted by xbbg JS surfaces (issue #317).
38
+ *
39
+ * Mirrors the Python `DateLike` alias and the JS half of the date-acceptance
40
+ * matrix described in the issue:
41
+ *
42
+ * - `Date` — JavaScript Date (treated as a calendar date in UTC; the time
43
+ * portion is ignored when formatting to `YYYYMMDD`).
44
+ * - `string` — ISO 8601 (`"2023-01-17"`, `"2023-01-17T10:30:00"`,
45
+ * `"2023-01-17T10:30:00-05:00"`) or Bloomberg-native (`"20230117"`).
46
+ * Ambiguous formats like `"01/17/2023"` are rejected.
47
+ * - `number` — epoch milliseconds.
48
+ * - duck-typed Luxon `DateTime` — anything implementing `toJSDate()`.
49
+ */
50
+ type DateLike = Date | string | number | {
51
+ toJSDate: () => Date;
52
+ };
53
+ /**
54
+ * Datetime-like input. Same shape as `DateLike` today; named separately so the
55
+ * call sites (`startDatetime`, `endDatetime`, `dt` on intraday surfaces) can
56
+ * read clearly.
57
+ */
58
+ type DateTimeLike = DateLike;
59
+ interface StringPair {
60
+ key: string;
61
+ value: string;
62
+ }
63
+ interface ServerAddress {
64
+ host: string;
65
+ port: number;
66
+ }
67
+ type AuthConfig = {
68
+ method: 'user';
69
+ } | {
70
+ method: 'app';
71
+ appName: string;
72
+ } | {
73
+ method: 'userapp';
74
+ appName: string;
75
+ } | {
76
+ method: 'dir' | 'directory';
77
+ dirProperty: string;
78
+ } | {
79
+ method: 'manual';
80
+ appName: string;
81
+ userId: string;
82
+ ipAddress: string;
83
+ } | {
84
+ method: 'token';
85
+ token: string;
86
+ };
87
+ interface TlsConfig {
88
+ clientCredentials?: string;
89
+ clientCredentialsPassword?: string;
90
+ trustMaterial?: string;
91
+ handshakeTimeoutMs?: number;
92
+ crlFetchTimeoutMs?: number;
93
+ }
94
+ interface RetryPolicy {
95
+ maxRetries?: number;
96
+ initialDelayMs?: number;
97
+ backoffFactor?: number;
98
+ maxDelayMs?: number;
99
+ }
100
+ interface Socks5Config {
101
+ host: string;
102
+ port: number;
103
+ }
104
+ interface EngineConfig {
105
+ host?: string;
106
+ port?: number;
107
+ servers?: ServerAddress[];
108
+ zfpRemote?: '8194' | '8196';
109
+ requestPoolSize?: number;
110
+ subscriptionPoolSize?: number;
111
+ validationMode?: string;
112
+ subscriptionFlushThreshold?: number;
113
+ maxEventQueueSize?: number;
114
+ commandQueueSize?: number;
115
+ subscriptionStreamCapacity?: number;
116
+ overflowPolicy?: string;
117
+ warmupServices?: string[];
118
+ fieldCachePath?: string;
119
+ auth?: AuthConfig;
120
+ tls?: TlsConfig;
121
+ numStartAttempts?: number;
122
+ autoRestartOnDisconnection?: boolean;
123
+ retryPolicy?: RetryPolicy;
124
+ /** Hard per-request timeout in ms; 0 disables. Default 0. */
125
+ requestTimeoutMs?: number;
126
+ /** Warn threshold for streams staying deactivated, in ms. 0 disables. Default 30000. */
127
+ streamsDeactivatedWarnMs?: number;
128
+ /** Enable BLPAPI keep-alive pings. SDK default: true. */
129
+ keepAliveEnabled?: boolean;
130
+ /** Milliseconds of inactivity before keep-alive ping. SDK default: 20000. */
131
+ keepAliveInactivityMs?: number;
132
+ /** Milliseconds to wait for a keep-alive response. SDK default: 10000. */
133
+ keepAliveResponseTimeoutMs?: number;
134
+ /** Slow-consumer hi water mark as fraction of maxEventQueueSize. SDK default: 0.75. */
135
+ slowConsumerHiWaterMark?: number;
136
+ /** Slow-consumer lo water mark as fraction of maxEventQueueSize. SDK default: 0.5. */
137
+ slowConsumerLoWaterMark?: number;
138
+ sdkLogLevel?: string;
139
+ socks5?: Socks5Config;
140
+ }
141
+ interface RequestInput {
142
+ service: string;
143
+ operation: string;
144
+ requestOperation?: string;
145
+ requestId?: string;
146
+ extractor?: string;
147
+ securities?: readonly string[];
148
+ security?: string;
149
+ fields?: readonly string[];
150
+ overrides?: readonly StringPair[];
151
+ elements?: readonly StringPair[];
152
+ kwargs?: readonly StringPair[];
153
+ jsonElements?: string;
154
+ startDate?: string;
155
+ endDate?: string;
156
+ startDatetime?: string;
157
+ endDatetime?: string;
158
+ requestTz?: string;
159
+ outputTz?: string;
160
+ eventType?: string;
161
+ eventTypes?: readonly string[];
162
+ interval?: number;
163
+ options?: readonly StringPair[];
164
+ fieldTypes?: readonly StringPair[];
165
+ includeSecurityErrors?: boolean;
166
+ validateFields?: boolean;
167
+ searchSpec?: string;
168
+ fieldIds?: readonly string[];
169
+ format?: string;
170
+ backend?: BackendKind;
171
+ }
172
+ interface SubscriptionStats {
173
+ messagesReceived: number;
174
+ droppedBatches: number;
175
+ batchesSent: number;
176
+ slowConsumer: boolean;
177
+ }
178
+ interface FieldInfo {
179
+ fieldId: string;
180
+ arrowType: string;
181
+ description: string;
182
+ category: string;
183
+ }
184
+ type PrimitiveValue = string | number | boolean;
185
+ type OverridesMap = Record<string, PrimitiveValue>;
186
+ interface BdpOptions {
187
+ overrides?: OverridesMap;
188
+ kwargs?: OverridesMap;
189
+ format?: string;
190
+ backend?: BackendKind;
191
+ includeSecurityErrors?: boolean;
192
+ validateFields?: boolean;
193
+ }
194
+ interface BdhOptions {
195
+ start?: DateLike;
196
+ end?: DateLike;
197
+ overrides?: OverridesMap;
198
+ kwargs?: OverridesMap;
199
+ format?: string;
200
+ backend?: BackendKind;
201
+ validateFields?: boolean;
202
+ }
203
+ interface BdibOptions {
204
+ start?: DateTimeLike;
205
+ end?: DateTimeLike;
206
+ requestTz?: string;
207
+ outputTz?: string;
208
+ eventType?: string;
209
+ interval?: number;
210
+ kwargs?: OverridesMap;
211
+ backend?: BackendKind;
212
+ }
213
+ interface BdtickOptions {
214
+ start?: DateTimeLike;
215
+ end?: DateTimeLike;
216
+ requestTz?: string;
217
+ outputTz?: string;
218
+ eventTypes?: readonly string[];
219
+ includeConditionCodes?: boolean;
220
+ includeExchangeCodes?: boolean;
221
+ includeBrokerCodes?: boolean;
222
+ includeRpsCodes?: boolean;
223
+ includeBicMicCodes?: boolean;
224
+ includeNonPlottableEvents?: boolean;
225
+ includeBloombergStandardConditionCodes?: boolean;
226
+ kwargs?: OverridesMap;
227
+ backend?: BackendKind;
228
+ }
229
+ interface CdxOptions extends BdpOptions {
230
+ recoveryRate?: number;
231
+ recovery_rate?: number;
232
+ }
233
+ interface BqlOptions {
234
+ kwargs?: OverridesMap;
235
+ format?: string;
236
+ backend?: BackendKind;
237
+ }
238
+ interface BeqsOptions {
239
+ asof?: DateLike;
240
+ screenType?: string;
241
+ group?: string;
242
+ overrides?: OverridesMap;
243
+ kwargs?: OverridesMap;
244
+ format?: string;
245
+ backend?: BackendKind;
246
+ }
247
+ interface BsrchOptions {
248
+ overrides?: OverridesMap;
249
+ kwargs?: OverridesMap;
250
+ format?: string;
251
+ backend?: BackendKind;
252
+ }
253
+ interface BtaOptions {
254
+ studyParams?: OverridesMap;
255
+ kwargs?: OverridesMap;
256
+ startDate?: DateLike;
257
+ endDate?: DateLike;
258
+ start_date?: DateLike;
259
+ end_date?: DateLike;
260
+ periodicity?: string;
261
+ interval?: number;
262
+ format?: string;
263
+ backend?: BackendKind;
264
+ }
265
+ interface BfldsOptions {
266
+ fields?: string | readonly string[];
267
+ searchSpec?: string;
268
+ kwargs?: OverridesMap;
269
+ format?: string;
270
+ backend?: BackendKind;
271
+ }
272
+ interface BlkpOptions {
273
+ kwargs?: OverridesMap;
274
+ format?: string;
275
+ backend?: BackendKind;
276
+ }
277
+ interface RequestOptions {
278
+ overrides?: OverridesMap;
279
+ kwargs?: OverridesMap;
280
+ format?: string;
281
+ backend?: BackendKind;
282
+ }
283
+ interface StreamOptions {
284
+ options?: readonly string[];
285
+ flushThreshold?: number;
286
+ overflowPolicy?: string;
287
+ streamCapacity?: number;
288
+ allFields?: boolean;
289
+ fields?: readonly string[];
290
+ }
291
+ interface BqrOptions {
292
+ startDatetime?: DateTimeLike;
293
+ endDatetime?: DateTimeLike;
294
+ eventTypes?: readonly string[];
295
+ includeBrokerCodes?: boolean;
296
+ backend?: BackendKind;
297
+ }
298
+ interface YasOptions {
299
+ settleDt?: DateLike;
300
+ yieldType?: number;
301
+ spread?: number;
302
+ yieldVal?: number;
303
+ price?: number;
304
+ benchmark?: string;
305
+ backend?: BackendKind;
306
+ }
307
+ interface PreferredsOptions {
308
+ fields?: readonly string[];
309
+ backend?: BackendKind;
310
+ }
311
+ interface CorporateBondsOptions {
312
+ ccy?: string;
313
+ fields?: readonly string[];
314
+ activeOnly?: boolean;
315
+ backend?: BackendKind;
316
+ }
317
+ interface FuturesResolveOptions {
318
+ freq?: string;
319
+ backend?: BackendKind;
320
+ }
321
+ interface ActiveCdxOptions {
322
+ lookbackDays?: number;
323
+ backend?: BackendKind;
324
+ }
325
+ interface DividendOptions {
326
+ dvdType?: string;
327
+ backend?: BackendKind;
328
+ }
329
+ interface TurnoverOptions {
330
+ ccy?: string;
331
+ factor?: number;
332
+ backend?: BackendKind;
333
+ }
334
+ interface EtfHoldingsOptions {
335
+ fields?: readonly string[];
336
+ backend?: BackendKind;
337
+ }
338
+ interface RecipeBackendOptions {
339
+ backend?: BackendKind;
340
+ }
341
+ interface TimeRange {
342
+ start: string;
343
+ end: string;
344
+ }
345
+ interface TickerParts {
346
+ prefix: string;
347
+ index: number;
348
+ asset: string;
349
+ exchange?: string;
350
+ }
351
+ interface FuturesCandidate {
352
+ ticker: string;
353
+ year: number;
354
+ month: number;
355
+ }
356
+ interface CdxTickerInfo {
357
+ index: string;
358
+ series: string;
359
+ tenor: string;
360
+ asset: string;
361
+ isGeneric: boolean;
362
+ seriesNum?: number;
363
+ }
364
+ interface FxPairInfo {
365
+ fxPair: string;
366
+ factor: number;
367
+ fromCcy: string;
368
+ toCcy: string;
369
+ }
370
+ interface SessionWindowsInfo {
371
+ day?: TimeRange;
372
+ allday?: TimeRange;
373
+ pre?: TimeRange;
374
+ post?: TimeRange;
375
+ am?: TimeRange;
376
+ pm?: TimeRange;
377
+ }
378
+ interface MarketRule {
379
+ preMinutes: number;
380
+ postMinutes: number;
381
+ lunchStartMin?: number;
382
+ lunchEndMin?: number;
383
+ isContinuous: boolean;
384
+ }
385
+ interface ExchangeInfoResult {
386
+ ticker: string;
387
+ mic?: string;
388
+ exchCode?: string;
389
+ timezone: string;
390
+ utcOffset?: number;
391
+ source: string;
392
+ day?: TimeRange;
393
+ allday?: TimeRange;
394
+ pre?: TimeRange;
395
+ post?: TimeRange;
396
+ am?: TimeRange;
397
+ pm?: TimeRange;
398
+ }
399
+ interface ExchangeOverrideInput {
400
+ timezone?: string;
401
+ mic?: string;
402
+ exchCode?: string;
403
+ day?: TimeRange;
404
+ allday?: TimeRange;
405
+ pre?: TimeRange;
406
+ post?: TimeRange;
407
+ am?: TimeRange;
408
+ pm?: TimeRange;
409
+ }
410
+ type BackendKind = 'arrow' | 'json' | 'polars';
411
+ type FormatKind = 'long' | 'long_typed' | 'long_with_metadata' | 'semi_long';
412
+
413
+ type NativeArrowColumnType = 'bool' | 'binary' | 'date32' | 'date64' | 'float32' | 'float64' | 'int8' | 'int16' | 'int32' | 'int64' | 'large_binary' | 'large_utf8' | 'null' | 'time32_ms' | 'time32_s' | 'time64_us' | 'time64_ns' | 'timestamp_ms' | 'timestamp_ns' | 'timestamp_s' | 'timestamp_us' | 'uint8' | 'uint16' | 'uint32' | 'uint64' | 'utf8';
414
+ interface NativeArrowColumn {
415
+ readonly name: string;
416
+ readonly type: NativeArrowColumnType;
417
+ readonly nullable: boolean;
418
+ readonly length: number;
419
+ readonly nullCount: number;
420
+ readonly timezone?: string;
421
+ readonly data?: Buffer;
422
+ readonly offsets?: Buffer;
423
+ readonly nullBitmap?: Buffer;
424
+ }
425
+ interface NativeArrowZeroCopyBatch {
426
+ readonly kind: 'zeroCopy';
427
+ readonly numRows: number;
428
+ readonly columns: NativeArrowColumn[];
429
+ }
430
+ type NativeUpdateValue = null | boolean | number | string;
431
+ interface NativeSubscriptionUpdate {
432
+ readonly kind: 'update';
433
+ readonly topic: string;
434
+ readonly topicId: number;
435
+ readonly timestampUs: number;
436
+ readonly layoutVersion: number;
437
+ readonly fields: readonly string[];
438
+ readonly values: readonly NativeUpdateValue[];
439
+ readonly valueKinds: readonly string[];
440
+ }
441
+ interface NativeSubscription {
442
+ nextUpdate(): Promise<NativeSubscriptionUpdate | null>;
443
+ nextArrow(): Promise<NativeArrowZeroCopyBatch | null>;
444
+ add(tickers: readonly string[]): Promise<void>;
445
+ remove(tickers: readonly string[]): Promise<void>;
446
+ unsubscribe(drain: boolean): Promise<NativeSubscriptionUpdate[] | null>;
447
+ unsubscribeArrow(drain: boolean): Promise<NativeArrowZeroCopyBatch[] | null>;
448
+ readonly tickers: string[];
449
+ readonly fields: string[];
450
+ readonly isActive: boolean;
451
+ readonly stats: SubscriptionStats;
452
+ }
453
+
454
+ /**
455
+ * Date / datetime normalization helpers (issue #317).
456
+ *
457
+ * These helpers convert user-supplied date-like values into the wire formats
458
+ * the Bloomberg engine expects:
459
+ *
460
+ * - {@link formatDate} -> Bloomberg-native ``YYYYMMDD`` (used by historical
461
+ * requests, override fields, recipe inputs).
462
+ * - {@link formatDateTime} -> RFC 3339 / ISO 8601 with optional offset (used
463
+ * by intraday requests).
464
+ *
465
+ * They live in a dedicated module so the public surface in ``index.ts`` can
466
+ * be tested without dragging in the native NAPI addon.
467
+ */
468
+
469
+ /**
470
+ * Format a date-like value to ``YYYYMMDD`` (Bloomberg-native).
471
+ *
472
+ * Accepts ``Date``, ISO 8601 / Bloomberg-native strings, epoch ms, and any
473
+ * duck-typed Luxon-style ``{ toJSDate(): Date }``. Strict on ambiguous formats.
474
+ */
475
+ declare function formatDate(value: DateLike | undefined | null): string | undefined;
476
+ /**
477
+ * Format a datetime-like value to RFC 3339 (ISO 8601 with optional offset).
478
+ *
479
+ * Naive ISO strings without a tz suffix are returned as-is so the Rust engine
480
+ * can apply the caller's ``request_tz``. Anything else (Date, epoch ms, Luxon
481
+ * DateTime, or ISO with explicit tz) is converted to a tz-bearing ISO string.
482
+ */
483
+ declare function formatDateTime(value: DateTimeLike | undefined | null): string | undefined;
484
+
485
+ declare const Backend: Readonly<{
486
+ ARROW: "arrow";
487
+ JSON: "json";
488
+ POLARS: "polars";
489
+ }>;
490
+ declare const Format: Readonly<{
491
+ LONG: "long";
492
+ LONG_TYPED: "long_typed";
493
+ LONG_WITH_METADATA: "long_with_metadata";
494
+ SEMI_LONG: "semi_long";
495
+ }>;
496
+ interface RawStudy {
497
+ studyType?: string;
498
+ study?: string;
499
+ calcInterval?: string;
500
+ interval?: number | string;
501
+ length?: number;
502
+ period?: number;
503
+ [key: string]: PrimitiveValue | undefined;
504
+ }
505
+ type TickValue = null | boolean | number | bigint | string | Date;
506
+ declare class FieldHandle {
507
+ readonly name: string;
508
+ constructor(name: string);
509
+ }
510
+ declare class Tick {
511
+ private readonly _update;
512
+ private readonly _positions;
513
+ constructor(_update: NativeSubscriptionUpdate);
514
+ get topic(): string;
515
+ get timestampUs(): number;
516
+ get layoutVersion(): number;
517
+ get(field: string | FieldHandle): TickValue;
518
+ f64(field: string | FieldHandle): number | null;
519
+ i64(field: string | FieldHandle): bigint | null;
520
+ str(field: string | FieldHandle): string | null;
521
+ toObject(): Record<string, unknown>;
522
+ }
523
+ declare class ArrowSubscription implements AsyncIterator<Table>, AsyncIterable<Table> {
524
+ private readonly _inner;
525
+ constructor(_inner: NativeSubscription);
526
+ next(): Promise<IteratorResult<Table>>;
527
+ unsubscribe(drain?: boolean): Promise<Table[]>;
528
+ [Symbol.asyncIterator](): this;
529
+ }
530
+ declare class Subscription implements AsyncIterator<Tick>, AsyncIterable<Tick> {
531
+ private readonly _inner;
532
+ constructor(inner: NativeSubscription);
533
+ next(): Promise<IteratorResult<Tick>>;
534
+ add(tickers: readonly string[]): Promise<void>;
535
+ remove(tickers: readonly string[]): Promise<void>;
536
+ unsubscribe(drain?: boolean): Promise<Tick[]>;
537
+ field(name: string): FieldHandle;
538
+ arrow(): ArrowSubscription;
539
+ get tickers(): string[];
540
+ get fields(): string[];
541
+ get isActive(): boolean;
542
+ get stats(): SubscriptionStats;
543
+ [Symbol.asyncIterator](): this;
544
+ }
545
+ declare class Engine {
546
+ private _inner;
547
+ constructor(host?: string, port?: number);
548
+ static withConfig(config?: EngineConfig): Engine;
549
+ request(params: RequestInput): Promise<unknown>;
550
+ requestRaw(params: RequestInput): Promise<Buffer>;
551
+ bdp(tickers: readonly string[], fields: readonly string[], options?: BdpOptions): Promise<unknown>;
552
+ bds(tickers: readonly string[], fields: readonly string[], options?: BdpOptions): Promise<unknown>;
553
+ bdh(tickers: readonly string[], fields: readonly string[], options?: BdhOptions): Promise<unknown>;
554
+ bdib(ticker: string, options?: BdibOptions): Promise<unknown>;
555
+ bdtick(ticker: string, options?: BdtickOptions): Promise<unknown>;
556
+ bql(query: string, options?: BqlOptions): Promise<unknown>;
557
+ beqs(screen: string, options?: BeqsOptions): Promise<unknown>;
558
+ bsrch(searchSpec: string, options?: BsrchOptions): Promise<unknown>;
559
+ bta(ticker: string, study: string | RawStudy, options?: BtaOptions): Promise<unknown>;
560
+ bflds(options?: BfldsOptions): Promise<unknown>;
561
+ blkp(query: string, options?: BlkpOptions): Promise<unknown>;
562
+ bport(portfolio: string, fields: string | readonly string[], options?: RequestOptions): Promise<unknown>;
563
+ bcurves(ticker: string, options?: RequestOptions): Promise<unknown>;
564
+ bgovts(ticker: string, options?: RequestOptions): Promise<unknown>;
565
+ resolveFieldTypes(fields: readonly string[], overrides?: OverridesMap, defaultType?: string): Promise<Record<string, string>>;
566
+ getFieldInfo(field: string): FieldInfo | null;
567
+ clearFieldCache(): void;
568
+ saveFieldCache(): void;
569
+ validateFields(fields: readonly string[]): Promise<string[]>;
570
+ isFieldValidationEnabled(): boolean;
571
+ getSchema(service: string): Promise<unknown>;
572
+ getOperation(service: string, operation: string): Promise<unknown>;
573
+ listOperations(service: string): Promise<string[]>;
574
+ getCachedSchema(service: string): unknown;
575
+ invalidateSchema(service: string): void;
576
+ clearSchemaCache(): void;
577
+ listCachedSchemas(): string[];
578
+ getEnumValues(service: string, operation: string, element: string): Promise<string[] | null>;
579
+ listValidElements(service: string, operation: string): Promise<string[] | null>;
580
+ subscribe(tickers: readonly string[], fields: readonly string[], options?: StreamOptions): Promise<Subscription>;
581
+ subscribeWithOptions(service: string, tickers: readonly string[], fields: readonly string[], options?: readonly string[], flushThreshold?: number, overflowPolicy?: string, streamCapacity?: number, allFields?: boolean): Promise<Subscription>;
582
+ signalShutdown(): void;
583
+ isAvailable(): boolean;
584
+ stream(tickers: readonly string[], fields: readonly string[], options?: StreamOptions): Promise<Subscription>;
585
+ vwap(tickers: readonly string[], fields: readonly string[], options?: StreamOptions): Promise<Subscription>;
586
+ mktbar(ticker: string, options?: StreamOptions): Promise<Subscription>;
587
+ depth(ticker: string, options?: StreamOptions): Promise<Subscription>;
588
+ chains(ticker: string, options?: StreamOptions): Promise<Subscription>;
589
+ bops(service: string): Promise<string[]>;
590
+ bschema(service: string, operation?: string): Promise<unknown>;
591
+ fieldInfo(fields: string | readonly string[], options?: BfldsOptions): Promise<unknown>;
592
+ fieldSearch(searchSpec: string, options?: BfldsOptions): Promise<unknown>;
593
+ bqr(ticker: string, options?: BqrOptions): Promise<unknown>;
594
+ yas(tickers: string | readonly string[], fields: string | readonly string[], options?: YasOptions): Promise<unknown>;
595
+ preferreds(equityTicker: string, options?: PreferredsOptions): Promise<unknown>;
596
+ corporateBonds(ticker: string, options?: CorporateBondsOptions): Promise<unknown>;
597
+ futTicker(genTicker: string, dt: DateLike, options?: FuturesResolveOptions): Promise<unknown>;
598
+ activeFutures(genTicker: string, dt: DateLike, options?: FuturesResolveOptions): Promise<unknown>;
599
+ cdxTicker(genTicker: string, dt: DateLike, options?: RecipeBackendOptions): Promise<unknown>;
600
+ activeCdx(genTicker: string, dt: DateLike, options?: ActiveCdxOptions): Promise<unknown>;
601
+ dividend(tickers: string | readonly string[], startDate: DateLike, endDate: DateLike, options?: DividendOptions): Promise<unknown>;
602
+ turnover(tickers: string | readonly string[], startDate: DateLike, endDate: DateLike, options?: TurnoverOptions): Promise<unknown>;
603
+ etfHoldings(etfTicker: string, options?: EtfHoldingsOptions): Promise<unknown>;
604
+ currencyConversion(ticker: string, targetCcy: string, startDate: DateLike, endDate: DateLike, options?: RecipeBackendOptions): Promise<unknown>;
605
+ }
606
+ declare function connect(config?: EngineConfig): Promise<Engine>;
607
+ declare function configure(config?: EngineConfig): EngineConfig | undefined;
608
+ declare function configure(host?: string, port?: number): EngineConfig | undefined;
609
+ declare function abdp(tickers: string | readonly string[], fields: string | readonly string[], options?: BdpOptions): Promise<unknown>;
610
+ declare function bdp(tickers: string | readonly string[], fields: string | readonly string[], options?: BdpOptions): Promise<unknown>;
611
+ declare function abdh(tickers: string | readonly string[], fields: string | readonly string[], start?: DateLike | BdhOptions, end?: DateLike, options?: BdhOptions): Promise<unknown>;
612
+ declare function bdh(tickers: string | readonly string[], fields: string | readonly string[], options?: BdhOptions): Promise<unknown>;
613
+ declare function abds(tickers: string | readonly string[], fields: string | readonly string[], overrides?: OverridesMap, options?: BdpOptions): Promise<unknown>;
614
+ declare function bds(tickers: string | readonly string[], fields: string | readonly string[], options?: BdpOptions): Promise<unknown>;
615
+ declare function abdib(ticker: string, dt?: DateTimeLike | BdibOptions, interval?: number | BdibOptions, options?: BdibOptions): Promise<unknown>;
616
+ declare function bdib(ticker: string, options?: BdibOptions): Promise<unknown>;
617
+ declare function abdtick(ticker: string, start: DateTimeLike | null | undefined, end: DateTimeLike | null | undefined, options?: BdtickOptions): Promise<unknown>;
618
+ declare function bdtick(ticker: string, options?: BdtickOptions): Promise<unknown>;
619
+ declare function asubscribe(tickers: string | readonly string[], fields: string | readonly string[], options?: StreamOptions): Promise<Subscription>;
620
+ declare function subscribe(tickers: string | readonly string[], fields: string | readonly string[], options?: StreamOptions): Promise<Subscription>;
621
+ declare function acdxInfo(ticker: string, options?: BdpOptions): Promise<unknown>;
622
+ declare function acdxPricing(ticker: string, options?: CdxOptions): Promise<unknown>;
623
+ declare function acdxRisk(ticker: string, options?: CdxOptions): Promise<unknown>;
624
+ declare const blp: Readonly<{
625
+ bdp: typeof bdp;
626
+ bdh: typeof bdh;
627
+ bds: typeof bds;
628
+ bdib: typeof bdib;
629
+ bdtick: typeof bdtick;
630
+ subscribe: typeof subscribe;
631
+ abdp: typeof abdp;
632
+ abdh: typeof abdh;
633
+ abds: typeof abds;
634
+ abdib: typeof abdib;
635
+ abdtick: typeof abdtick;
636
+ asubscribe: typeof asubscribe;
637
+ }>;
638
+ declare const ext: Readonly<{
639
+ cdx: Readonly<{
640
+ acdx_info: typeof acdxInfo;
641
+ acdx_pricing: typeof acdxPricing;
642
+ acdx_risk: typeof acdxRisk;
643
+ }>;
644
+ parseDate: (dateStr: string) => number[];
645
+ fmtDate: (year: number, month: number, day: number, fmt?: string) => string;
646
+ pivotToWide: (ipcBuffer: Buffer) => Buffer;
647
+ isLongFormat: (ipcBuffer: Buffer) => boolean;
648
+ parseTicker: (ticker: string) => TickerParts;
649
+ isSpecificContract: (ticker: string) => boolean;
650
+ buildFuturesTicker: (prefix: string, monthCode: string, year: string, asset: string) => string;
651
+ normalizeTickers: (tickers: readonly string[]) => string[];
652
+ filterEquityTickers: (tickers: readonly string[]) => string[];
653
+ generateFuturesCandidates: (genTicker: string, year: number, month: number, day: number, freq?: string, count?: number) => FuturesCandidate[];
654
+ validateGenericTicker: (ticker: string) => void;
655
+ contractIndex: (genTicker: string) => number;
656
+ filterCandidatesByCycle: (candidates: readonly FuturesCandidate[], cycle: string) => FuturesCandidate[];
657
+ filterValidContracts: (contracts: readonly StringPair[], year: number, month: number, day: number) => string[];
658
+ parseCdxTicker: (ticker: string) => CdxTickerInfo;
659
+ previousCdxSeries: (ticker: string) => string | null;
660
+ cdxGenToSpecific: (genTicker: string, series: number) => string;
661
+ buildFxPair: (fromCcy: string, toCcy: string) => FxPairInfo;
662
+ sameCurrency: (ccy1: string, ccy2: string) => boolean;
663
+ currenciesNeedingConversion: (currencies: readonly string[], target: string) => string[];
664
+ renameDividendColumns: (columns: readonly string[]) => StringPair[];
665
+ renameEtfColumns: (columns: readonly string[]) => StringPair[];
666
+ getMonthCode: (monthName: string) => string | null;
667
+ getMonthName: (code: string) => string | null;
668
+ getFuturesMonths: () => StringPair[];
669
+ getDvdType: (typ: string) => string | null;
670
+ getDvdTypes: () => StringPair[];
671
+ getDvdCols: () => StringPair[];
672
+ getEtfCols: () => StringPair[];
673
+ buildYasOverrides: (settleDt?: string, yieldType?: number, spread?: number, yieldVal?: number, price?: number, benchmark?: string) => StringPair[];
674
+ buildEarningHeaderRename: (headerRow: readonly StringPair[], dataColumns: readonly string[]) => StringPair[];
675
+ calculateLevelPercentages: (values: readonly (number | null)[], levels: readonly (number | null)[]) => (number | null)[];
676
+ buildPreferredsQuery: (equityTicker: string, extraFields?: readonly string[]) => string;
677
+ buildCorporateBondsQuery: (ticker: string, ccy?: string, extraFields?: readonly string[], activeOnly?: boolean) => string;
678
+ buildEtfHoldingsQuery: (etfTicker: string, extraFields?: readonly string[]) => string;
679
+ defaultTurnoverDates: (startDate?: string, endDate?: string) => TimeRange;
680
+ defaultBqrDatetimes: (startDatetime?: string, endDatetime?: string) => TimeRange;
681
+ deriveSessions: (dayStart: string, dayEnd: string, mic?: string, exchCode?: string) => SessionWindowsInfo;
682
+ getMarketRule: (mic?: string, exchCode?: string) => MarketRule | null;
683
+ inferTimezone: (countryIso: string) => string | null;
684
+ setExchangeOverride: (ticker: string, input: ExchangeOverrideInput) => void;
685
+ getExchangeOverride: (ticker: string) => ExchangeInfoResult | null;
686
+ clearExchangeOverride: (ticker?: string) => void;
687
+ listExchangeOverrides: () => ExchangeInfoResult[];
688
+ sessionTimesToUtc: (startTime: string, endTime: string, exchangeTz: string, date: string) => TimeRange;
689
+ }>;
690
+ declare function version(): string;
691
+ declare const setLogLevel: (level: string) => void;
692
+ declare const getLogLevel: () => string;
693
+
694
+ export { type ActiveCdxOptions, ArrowSubscription, type AuthConfig, Backend, type BackendKind, type BdhOptions, type BdibOptions, type BdpOptions, type BdtickOptions, type BeqsOptions, type BfldsOptions, type BlkpOptions, BlpError, BlpInternalError, BlpRequestError, BlpSessionError, BlpTimeoutError, BlpValidationError, type BqlOptions, type BqrOptions, type BsrchOptions, type BtaOptions, type CdxOptions, type CdxTickerInfo, type CorporateBondsOptions, type DateLike, type DateTimeLike, type DividendOptions, Engine, type EngineConfig, type EtfHoldingsOptions, type ExchangeInfoResult, type ExchangeOverrideInput, FieldHandle, type FieldInfo, Format, type FormatKind, type FuturesCandidate, type FuturesResolveOptions, type FxPairInfo, type MarketRule, type OverridesMap, type PreferredsOptions, type PrimitiveValue, type RecipeBackendOptions, type RequestInput, type RequestOptions, type ServerAddress, type SessionWindowsInfo, type Socks5Config, type StreamOptions, type StringPair, Subscription, type SubscriptionStats, Tick, type TickValue, type TickerParts, type TimeRange, type TlsConfig, type TurnoverOptions, type YasOptions, abdh, abdib, abdp, abds, abdtick, asubscribe, bdh, bdib, bdp, bds, bdtick, blp, configure, connect, ext, formatDate, formatDateTime, getLogLevel, setLogLevel, subscribe, version, wrapError };