dolphindb 3.1.37 → 3.1.39
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.
- package/browser.d.ts +3 -3
- package/browser.js +7 -7
- package/browser.js.map +1 -1
- package/common.d.ts +1 -0
- package/common.js.map +1 -1
- package/index.d.ts +3 -3
- package/index.js +4 -4
- package/index.js.map +1 -1
- package/package.json +4 -4
package/browser.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Dayjs } from 'dayjs';
|
|
2
2
|
import { Lock } from 'xshell/utils.browser.js';
|
|
3
3
|
import { type WebSocketConnectionError } from 'xshell/net.browser.js';
|
|
4
|
-
import { DdbChartType, DdbForm, DdbFunctionType, DdbType, DdbVoidType, type ConvertOptions, type DdbDecimal32Value, type DdbDecimal32VectorValue, type DdbDecimal64Value, type DdbDecimal64VectorValue, type DdbDurationValue, type DdbDurationVectorValue, type DdbFunctionDefValue, type DdbRpcType, type DdbScalarValue, type DdbSymbolExtendedValue, type DdbTableData, type DdbTensorValue, type IotVectorItemValue, type TensorData, type DdbExtObjValue, type ConvertableDdbTimeValue } from './common.ts';
|
|
4
|
+
import { DdbChartType, DdbForm, DdbFunctionType, DdbType, DdbVoidType, type ConvertOptions, type DdbDecimal32Value, type DdbDecimal32VectorValue, type DdbDecimal64Value, type DdbDecimal64VectorValue, type DdbDurationValue, type DdbDurationVectorValue, type DdbFunctionDefValue, type DdbRpcType, type DdbScalarValue, type DdbSymbolExtendedValue, type DdbTableData, type DdbTensorValue, type IotVectorItemValue, type TensorData, type DdbExtObjValue, type ConvertableDdbTimeValue, type DdbLanguage } from './common.ts';
|
|
5
5
|
export * from './common.ts';
|
|
6
6
|
export interface DdbDecimal128VectorValue {
|
|
7
7
|
scale: number;
|
|
@@ -185,7 +185,7 @@ export interface InspectOptions {
|
|
|
185
185
|
export declare function format(type: DdbType, value: DdbValue, le: boolean, options?: InspectOptions): string;
|
|
186
186
|
/** 格式化向量、集合中的第 index 项为字符串,空值返回 'null' 字符串 formatted vector, the index-th item in the collection is a string, a null value returns a 'null' string */
|
|
187
187
|
export declare function formati(obj: DdbVectorObj, index: number, options?: InspectOptions): string;
|
|
188
|
-
export declare function convert(type: DdbType, value: DdbValue, le: boolean, { blob, char, timestamp }?: ConvertOptions): string | number | bigint | boolean | number[] | DdbFunctionDefValue | DdbDurationValue | DdbDecimal32Value | DdbDecimal64Value |
|
|
188
|
+
export declare function convert(type: DdbType, value: DdbValue, le: boolean, { blob, char, timestamp }?: ConvertOptions): string | number | bigint | boolean | number[] | Uint8Array<ArrayBufferLike> | DdbFunctionDefValue | DdbDurationValue | DdbDecimal32Value | DdbDecimal64Value | Int8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike> | BigInt64Array<ArrayBufferLike> | BigInt128Array | string[] | Uint8Array<ArrayBufferLike>[] | DdbObj<DdbValue>[] | IotVectorItemValue | DdbSymbolExtendedValue | DdbArrayVectorValue | DdbDecimal32VectorValue | DdbDecimal64VectorValue | DdbDecimal128VectorValue | DdbDurationVectorValue | DdbMatrixValue | DdbChartValue | DdbTensorValue | DdbExtObjValue;
|
|
189
189
|
/** 转换一个向量到 js 原生数组 */
|
|
190
190
|
export declare function converts(type: DdbType, value: DdbVectorValue, rows: number, le: boolean, options?: ConvertOptions): any[] | Uint8Array;
|
|
191
191
|
/** 构造 void 类型,默认为 `DdbVoidType.undefined` */
|
|
@@ -418,7 +418,7 @@ export declare class DDB {
|
|
|
418
418
|
kdb: boolean;
|
|
419
419
|
/** 是否为 dolphindb 语言 */
|
|
420
420
|
dolphindb: boolean;
|
|
421
|
-
language:
|
|
421
|
+
language: DdbLanguage;
|
|
422
422
|
/** 表示本次会话执行的 SQL 标准 */
|
|
423
423
|
sql: SqlStandard;
|
|
424
424
|
/** 是否为流数据连接,非流数据这个字段恒为 null Whether it is a streaming data connection, this field is always null for non-streaming data */
|
package/browser.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { empty } from 'xshell/prototype.browser.js';
|
|
2
|
-
import { blue, cyan, green,
|
|
2
|
+
import { blue, cyan, green, gray, magenta } from 'xshell/chalk.browser.js';
|
|
3
3
|
import { concat, assert, Lock, genid, seq, zip_object, decode, check } from 'xshell/utils.browser.js';
|
|
4
4
|
import { connect_websocket } from 'xshell/net.browser.js';
|
|
5
5
|
import { t } from "./i18n/index.js";
|
|
@@ -1567,10 +1567,10 @@ export class DdbObj {
|
|
|
1567
1567
|
return obj;
|
|
1568
1568
|
}
|
|
1569
1569
|
}
|
|
1570
|
-
const
|
|
1570
|
+
const gray_nullstr = gray('null');
|
|
1571
1571
|
function get_nullstr(options) {
|
|
1572
1572
|
return options.nullstr ?
|
|
1573
|
-
options.colors ?
|
|
1573
|
+
options.colors ? gray_nullstr : 'null'
|
|
1574
1574
|
:
|
|
1575
1575
|
'';
|
|
1576
1576
|
}
|
|
@@ -1599,7 +1599,7 @@ function format_time(type, value, options) {
|
|
|
1599
1599
|
function format_number(type, value, options) {
|
|
1600
1600
|
if (value === null || value === number_nulls.get(type))
|
|
1601
1601
|
return options.nullstr ?
|
|
1602
|
-
options.colors ?
|
|
1602
|
+
options.colors ? gray_nullstr : 'null'
|
|
1603
1603
|
:
|
|
1604
1604
|
'';
|
|
1605
1605
|
const str = get_number_formatter(type === DdbType.int || type === DdbType.long || type === DdbType.short, options.decimals, options.grouping).format(value);
|
|
@@ -1611,9 +1611,9 @@ export function format(type, value, le, options = {}) {
|
|
|
1611
1611
|
case DdbType.void: {
|
|
1612
1612
|
return options.nullstr ?
|
|
1613
1613
|
value === DdbVoidType.default ?
|
|
1614
|
-
options.colors ?
|
|
1614
|
+
options.colors ? gray('default') : 'default'
|
|
1615
1615
|
:
|
|
1616
|
-
options.colors ?
|
|
1616
|
+
options.colors ? gray_nullstr : 'null'
|
|
1617
1617
|
:
|
|
1618
1618
|
'';
|
|
1619
1619
|
}
|
|
@@ -1797,7 +1797,7 @@ export function formati(obj, index, options = {}) {
|
|
|
1797
1797
|
case DdbType.decimal128:
|
|
1798
1798
|
const x = data[acc_len + i];
|
|
1799
1799
|
if (is_decimal_null_value(type_, x))
|
|
1800
|
-
items[i] = options.colors ?
|
|
1800
|
+
items[i] = options.colors ? gray('null') : 'null';
|
|
1801
1801
|
else {
|
|
1802
1802
|
const { scale } = obj.value;
|
|
1803
1803
|
const s = String(x < 0 ? -x : x).padStart(scale, '0');
|