import { type Dayjs } from 'dayjs'; import { type ValueOf } from 'xshell/prototype.common.js'; export declare const nulls: { readonly int8: -128; readonly int16: -32768; readonly int32: -2147483648; readonly int64: -0x8000000000000000n; readonly int128: -0x80000000000000000000000000000000n; readonly float32: -3.4028234663852886e+38; /** -Number.MAX_VALUE */ readonly double: number; readonly bytes16: Uint8Array; }; export declare const DdbForm: { readonly scalar: 0; readonly vector: 1; readonly pair: 2; readonly matrix: 3; readonly set: 4; readonly dict: 5; readonly table: 6; readonly chart: 7; /** 节点内部通信可能会使用,调用函数执行脚本一般不会返回这种类型 */ readonly chunk: 8; /** sysobj */ readonly object: 9; readonly tensor: 10; readonly extobj: 11; }; export type DdbForm = ValueOf; /** DolphinDB DataType 对应的 array vector 类型为 64 + 基本类型 对应的 extended 类型为 128 + 基本类型 */ export declare const DdbType: { readonly void: 0; readonly bool: 1; readonly char: 2; readonly short: 3; readonly int: 4; readonly long: 5; readonly date: 6; readonly month: 7; readonly time: 8; readonly minute: 9; readonly second: 10; readonly datetime: 11; readonly timestamp: 12; readonly nanotime: 13; readonly nanotimestamp: 14; readonly float: 15; readonly double: 16; readonly symbol: 17; readonly string: 18; readonly uuid: 19; readonly functiondef: 20; readonly handle: 21; readonly code: 22; readonly datasource: 23; readonly resource: 24; readonly any: 25; readonly compressed: 26; readonly dict: 27; readonly datehour: 28; readonly ipaddr: 30; readonly int128: 31; readonly blob: 32; readonly complex: 34; readonly point: 35; readonly duration: 36; readonly decimal32: 37; readonly decimal64: 38; readonly decimal128: 39; readonly object: 40; readonly iotany: 41; readonly instrument: 42; readonly market_data: 43; readonly symbol_extended: 145; }; export type DdbType = ValueOf; export declare const number_nulls: Map; export declare const DdbFunctionType: { readonly SystemFunc: 0; readonly SystemProc: 1; readonly OperatorFunc: 2; readonly UserDefinedFunc: 3; readonly PartialFunc: 4; readonly DynamicFunc: 5; readonly PiecewiseFunc: 6; readonly JitFunc: 7; readonly JitPartialFunc: 8; }; export type DdbFunctionType = ValueOf; export declare const DdbDurationUnit: { readonly ns: 0; readonly us: 1; readonly ms: 2; readonly s: 3; readonly m: 4; readonly H: 5; readonly d: 6; readonly w: 7; readonly M: 8; readonly y: 9; readonly B: 10; }; export type DdbDurationUnit = ValueOf; export declare const DdbChartType: { readonly area: 0; readonly bar: 1; readonly column: 2; readonly histogram: 3; readonly line: 4; readonly pie: 5; readonly scatter: 6; readonly trend: 7; readonly kline: 8; readonly surface: 9; }; export type DdbChartType = ValueOf; export declare const DdbVoidType: { readonly undefined: 0; readonly null: 1; readonly default: 2; }; export type DdbVoidType = ValueOf; export interface DdbFunctionDefValue { type: DdbFunctionType; name: string; } export interface DdbDurationValue { unit: DdbDurationUnit; /** int32 */ data: number; } export interface DdbDecimal32Value { /** int32, data 需要除以 10^scale 得到原值 */ scale: number; /** int32, 空值为 null ddb null is js null */ data: number | null; } export interface DdbDecimal64Value { /** int32, data 需要除以 10^scale 得到原值 */ scale: number; /** int64, 空值为 null empty value is null */ data: bigint | null; } export interface DdbDecimal128Value { /** int32, data 需要除以 10^scale 得到原值 */ scale: number; /** int128, 空值为 null empty value is null */ data: bigint | null; } export interface DdbDecimal32VectorValue { scale: number; data: Int32Array; } export interface DdbDecimal64VectorValue { scale: number; data: BigInt64Array; } export type DdbDurationVectorValue = DdbDurationValue[]; export interface DdbSymbolExtendedValue { base_id: number; base: string[]; data: Uint32Array; } export interface DdbExtObjValue { type: Uint8Array; version: number; data: Uint8Array; } export declare const dictables: Set<4 | 5 | 15 | 16 | 18 | 25>; /** 工具,取得某个 DdbType 的字节数 */ export declare const ddb_tensor_bytes: { readonly 1: 1; readonly 2: 1; readonly 3: 2; readonly 4: 4; readonly 5: 8; readonly 15: 4; readonly 16: 8; }; export type TensorElem = TensorData | boolean | number | bigint | null | string; export interface TensorData extends Array { } export interface DdbTensorMetadata { /** Tensor 的元素的数据类型 */ data_type: DdbType; /** Tensor 类型 */ tensor_type: number; /** 设备类型 */ device_type: number; /** Tensor Flags */ tensor_flags: number; /** 维度 */ dimensions: number; /** shape, shape[i] 表示第 i 个维度的 size */ shape: number[]; /** strides, strides[i] 表示在第 i 个维度,一个元素与下一个元素的距离 */ strides: number[]; /** 保留值 */ preserve_value: bigint; /** 元素个数 */ elem_count: number; } export interface DdbTensorValue extends DdbTensorMetadata { /** 数据 */ data: Uint8Array; } /** DdbObj.data() 返回的表格对象 */ export interface DdbTableData { /** 表名 */ name: string; /** 每一列的名称 */ columns: string[]; /** 每一列的原始 ddb 数据类型 */ types: DdbType[]; /** 表格数据,每一行的对象组成的数组 */ data: TRow[]; } /** DdbObj.data() 返回的 Tensor 对象 */ export interface DdbTensorData extends DdbTensorMetadata { /** 数据 */ data: TensorData; } /** DdbObj.data() 返回的矩阵对象 */ export interface DdbMatrixData { /** 原始数据类型 */ type: DdbType; /** 行数 */ nrows: number; /** 列数 */ ncolumns: number; /** 行名称 */ rows?: any[]; /** 列名称 */ columns?: any[]; /** 数据, data[0][1] 为第 0 行第 1 列数据 */ data: any[][]; } export type DdbScalarValue = null | boolean | number | bigint | string | Uint8Array | // uuid, ipaddr, int128, blob [ number, number ] | // complex, point DdbFunctionDefValue | DdbDurationValue | DdbDecimal32Value | DdbDecimal64Value | DdbDecimal128Value; export type IotVectorItemValue = [number | string | bigint | boolean][]; /** 根据 DdbType 获取其名称,array vector type 自动在后面加上 [] */ export declare function get_type_name(type: DdbType): string; export declare function is_decimal_type(type: DdbType): type is 37 | 38 | 39; export declare function is_decimal_null_value(type: DdbType, value: number | bigint): boolean; export declare function get_duration_unit(code: number): string; export type ConvertableDdbTimeValue = undefined | null | number | string | Date | Dayjs; export declare const ddb_time_converters: Record number | bigint>; export declare function get_time_ddbobj(type: DdbType, js_value: ConvertableDdbTimeValue): { form: 0; type: DdbType; value: number | bigint; }; export declare function get_times_ddbobj(type: DdbType, js_values?: ConvertableDdbTimeValue[], name?: string): { form: 1; type: DdbType; rows: number; cols: number; value: BigInt64Array | Int32Array; name: string; }; export declare function get_big_uint_128(dataview: DataView, byte_offset: number, le?: boolean): bigint; export declare function get_big_int_128(dataview: DataView, byte_offset: number, le?: boolean): bigint; export declare function set_big_uint_128(dataView: DataView, byte_offset: number, value: bigint, le?: boolean): void; export declare function set_big_int_128(dataview: DataView, byte_offset: number, value: bigint, le?: boolean): void; export declare function generate_array_type(baseType: string, dimensions: number[]): string; export declare function set_timezone(timezone?: string): void; export declare function date2str(date: number | null): string; export declare function month2str(month: number | null): string; export declare function time2str(time: number | null): string; export declare function minute2str(minute: number | null): string; export declare function second2str(second: number | null): string; export declare function datetime2ms(datetime: number | null): number | null; export declare function datetime2str(datetime: number | null, format?: string): string; /** _datetime_formatter.format 会在 date 为 Invalid Date 时抛出错误 */ export declare function timestamp2ms(timestamp: bigint | number | null): number | null; /** format timestamp (bigint) to string - timestamp: bigint value - format?: 格式串,默认是 `YYYY.MM.DD HH:mm:ss.SSS` format string, default to `YYYY.MM.DD HH:mm:ss.SSS` https://day.js.org/docs/en/parse/string-format#list-of-all-available-parsing-tokens */ export declare function timestamp2str(timestamp: bigint | null, format?: string): string; export declare function datehour2ms(datehour: number | null): number | null; export declare function datehour2str(datehour: number | null, format?: string): string; /** parse timestamp string to bigint value - str: timestamp string, 如果为空字符串或 'null' 会返回对应的空值 (nulls.int64) timestamp string, If it is an empty string or 'null', it will return the corresponding empty value (nulls.int64) - format?: 对应传入字符串的格式串,默认是 `YYYY.MM.DD HH:mm:ss.SSS` The format string corresponding to the incoming string, the default is `YYYY.MM.DD HH:mm:ss.SSS` https://day.js.org/docs/en/parse/string-format#list-of-all-available-parsing-tokens */ export declare function str2timestamp(str: string, format?: string): bigint; /** 格式化为 HH:mm:ss.SSSSSSSSS */ export declare function nanotime2str(nanotime: bigint | null): string; export declare function nanotimestamp2ns(nanotimestamp: bigint | null): bigint | null; /** format nanotimestamp value (bigint) to string - nanotimestamp: bigint value - format?: 格式串,默认是 `YYYY.MM.DD HH:mm:ss.SSSSSSSSS` format string, default is `YYYY.MM.DD HH:mm:ss.SSSSSSSSS` 秒的格式为 ss (必须包含); 纳秒的格式为 SSSSSSSSS (必须包含) Seconds are in the format ss (must be included); nanoseconds are in the format SSSSSSSSS (must be included) https://day.js.org/docs/en/parse/string-format#list-of-all-available-parsing-tokens */ export declare function nanotimestamp2str(nanotimestamp: bigint | null, format?: string): string; /** parse nano timestamp string to bigint value - str: nano timestamp string, 如果为空字符串或 'null' 会返回对应的空值 (nulls.int64) nano timestamp string, If it is an empty string or 'null', it will return the corresponding empty value (nulls.int64) - format?: 对应传入字符串的格式串,默认是 `YYYY.MM.DD HH:mm:ss.SSSSSSSSS` 秒的格式为 ss (必须包含); 纳秒的格式为 SSSSSSSSS (必须包含) https://day.js.org/docs/en/parse/string-format#list-of-all-available-parsing-tokens The format string corresponding to the incoming string, the default is `YYYY.MM.DD HH:mm:ss.SSSSSSSSS` Seconds are in the format ss (must be included); nanoseconds are in the format SSSSSSSSS (must be included) */ export declare function str2nanotimestamp(str: string, format?: string): bigint; /** 时间值转字符串函数集合 */ export declare const time_formatters: Map string>; export declare function ipaddr2str(buffer: Uint8Array, le?: boolean, ipv6?: boolean): string; export declare function uuid2str(buffer: Uint8Array, le?: boolean): string; export declare function int1282str(buffer: Uint8Array, le?: boolean): string; export interface ConvertOptions { /** `'string'` blob 转换到 string 还是 Uint8Array */ blob?: 'string' | 'binary'; /** `'string'` char 转换到 string 还是 number */ char?: 'string' | 'number'; /** `'strings'` char vector 转换格式: strings 转为 string[], binary 转为 Uint8Array */ chars?: 'strings' | 'binary'; /** `'ms'` timestamp 类型转换为字符串表示时显示到秒还是毫秒 */ timestamp?: 's' | 'ms'; /** `'data'` 表格类型返回格式: data 转为 TResult, full 转为 DdbTableData */ table?: 'data' | 'full'; } export declare const winsize: 10000; export type DdbRpcType = 'script' | 'function' | 'variable' | 'connect'; export type DdbLanguage = 'dolphindb' | 'python' | 'q'; export declare const function_definition_patterns: { dolphindb: RegExp; python: RegExp; q: RegExp; }; export declare const funcdefs: { readonly invoke: { readonly dolphindb: string; readonly python: string; readonly q: string; }; readonly jsrpc: { readonly dolphindb: string; readonly python: string; readonly q: string; }; readonly pnode_run: { readonly dolphindb: string; readonly python: string; readonly q: string; }; }; export declare function get_number_formatter(integer: boolean, decimals?: number | null, grouping?: boolean): Intl.NumberFormat; export declare const urgent: { urgent: boolean; }; export declare const aiscript: { ai: boolean; }; /** SQL Standrd 标准类型 */ export declare const SqlStandard: { readonly DolphinDB: 0; readonly Oracle: 1; readonly MySQL: 2; }; export type SqlStandard = ValueOf;