libshv-js 9.0.1 → 10.0.0

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.
@@ -1,4 +1,4 @@
1
- import { type RpcValue, type RpcValueType, type DateTime, Decimal, Double, type IMap, type Int, type MetaMap, RpcValueWithMetaData, type ShvMap, UInt } from './rpcvalue.js';
1
+ import { type RpcValue, type RpcValueType, type DateTime, Decimal, Double, type IMap, type Int, type MetaMap, RpcValueWithMetaData, type ShvMap, UInt, shvMapType } from './rpcvalue.js';
2
2
  import { UnpackContext, PackContext } from './cpcontext.js';
3
3
  declare class ChainPackReader {
4
4
  ctx: UnpackContext;
@@ -8,7 +8,14 @@ declare class ChainPackReader {
8
8
  readUIntDataHelper(type: 'Int' | 'UInt'): bigint;
9
9
  readIntData(): number;
10
10
  readUIntData(): number;
11
- readList(): (string | number | boolean | Double | Decimal | ArrayBuffer | DateTime | UInt<number> | import("./rpcvalue.js").List | ShvMap<Record<string, any>> | IMap<Record<number, any>> | RpcValueWithMetaData<MetaMap<Record<string | number, RpcValue>>, RpcValueType> | undefined)[];
11
+ readList(): (string | number | boolean | Double | Decimal | ArrayBuffer | DateTime | UInt<number> | import("./rpcvalue.js").List | {
12
+ [key: string]: RpcValue;
13
+ [shvMapType]: "map";
14
+ } | {
15
+ [key: string]: RpcValue;
16
+ [key: number]: RpcValue;
17
+ [shvMapType]: "imap";
18
+ } | RpcValueWithMetaData<MetaMap<Record<string | number, RpcValue>>, RpcValueType> | undefined)[];
12
19
  readMetaMap(): MetaMap;
13
20
  readMap(): ShvMap;
14
21
  readIMap(): IMap;
package/dist/cpon.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { type RpcValue, type RpcValueType, type DateTime, type List, Decimal, Double, type IMap, type Int, type MetaMap, RpcValueWithMetaData, type ShvMap, UInt } from './rpcvalue.js';
1
+ import { type RpcValue, type RpcValueType, type DateTime, type List, Decimal, Double, type IMap, type Int, type MetaMap, RpcValueWithMetaData, type ShvMap, UInt, shvMapType } from './rpcvalue.js';
2
2
  import { PackContext, UnpackContext } from './cpcontext.js';
3
3
  export declare const stringifyDate: (dt: DateTime) => string;
4
4
  declare const utf8ToString: (bytearray: ArrayBuffer) => string;
@@ -13,7 +13,14 @@ declare class CponReader {
13
13
  readCString(): string;
14
14
  readBlobEsc(): ArrayBuffer;
15
15
  readBlobHex(): ArrayBuffer;
16
- readList(): (string | number | boolean | Double | Decimal | ArrayBuffer | DateTime | UInt<number> | List | ShvMap<Record<string, any>> | IMap<Record<number, any>> | RpcValueWithMetaData<MetaMap<Record<string | number, RpcValue>>, RpcValueType> | undefined)[];
16
+ readList(): (string | number | boolean | Double | Decimal | ArrayBuffer | DateTime | UInt<number> | List | {
17
+ [key: string]: RpcValue;
18
+ [shvMapType]: "map";
19
+ } | {
20
+ [key: string]: RpcValue;
21
+ [key: number]: RpcValue;
22
+ [shvMapType]: "imap";
23
+ } | RpcValueWithMetaData<MetaMap<Record<string | number, RpcValue>>, RpcValueType> | undefined)[];
17
24
  readMetaMap(): MetaMap;
18
25
  readMap(): ShvMap;
19
26
  readIMap(): IMap;
@@ -23,18 +23,20 @@ export type DateTime = Date & {
23
23
  declare const withOffset: (date: Date, utcOffset?: number) => DateTime;
24
24
  export type List = RpcValue[];
25
25
  declare const shvMapType: unique symbol;
26
- type IMap<T extends Record<number, RpcValue> = Record<number, any>> = {
27
- [Key in keyof T]: T[Key];
28
- } & {
26
+ type IMap<T extends Record<number, RpcValue> = Record<number, RpcValue>> = T & {
29
27
  [shvMapType]: 'imap';
30
28
  };
31
- type ShvMap<T extends Record<string, RpcValue> = Record<string, any>> = {
32
- [Key in keyof T]: T[Key];
33
- } & {
29
+ type ShvMap<T extends Record<string, RpcValue> = Record<string, RpcValue>> = T & {
34
30
  [shvMapType]: 'map';
35
31
  };
36
32
  export type Int = number;
37
- export type RpcValueType = Null | Bool | Int | UInt | Double | Decimal | Blob | ShvString | DateTime | List | ShvMap | IMap;
33
+ export type RpcValueType = Null | Bool | Int | UInt | Double | Decimal | Blob | ShvString | DateTime | List | {
34
+ [key: string]: RpcValue;
35
+ [shvMapType]: 'map';
36
+ } | {
37
+ [key: string | number]: RpcValue;
38
+ [shvMapType]: 'imap';
39
+ };
38
40
  type MetaMap<T extends Record<string | number, RpcValue> = Record<string | number, RpcValue>> = {
39
41
  [Key in keyof T]: T[Key];
40
42
  } & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libshv-js",
3
- "version": "9.0.1",
3
+ "version": "10.0.0",
4
4
  "description": "Typescript implementation of libshv",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",