@polkadot/types-create 6.12.2-21 → 6.12.2-25
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/bundle.d.ts +4 -0
- package/create/class.d.ts +5 -0
- package/create/index.d.ts +2 -0
- package/create/type.d.ts +3 -0
- package/detectPackage.d.ts +1 -0
- package/index.d.ts +2 -0
- package/package.json +16 -3
- package/packageInfo.cjs +1 -1
- package/packageInfo.d.ts +4 -0
- package/packageInfo.js +1 -1
- package/types.d.ts +57 -0
- package/util/encodeTypes.d.ts +5 -0
- package/util/getTypeDef.d.ts +7 -0
- package/util/index.d.ts +4 -0
- package/util/typeSplit.d.ts +1 -0
- package/util/xcm.d.ts +2 -0
package/bundle.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Codec, CodecClass, CodecRegistry } from '@polkadot/types-codec/types';
|
|
2
|
+
import type { TypeDef } from '../types';
|
|
3
|
+
export declare function constructTypeClass<T extends Codec = Codec>(registry: CodecRegistry, typeDef: TypeDef): CodecClass<T>;
|
|
4
|
+
export declare function getTypeClass<T extends Codec = Codec>(registry: CodecRegistry, typeDef: TypeDef): CodecClass<T>;
|
|
5
|
+
export declare function createClassUnsafe<T extends Codec = Codec, K extends string = string>(registry: CodecRegistry, type: K): CodecClass<T>;
|
package/create/type.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { Codec, CodecRegistry } from '@polkadot/types-codec/types';
|
|
2
|
+
import type { CreateOptions } from '../types';
|
|
3
|
+
export declare function createTypeUnsafe<T extends Codec = Codec, K extends string = string>(registry: CodecRegistry, type: K, params?: unknown[], options?: CreateOptions): T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/index.d.ts
ADDED
package/package.json
CHANGED
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"./detectPackage.cjs"
|
|
21
21
|
],
|
|
22
22
|
"type": "module",
|
|
23
|
-
"version": "6.12.2-
|
|
23
|
+
"version": "6.12.2-25",
|
|
24
24
|
"main": "index.js",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/runtime": "^7.16.5",
|
|
27
|
-
"@polkadot/types-codec": "6.12.2-
|
|
27
|
+
"@polkadot/types-codec": "6.12.2-25",
|
|
28
28
|
"@polkadot/util": "^8.2.2"
|
|
29
29
|
},
|
|
30
30
|
"exports": {
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"require": "./bundle.cjs",
|
|
37
37
|
"default": "./bundle.js"
|
|
38
38
|
},
|
|
39
|
+
"./bundle.d.ts": "./bundle.d.ts",
|
|
39
40
|
"./create": {
|
|
40
41
|
"require": "./create/index.cjs",
|
|
41
42
|
"default": "./create/index.js"
|
|
@@ -44,23 +45,30 @@
|
|
|
44
45
|
"require": "./create/class.cjs",
|
|
45
46
|
"default": "./create/class.js"
|
|
46
47
|
},
|
|
48
|
+
"./create/class.d.ts": "./create/class.d.ts",
|
|
49
|
+
"./create/index.d.ts": "./create/index.d.ts",
|
|
47
50
|
"./create/type": {
|
|
48
51
|
"require": "./create/type.cjs",
|
|
49
52
|
"default": "./create/type.js"
|
|
50
53
|
},
|
|
54
|
+
"./create/type.d.ts": "./create/type.d.ts",
|
|
51
55
|
"./detectPackage": {
|
|
52
56
|
"require": "./detectPackage.cjs",
|
|
53
57
|
"default": "./detectPackage.js"
|
|
54
58
|
},
|
|
59
|
+
"./detectPackage.d.ts": "./detectPackage.d.ts",
|
|
60
|
+
"./index.d.ts": "./index.d.ts",
|
|
55
61
|
"./package.json": "./package.json",
|
|
56
62
|
"./packageInfo": {
|
|
57
63
|
"require": "./packageInfo.cjs",
|
|
58
64
|
"default": "./packageInfo.js"
|
|
59
65
|
},
|
|
66
|
+
"./packageInfo.d.ts": "./packageInfo.d.ts",
|
|
60
67
|
"./types": {
|
|
61
68
|
"require": "./types.cjs",
|
|
62
69
|
"default": "./types.js"
|
|
63
70
|
},
|
|
71
|
+
"./types.d.ts": "./types.d.ts",
|
|
64
72
|
"./util": {
|
|
65
73
|
"require": "./util/index.cjs",
|
|
66
74
|
"default": "./util/index.js"
|
|
@@ -69,17 +77,22 @@
|
|
|
69
77
|
"require": "./util/encodeTypes.cjs",
|
|
70
78
|
"default": "./util/encodeTypes.js"
|
|
71
79
|
},
|
|
80
|
+
"./util/encodeTypes.d.ts": "./util/encodeTypes.d.ts",
|
|
72
81
|
"./util/getTypeDef": {
|
|
73
82
|
"require": "./util/getTypeDef.cjs",
|
|
74
83
|
"default": "./util/getTypeDef.js"
|
|
75
84
|
},
|
|
85
|
+
"./util/getTypeDef.d.ts": "./util/getTypeDef.d.ts",
|
|
86
|
+
"./util/index.d.ts": "./util/index.d.ts",
|
|
76
87
|
"./util/typeSplit": {
|
|
77
88
|
"require": "./util/typeSplit.cjs",
|
|
78
89
|
"default": "./util/typeSplit.js"
|
|
79
90
|
},
|
|
91
|
+
"./util/typeSplit.d.ts": "./util/typeSplit.d.ts",
|
|
80
92
|
"./util/xcm": {
|
|
81
93
|
"require": "./util/xcm.cjs",
|
|
82
94
|
"default": "./util/xcm.js"
|
|
83
|
-
}
|
|
95
|
+
},
|
|
96
|
+
"./util/xcm.d.ts": "./util/xcm.d.ts"
|
|
84
97
|
}
|
|
85
98
|
}
|
package/packageInfo.cjs
CHANGED
package/packageInfo.d.ts
ADDED
package/packageInfo.js
CHANGED
package/types.d.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { Codec, CodecClass, CodecRegistry, ICompact, INumber } from '@polkadot/types-codec/types';
|
|
2
|
+
export type { CodecCreateOptions as CreateOptions } from '@polkadot/types-codec/types';
|
|
3
|
+
export declare enum TypeDefInfo {
|
|
4
|
+
BTreeMap = 0,
|
|
5
|
+
BTreeSet = 1,
|
|
6
|
+
Compact = 2,
|
|
7
|
+
DoNotConstruct = 3,
|
|
8
|
+
Enum = 4,
|
|
9
|
+
HashMap = 5,
|
|
10
|
+
Int = 6,
|
|
11
|
+
Linkage = 7,
|
|
12
|
+
Null = 8,
|
|
13
|
+
Option = 9,
|
|
14
|
+
Plain = 10,
|
|
15
|
+
Range = 11,
|
|
16
|
+
Result = 12,
|
|
17
|
+
Set = 13,
|
|
18
|
+
Si = 14,
|
|
19
|
+
Struct = 15,
|
|
20
|
+
Tuple = 16,
|
|
21
|
+
UInt = 17,
|
|
22
|
+
Vec = 18,
|
|
23
|
+
VecFixed = 19,
|
|
24
|
+
WrapperOpaque = 20
|
|
25
|
+
}
|
|
26
|
+
export interface TypeDef {
|
|
27
|
+
alias?: Map<string, string>;
|
|
28
|
+
displayName?: string;
|
|
29
|
+
docs?: string[];
|
|
30
|
+
fallbackType?: string;
|
|
31
|
+
info: TypeDefInfo;
|
|
32
|
+
index?: number;
|
|
33
|
+
isFromSi?: boolean;
|
|
34
|
+
length?: number;
|
|
35
|
+
lookupIndex?: number;
|
|
36
|
+
lookupName?: string;
|
|
37
|
+
lookupNameRoot?: string;
|
|
38
|
+
name?: string;
|
|
39
|
+
namespace?: string;
|
|
40
|
+
sub?: TypeDef | TypeDef[];
|
|
41
|
+
type: string;
|
|
42
|
+
typeName?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface ILookup {
|
|
45
|
+
getSiType(lookupId: ICompact<INumber> | string | number): {
|
|
46
|
+
def: {
|
|
47
|
+
asTuple: ICompact<INumber>[];
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
getTypeDef(lookupId: ICompact<INumber> | string | number): TypeDef;
|
|
51
|
+
}
|
|
52
|
+
export interface CreateRegistry extends CodecRegistry {
|
|
53
|
+
lookup: ILookup;
|
|
54
|
+
createLookupType(lookupId: ICompact<INumber> | number): string;
|
|
55
|
+
setLookup(lookup: ILookup): void;
|
|
56
|
+
getUnsafe<T extends Codec = Codec, K extends string = string>(name: K, withUnknown?: boolean, knownTypeDef?: TypeDef): CodecClass<T> | undefined;
|
|
57
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CodecRegistry } from '@polkadot/types-codec/types';
|
|
2
|
+
import type { TypeDef } from '@polkadot/types-create/types';
|
|
3
|
+
export declare function paramsNotation<T>(outer: string, inner?: T | T[], transform?: (_: T) => string): string;
|
|
4
|
+
export declare function encodeTypeDef(CodecRegistry: CodecRegistry, typeDef: TypeDef): string;
|
|
5
|
+
export declare function withTypeString(CodecRegistry: CodecRegistry, typeDef: Omit<TypeDef, 'type'>): TypeDef;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TypeDef } from '@polkadot/types-create/types';
|
|
2
|
+
interface TypeDefOptions {
|
|
3
|
+
name?: string;
|
|
4
|
+
displayName?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function getTypeDef(_type: String | string, { displayName, name }?: TypeDefOptions, count?: number): TypeDef;
|
|
7
|
+
export {};
|
package/util/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function typeSplit(type: string): string[];
|
package/util/xcm.d.ts
ADDED