@pezkuwi/typegen 16.5.18 → 16.5.31
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/{build-tsc-cjs → cjs}/generate/lookup.js +39 -10
- package/{build/cjs → cjs}/packageInfo.js +1 -1
- package/{build-tsc-cjs → cjs}/util/derived.js +15 -0
- package/{build-tsc-cjs → cjs}/util/formatting.js +5 -0
- package/generate/lookup.js +39 -10
- package/package.json +27 -27
- package/{build-tsc-esm/packageInfo.js → packageInfo.js} +1 -1
- package/{build/util → util}/derived.js +16 -1
- package/{build-tsc-esm/util → util}/formatting.js +5 -0
- package/build/LICENSE +0 -201
- package/build/README.md +0 -3
- package/build/augment.js +0 -2
- package/build/bundle.js +0 -2
- package/build/cjs/augment.d.ts +0 -2
- package/build/cjs/augment.js +0 -4
- package/build/cjs/bundle.d.ts +0 -2
- package/build/cjs/bundle.js +0 -7
- package/build/cjs/extractChain.js +0 -44
- package/build/cjs/fromChain.js +0 -95
- package/build/cjs/fromDefs.js +0 -82
- package/build/cjs/generate/consts.d.ts +0 -5
- package/build/cjs/generate/consts.js +0 -91
- package/build/cjs/generate/errors.d.ts +0 -4
- package/build/cjs/generate/errors.js +0 -59
- package/build/cjs/generate/events.d.ts +0 -5
- package/build/cjs/generate/events.js +0 -139
- package/build/cjs/generate/index.js +0 -23
- package/build/cjs/generate/interfaceRegistry.d.ts +0 -4
- package/build/cjs/generate/interfaceRegistry.js +0 -64
- package/build/cjs/generate/lookup.d.ts +0 -4
- package/build/cjs/generate/lookup.js +0 -240
- package/build/cjs/generate/query.d.ts +0 -5
- package/build/cjs/generate/query.js +0 -140
- package/build/cjs/generate/rpc.d.ts +0 -6
- package/build/cjs/generate/rpc.js +0 -115
- package/build/cjs/generate/runtime.d.ts +0 -7
- package/build/cjs/generate/runtime.js +0 -233
- package/build/cjs/generate/tsDef.d.ts +0 -16
- package/build/cjs/generate/tsDef.js +0 -254
- package/build/cjs/generate/tx.d.ts +0 -5
- package/build/cjs/generate/tx.js +0 -121
- package/build/cjs/generate/types.d.ts +0 -12
- package/build/cjs/generate/types.js +0 -16
- package/build/cjs/index.js +0 -5
- package/build/cjs/interfacesTs.js +0 -28
- package/build/cjs/metadataMd.js +0 -652
- package/build/cjs/util/assert.js +0 -15
- package/build/cjs/util/derived.js +0 -128
- package/build/cjs/util/docs.js +0 -10
- package/build/cjs/util/file.js +0 -33
- package/build/cjs/util/formatting.js +0 -237
- package/build/cjs/util/imports.js +0 -126
- package/build/cjs/util/index.js +0 -39
- package/build/cjs/util/initMeta.js +0 -22
- package/build/cjs/util/register.js +0 -10
- package/build/cjs/util/wsMeta.js +0 -60
- package/build/extractChain.d.ts +0 -1
- package/build/extractChain.js +0 -40
- package/build/fromChain.d.ts +0 -1
- package/build/fromChain.js +0 -91
- package/build/fromDefs.d.ts +0 -1
- package/build/fromDefs.js +0 -78
- package/build/generate/consts.d.ts +0 -5
- package/build/generate/consts.js +0 -87
- package/build/generate/errors.d.ts +0 -4
- package/build/generate/errors.js +0 -55
- package/build/generate/events.d.ts +0 -5
- package/build/generate/events.js +0 -135
- package/build/generate/index.d.ts +0 -10
- package/build/generate/index.js +0 -10
- package/build/generate/interfaceRegistry.d.ts +0 -4
- package/build/generate/interfaceRegistry.js +0 -59
- package/build/generate/lookup.d.ts +0 -4
- package/build/generate/lookup.js +0 -235
- package/build/generate/query.d.ts +0 -5
- package/build/generate/query.js +0 -136
- package/build/generate/rpc.d.ts +0 -6
- package/build/generate/rpc.js +0 -110
- package/build/generate/runtime.d.ts +0 -7
- package/build/generate/runtime.js +0 -228
- package/build/generate/tsDef.d.ts +0 -16
- package/build/generate/tsDef.js +0 -246
- package/build/generate/tx.d.ts +0 -5
- package/build/generate/tx.js +0 -117
- package/build/generate/types.d.ts +0 -12
- package/build/generate/types.js +0 -13
- package/build/index.d.ts +0 -2
- package/build/index.js +0 -2
- package/build/interfacesTs.d.ts +0 -1
- package/build/interfacesTs.js +0 -24
- package/build/metadataMd.d.ts +0 -1
- package/build/metadataMd.js +0 -648
- package/build/package.json +0 -548
- package/build/packageDetect.d.ts +0 -1
- package/build/packageDetect.js +0 -6
- package/build/packageInfo.d.ts +0 -6
- package/build/packageInfo.js +0 -1
- package/build/scripts/pezkuwi-types-chain-info.mjs +0 -7
- package/build/scripts/pezkuwi-types-from-chain.mjs +0 -7
- package/build/scripts/pezkuwi-types-from-defs.mjs +0 -7
- package/build/scripts/pezkuwi-types-internal-interfaces.mjs +0 -7
- package/build/scripts/pezkuwi-types-internal-metadata.mjs +0 -7
- package/build/templates/calls.hbs +0 -30
- package/build/templates/consts.hbs +0 -28
- package/build/templates/docs.hbs +0 -7
- package/build/templates/errors.hbs +0 -28
- package/build/templates/events.hbs +0 -28
- package/build/templates/header.hbs +0 -2
- package/build/templates/interfaceRegistry.hbs +0 -15
- package/build/templates/lookup/defs-named.hbs +0 -12
- package/build/templates/lookup/defs.hbs +0 -15
- package/build/templates/lookup/index.hbs +0 -3
- package/build/templates/lookup/types.hbs +0 -14
- package/build/templates/query.hbs +0 -29
- package/build/templates/rpc.hbs +0 -22
- package/build/templates/tsDef/index.hbs +0 -3
- package/build/templates/tsDef/moduleTypes.hbs +0 -10
- package/build/templates/tsDef/types.hbs +0 -7
- package/build/templates/tx.hbs +0 -30
- package/build/util/assert.d.ts +0 -2
- package/build/util/assert.js +0 -10
- package/build/util/derived.d.ts +0 -4
- package/build/util/docs.d.ts +0 -1
- package/build/util/docs.js +0 -6
- package/build/util/file.d.ts +0 -2
- package/build/util/file.js +0 -28
- package/build/util/formatting.d.ts +0 -11
- package/build/util/formatting.js +0 -230
- package/build/util/imports.d.ts +0 -23
- package/build/util/imports.js +0 -121
- package/build/util/index.d.ts +0 -16
- package/build/util/index.js +0 -34
- package/build/util/initMeta.d.ts +0 -12
- package/build/util/initMeta.js +0 -19
- package/build/util/register.d.ts +0 -4
- package/build/util/register.js +0 -7
- package/build/util/wsMeta.d.ts +0 -4
- package/build/util/wsMeta.js +0 -55
- package/build-tsc-cjs/packageDetect.js +0 -8
- package/build-tsc-cjs/packageInfo.js +0 -4
- package/build-tsc-esm/generate/consts.js +0 -87
- package/build-tsc-esm/generate/errors.js +0 -55
- package/build-tsc-esm/generate/events.js +0 -135
- package/build-tsc-esm/generate/interfaceRegistry.js +0 -59
- package/build-tsc-esm/generate/lookup.js +0 -235
- package/build-tsc-esm/generate/query.js +0 -136
- package/build-tsc-esm/generate/rpc.js +0 -110
- package/build-tsc-esm/generate/runtime.js +0 -228
- package/build-tsc-esm/generate/tsDef.js +0 -246
- package/build-tsc-esm/generate/tx.js +0 -117
- package/build-tsc-esm/generate/types.js +0 -13
- package/build-tsc-esm/util/derived.js +0 -125
- package/src/augment.ts +0 -5
- package/src/bundle.ts +0 -5
- package/src/extractChain.ts +0 -54
- package/src/fromChain.ts +0 -123
- package/src/fromDefs.ts +0 -106
- package/src/generate/consts.ts +0 -112
- package/src/generate/errors.ts +0 -75
- package/src/generate/events.ts +0 -165
- package/src/generate/index.ts +0 -13
- package/src/generate/interfaceRegistry.ts +0 -85
- package/src/generate/lookup.ts +0 -322
- package/src/generate/query.ts +0 -169
- package/src/generate/rpc.ts +0 -158
- package/src/generate/runtime.ts +0 -293
- package/src/generate/tsDef.ts +0 -321
- package/src/generate/tx.ts +0 -152
- package/src/generate/types.ts +0 -26
- package/src/index.ts +0 -6
- package/src/interfacesTs.ts +0 -35
- package/src/metadataMd.ts +0 -844
- package/src/packageDetect.ts +0 -14
- package/src/packageInfo.ts +0 -6
- package/src/templates/calls.hbs +0 -30
- package/src/templates/consts.hbs +0 -28
- package/src/templates/docs.hbs +0 -7
- package/src/templates/errors.hbs +0 -28
- package/src/templates/events.hbs +0 -28
- package/src/templates/header.hbs +0 -2
- package/src/templates/interfaceRegistry.hbs +0 -15
- package/src/templates/lookup/defs-named.hbs +0 -12
- package/src/templates/lookup/defs.hbs +0 -15
- package/src/templates/lookup/index.hbs +0 -3
- package/src/templates/lookup/types.hbs +0 -14
- package/src/templates/query.hbs +0 -29
- package/src/templates/rpc.hbs +0 -22
- package/src/templates/tsDef/index.hbs +0 -3
- package/src/templates/tsDef/moduleTypes.hbs +0 -10
- package/src/templates/tsDef/types.hbs +0 -7
- package/src/templates/tx.hbs +0 -30
- package/src/util/assert.ts +0 -18
- package/src/util/derived.spec.ts +0 -58
- package/src/util/derived.ts +0 -133
- package/src/util/docs.ts +0 -13
- package/src/util/file.ts +0 -42
- package/src/util/formatting.spec.ts +0 -30
- package/src/util/formatting.ts +0 -322
- package/src/util/imports.ts +0 -164
- package/src/util/index.ts +0 -42
- package/src/util/initMeta.ts +0 -37
- package/src/util/register.ts +0 -12
- package/src/util/wsMeta.ts +0 -70
- package/tsconfig.build.json +0 -28
- package/tsconfig.build.tsbuildinfo +0 -1
- package/tsconfig.scripts.json +0 -19
- package/tsconfig.spec.json +0 -17
- package/tsconfig.spec.tsbuildinfo +0 -1
- /package/{build-tsc/augment.d.ts → augment.d.ts} +0 -0
- /package/{build-tsc-esm/augment.js → augment.js} +0 -0
- /package/{build-tsc/bundle.d.ts → bundle.d.ts} +0 -0
- /package/{build-tsc-esm/bundle.js → bundle.js} +0 -0
- /package/{build → cjs}/augment.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/augment.js +0 -0
- /package/{build → cjs}/bundle.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/bundle.js +0 -0
- /package/{build-tsc → cjs}/extractChain.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/extractChain.js +0 -0
- /package/{build-tsc → cjs}/fromChain.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/fromChain.js +0 -0
- /package/{build-tsc → cjs}/fromDefs.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/fromDefs.js +0 -0
- /package/{build-tsc → cjs}/generate/consts.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/generate/consts.js +0 -0
- /package/{build-tsc → cjs}/generate/errors.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/generate/errors.js +0 -0
- /package/{build-tsc → cjs}/generate/events.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/generate/events.js +0 -0
- /package/{build-tsc → cjs}/generate/index.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/generate/index.js +0 -0
- /package/{build-tsc → cjs}/generate/interfaceRegistry.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/generate/interfaceRegistry.js +0 -0
- /package/{build-tsc → cjs}/generate/lookup.d.ts +0 -0
- /package/{build-tsc → cjs}/generate/query.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/generate/query.js +0 -0
- /package/{build-tsc → cjs}/generate/rpc.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/generate/rpc.js +0 -0
- /package/{build-tsc → cjs}/generate/runtime.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/generate/runtime.js +0 -0
- /package/{build-tsc → cjs}/generate/tsDef.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/generate/tsDef.js +0 -0
- /package/{build-tsc → cjs}/generate/tx.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/generate/tx.js +0 -0
- /package/{build-tsc → cjs}/generate/types.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/generate/types.js +0 -0
- /package/{build-tsc → cjs}/index.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/index.js +0 -0
- /package/{build-tsc → cjs}/interfacesTs.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/interfacesTs.js +0 -0
- /package/{build-tsc → cjs}/metadataMd.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/metadataMd.js +0 -0
- /package/{build/cjs → cjs}/package.json +0 -0
- /package/{build-tsc → cjs}/packageDetect.d.ts +0 -0
- /package/{build/cjs → cjs}/packageDetect.js +0 -0
- /package/{build-tsc → cjs}/packageInfo.d.ts +0 -0
- /package/{build-tsc → cjs}/util/assert.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/util/assert.js +0 -0
- /package/{build-tsc → cjs}/util/derived.d.ts +0 -0
- /package/{build-tsc → cjs}/util/docs.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/util/docs.js +0 -0
- /package/{build-tsc → cjs}/util/file.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/util/file.js +0 -0
- /package/{build-tsc → cjs}/util/formatting.d.ts +0 -0
- /package/{build-tsc → cjs}/util/imports.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/util/imports.js +0 -0
- /package/{build-tsc → cjs}/util/index.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/util/index.js +0 -0
- /package/{build-tsc → cjs}/util/initMeta.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/util/initMeta.js +0 -0
- /package/{build-tsc → cjs}/util/register.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/util/register.js +0 -0
- /package/{build-tsc → cjs}/util/wsMeta.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/util/wsMeta.js +0 -0
- /package/{build/cjs/extractChain.d.ts → extractChain.d.ts} +0 -0
- /package/{build-tsc-esm/extractChain.js → extractChain.js} +0 -0
- /package/{build/cjs/fromChain.d.ts → fromChain.d.ts} +0 -0
- /package/{build-tsc-esm/fromChain.js → fromChain.js} +0 -0
- /package/{build/cjs/fromDefs.d.ts → fromDefs.d.ts} +0 -0
- /package/{build-tsc-esm/fromDefs.js → fromDefs.js} +0 -0
- /package/{build/cjs/generate → generate}/index.d.ts +0 -0
- /package/{build-tsc-esm/generate → generate}/index.js +0 -0
- /package/{build/cjs/index.d.ts → index.d.ts} +0 -0
- /package/{build-tsc-esm/index.js → index.js} +0 -0
- /package/{build/cjs/interfacesTs.d.ts → interfacesTs.d.ts} +0 -0
- /package/{build-tsc-esm/interfacesTs.js → interfacesTs.js} +0 -0
- /package/{build/cjs/metadataMd.d.ts → metadataMd.d.ts} +0 -0
- /package/{build-tsc-esm/metadataMd.js → metadataMd.js} +0 -0
- /package/{build/cjs/packageDetect.d.ts → packageDetect.d.ts} +0 -0
- /package/{build-tsc-esm/packageDetect.js → packageDetect.js} +0 -0
- /package/{build/cjs/packageInfo.d.ts → packageInfo.d.ts} +0 -0
- /package/{build/cjs/util → util}/assert.d.ts +0 -0
- /package/{build-tsc-esm/util → util}/assert.js +0 -0
- /package/{build/cjs/util → util}/derived.d.ts +0 -0
- /package/{build/cjs/util → util}/docs.d.ts +0 -0
- /package/{build-tsc-esm/util → util}/docs.js +0 -0
- /package/{build/cjs/util → util}/file.d.ts +0 -0
- /package/{build-tsc-esm/util → util}/file.js +0 -0
- /package/{build/cjs/util → util}/formatting.d.ts +0 -0
- /package/{build/cjs/util → util}/imports.d.ts +0 -0
- /package/{build-tsc-esm/util → util}/imports.js +0 -0
- /package/{build/cjs/util → util}/index.d.ts +0 -0
- /package/{build-tsc-esm/util → util}/index.js +0 -0
- /package/{build/cjs/util → util}/initMeta.d.ts +0 -0
- /package/{build-tsc-esm/util → util}/initMeta.js +0 -0
- /package/{build/cjs/util → util}/register.d.ts +0 -0
- /package/{build-tsc-esm/util → util}/register.js +0 -0
- /package/{build/cjs/util → util}/wsMeta.d.ts +0 -0
- /package/{build-tsc-esm/util → util}/wsMeta.js +0 -0
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
{{> header }}
|
|
2
|
-
|
|
3
|
-
// import type lookup before we augment - in some environments
|
|
4
|
-
// this is required to allow for ambient/previous definitions
|
|
5
|
-
import '@pezkuwi/api-base/types/errors';
|
|
6
|
-
|
|
7
|
-
{{{ importsAll }}}
|
|
8
|
-
|
|
9
|
-
export type __AugmentedError<ApiType extends ApiTypes> = AugmentedError<ApiType>;
|
|
10
|
-
|
|
11
|
-
declare module '@pezkuwi/api-base/types/errors' {
|
|
12
|
-
interface AugmentedErrors<ApiType extends ApiTypes> {
|
|
13
|
-
{{#each modules}}
|
|
14
|
-
{{{name}}}: {
|
|
15
|
-
{{#each items}}
|
|
16
|
-
{{> docs}}
|
|
17
|
-
{{{name}}}: AugmentedError<ApiType>;
|
|
18
|
-
{{/each}}
|
|
19
|
-
{{#unless @root.isStrict}}
|
|
20
|
-
/**
|
|
21
|
-
* Generic error
|
|
22
|
-
**/
|
|
23
|
-
[key: string]: AugmentedError<ApiType>;
|
|
24
|
-
{{/unless}}
|
|
25
|
-
};
|
|
26
|
-
{{/each}}
|
|
27
|
-
} // AugmentedErrors
|
|
28
|
-
} // declare module
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
{{> header }}
|
|
2
|
-
|
|
3
|
-
// import type lookup before we augment - in some environments
|
|
4
|
-
// this is required to allow for ambient/previous definitions
|
|
5
|
-
import '@pezkuwi/api-base/types/events';
|
|
6
|
-
|
|
7
|
-
{{{ importsAll }}}
|
|
8
|
-
|
|
9
|
-
export type __AugmentedEvent<ApiType extends ApiTypes> = AugmentedEvent<ApiType>;
|
|
10
|
-
|
|
11
|
-
declare module '@pezkuwi/api-base/types/events' {
|
|
12
|
-
interface AugmentedEvents<ApiType extends ApiTypes> {
|
|
13
|
-
{{#each modules}}
|
|
14
|
-
{{{name}}}: {
|
|
15
|
-
{{#each items}}
|
|
16
|
-
{{> docs}}
|
|
17
|
-
{{{name}}}: AugmentedEvent<ApiType, {{{type}}}>;
|
|
18
|
-
{{/each}}
|
|
19
|
-
{{#unless @root.isStrict}}
|
|
20
|
-
/**
|
|
21
|
-
* Generic event
|
|
22
|
-
**/
|
|
23
|
-
[key: string]: AugmentedEvent<ApiType>;
|
|
24
|
-
{{/unless}}
|
|
25
|
-
};
|
|
26
|
-
{{/each}}
|
|
27
|
-
} // AugmentedEvents
|
|
28
|
-
} // declare module
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{{> header }}
|
|
2
|
-
|
|
3
|
-
// import type lookup before we augment - in some environments
|
|
4
|
-
// this is required to allow for ambient/previous definitions
|
|
5
|
-
import '@pezkuwi/types/types/registry';
|
|
6
|
-
|
|
7
|
-
{{{ importsAll }}}
|
|
8
|
-
|
|
9
|
-
declare module '@pezkuwi/types/types/registry' {
|
|
10
|
-
interface InterfaceTypes {
|
|
11
|
-
{{#each items}}
|
|
12
|
-
{{{this}}}: {{{this}}};
|
|
13
|
-
{{/each}}
|
|
14
|
-
} // InterfaceTypes
|
|
15
|
-
} // declare module
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{{> header }}
|
|
2
|
-
|
|
3
|
-
// import type lookup before we augment - in some environments
|
|
4
|
-
// this is required to allow for ambient/previous definitions
|
|
5
|
-
import '@pezkuwi/types/lookup';
|
|
6
|
-
|
|
7
|
-
{{{ importsAll }}}
|
|
8
|
-
|
|
9
|
-
declare module '@pezkuwi/types/lookup' {
|
|
10
|
-
{{#each items}}
|
|
11
|
-
{{{this}}}
|
|
12
|
-
|
|
13
|
-
{{/each}}
|
|
14
|
-
} // declare module
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{{> header }}
|
|
2
|
-
|
|
3
|
-
// import type lookup before we augment - in some environments
|
|
4
|
-
// this is required to allow for ambient/previous definitions
|
|
5
|
-
import '@pezkuwi/api-base/types/storage';
|
|
6
|
-
|
|
7
|
-
{{{ importsAll }}}
|
|
8
|
-
|
|
9
|
-
export type __AugmentedQuery<ApiType extends ApiTypes> = AugmentedQuery<ApiType, () => unknown>;
|
|
10
|
-
export type __QueryableStorageEntry<ApiType extends ApiTypes> = QueryableStorageEntry<ApiType>;
|
|
11
|
-
|
|
12
|
-
declare module '@pezkuwi/api-base/types/storage' {
|
|
13
|
-
interface AugmentedQueries<ApiType extends ApiTypes> {
|
|
14
|
-
{{#each modules}}
|
|
15
|
-
{{{name}}}: {
|
|
16
|
-
{{#each items}}
|
|
17
|
-
{{> docs}}
|
|
18
|
-
{{{name}}}: {{{entryType}}}<ApiType, ({{{params}}}) => Observable<{{{returnType}}}>, [{{{args}}}]>{{#unless @root.isStrict}} & QueryableStorageEntry<ApiType, [{{{args}}}]>{{/unless}};
|
|
19
|
-
{{/each}}
|
|
20
|
-
{{#unless @root.isStrict}}
|
|
21
|
-
/**
|
|
22
|
-
* Generic query
|
|
23
|
-
**/
|
|
24
|
-
[key: string]: QueryableStorageEntry<ApiType>;
|
|
25
|
-
{{/unless}}
|
|
26
|
-
};
|
|
27
|
-
{{/each}}
|
|
28
|
-
} // AugmentedQueries
|
|
29
|
-
} // declare module
|
package/build/templates/rpc.hbs
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{{> header }}
|
|
2
|
-
|
|
3
|
-
// import type lookup before we augment - in some environments
|
|
4
|
-
// this is required to allow for ambient/previous definitions
|
|
5
|
-
import '@pezkuwi/rpc-core/types/jsonrpc';
|
|
6
|
-
|
|
7
|
-
{{{ importsAll }}}
|
|
8
|
-
|
|
9
|
-
export type __AugmentedRpc = AugmentedRpc<() => unknown>;
|
|
10
|
-
|
|
11
|
-
declare module '@pezkuwi/rpc-core/types/jsonrpc' {
|
|
12
|
-
interface RpcInterface {
|
|
13
|
-
{{#each modules}}
|
|
14
|
-
{{{name}}}: {
|
|
15
|
-
{{#each items}}
|
|
16
|
-
{{> docs}}
|
|
17
|
-
{{{name}}}: AugmentedRpc<{{#if generic}}<{{{generic}}}>{{/if}}({{{args}}}) => Observable<{{{type}}}>>;
|
|
18
|
-
{{/each}}
|
|
19
|
-
};
|
|
20
|
-
{{/each}}
|
|
21
|
-
} // RpcInterface
|
|
22
|
-
} // declare module
|
package/build/templates/tx.hbs
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{{> header }}
|
|
2
|
-
|
|
3
|
-
// import type lookup before we augment - in some environments
|
|
4
|
-
// this is required to allow for ambient/previous definitions
|
|
5
|
-
import '@pezkuwi/api-base/types/submittable';
|
|
6
|
-
|
|
7
|
-
{{{ importsAll }}}
|
|
8
|
-
|
|
9
|
-
export type __AugmentedSubmittable = AugmentedSubmittable<() => unknown>;
|
|
10
|
-
export type __SubmittableExtrinsic<ApiType extends ApiTypes> = SubmittableExtrinsic<ApiType>;
|
|
11
|
-
export type __SubmittableExtrinsicFunction<ApiType extends ApiTypes> = SubmittableExtrinsicFunction<ApiType>;
|
|
12
|
-
|
|
13
|
-
declare module '@pezkuwi/api-base/types/submittable' {
|
|
14
|
-
interface AugmentedSubmittables<ApiType extends ApiTypes> {
|
|
15
|
-
{{#each modules}}
|
|
16
|
-
{{{name}}}: {
|
|
17
|
-
{{#each items}}
|
|
18
|
-
{{> docs}}
|
|
19
|
-
{{{name}}}: AugmentedSubmittable<({{{params}}}) => SubmittableExtrinsic<ApiType>, [{{{args}}}]>;
|
|
20
|
-
{{/each}}
|
|
21
|
-
{{#unless @root.isStrict}}
|
|
22
|
-
/**
|
|
23
|
-
* Generic tx
|
|
24
|
-
**/
|
|
25
|
-
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
|
26
|
-
{{/unless}}
|
|
27
|
-
};
|
|
28
|
-
{{/each}}
|
|
29
|
-
} // AugmentedSubmittables
|
|
30
|
-
} // declare module
|
package/build/util/assert.d.ts
DELETED
package/build/util/assert.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs';
|
|
2
|
-
import { assert } from '@pezkuwi/util';
|
|
3
|
-
export function assertDir(path) {
|
|
4
|
-
assert(fs.existsSync(path) && fs.lstatSync(path).isDirectory(), `${path} is not a directory`);
|
|
5
|
-
return path;
|
|
6
|
-
}
|
|
7
|
-
export function assertFile(path) {
|
|
8
|
-
assert(fs.existsSync(path) && fs.lstatSync(path).isFile(), `${path} is not a file`);
|
|
9
|
-
return path;
|
|
10
|
-
}
|
package/build/util/derived.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Registry } from '@pezkuwi/types/types';
|
|
2
|
-
import type { ModuleTypes, TypeImports } from './imports.js';
|
|
3
|
-
/** @internal */
|
|
4
|
-
export declare function getSimilarTypes(registry: Registry, definitions: Record<string, ModuleTypes>, _type: string, imports: TypeImports): string[];
|
package/build/util/docs.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const __TYPEGEN_DUMMY_DOCS = "DUMMY_DOCS";
|
package/build/util/docs.js
DELETED
package/build/util/file.d.ts
DELETED
package/build/util/file.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import process from 'node:process';
|
|
4
|
-
import { packageInfo } from '../packageInfo.js';
|
|
5
|
-
export function writeFile(dest, generator, noLog) {
|
|
6
|
-
!noLog && console.log(`${dest}\n\tGenerating`);
|
|
7
|
-
let generated = generator();
|
|
8
|
-
while (generated.includes('\n\n\n')) {
|
|
9
|
-
generated = generated.replace(/\n\n\n/g, '\n\n');
|
|
10
|
-
}
|
|
11
|
-
!noLog && console.log('\tWriting');
|
|
12
|
-
fs.writeFileSync(dest, generated, { flag: 'w' });
|
|
13
|
-
!noLog && console.log('');
|
|
14
|
-
}
|
|
15
|
-
export function readTemplate(template) {
|
|
16
|
-
// Inside the api repo itself, it will be 'auto'
|
|
17
|
-
const rootDir = packageInfo.path === 'auto'
|
|
18
|
-
? path.join(process.cwd(), 'packages/typegen/src')
|
|
19
|
-
: packageInfo.path;
|
|
20
|
-
// NOTE With cjs in a subdir, search one lower as well
|
|
21
|
-
const file = ['./templates', '../templates']
|
|
22
|
-
.map((p) => path.join(rootDir, p, `${template}.hbs`))
|
|
23
|
-
.find((p) => fs.existsSync(p));
|
|
24
|
-
if (!file) {
|
|
25
|
-
throw new Error(`Unable to locate ${template}.hbs from ${rootDir}`);
|
|
26
|
-
}
|
|
27
|
-
return fs.readFileSync(file).toString();
|
|
28
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { AnyString, Registry } from '@pezkuwi/types/types';
|
|
2
|
-
import type { TypeDef } from '@pezkuwi/types-create/types';
|
|
3
|
-
import type { ModuleTypes, TypeImports } from './imports.js';
|
|
4
|
-
export declare const HEADER: (type: "chain" | "defs") => string;
|
|
5
|
-
/** @internal */
|
|
6
|
-
export declare function exportInterface(lookupIndex: number | undefined, name: string | undefined, base: string, body?: string, withShortcut?: boolean): string;
|
|
7
|
-
/**
|
|
8
|
-
* Correctly format a given type
|
|
9
|
-
*/
|
|
10
|
-
/** @internal */
|
|
11
|
-
export declare function formatType(registry: Registry, definitions: Record<string, ModuleTypes>, type: AnyString | TypeDef, imports: TypeImports, withShortcut?: boolean): string;
|
package/build/util/formatting.js
DELETED
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
import Handlebars from 'handlebars';
|
|
2
|
-
import * as typesCodec from '@pezkuwi/types-codec';
|
|
3
|
-
import { getTypeDef, paramsNotation, TypeDefInfo } from '@pezkuwi/types-create';
|
|
4
|
-
import { isString, stringify } from '@pezkuwi/util';
|
|
5
|
-
import { readTemplate } from './file.js';
|
|
6
|
-
import { setImports } from './imports.js';
|
|
7
|
-
function rebrandTypeName(typeName) {
|
|
8
|
-
return typeName
|
|
9
|
-
// Main projects
|
|
10
|
-
.replace(/Polkadot/g, 'Pezkuwi')
|
|
11
|
-
.replace(/Substrate/g, 'Bizinikiwi')
|
|
12
|
-
.replace(/Cumulus/g, 'Pezcumulus')
|
|
13
|
-
// Networks
|
|
14
|
-
.replace(/Kusama/g, 'Dicle')
|
|
15
|
-
.replace(/Westend/g, 'Zagros')
|
|
16
|
-
.replace(/Rococo/g, 'Pezkuwichain')
|
|
17
|
-
// Chain types
|
|
18
|
-
.replace(/Parachain/g, 'Teyrchain')
|
|
19
|
-
// Module prefixes (in PascalCase type names)
|
|
20
|
-
.replace(/Frame(?=[A-Z])/g, 'Pezframe')
|
|
21
|
-
.replace(/Pallet(?=[A-Z])/g, 'Pezpallet')
|
|
22
|
-
// Primitives prefixes (sp_ becomes Sp in type names)
|
|
23
|
-
.replace(/^Sp(?=[A-Z])/g, 'Pezsp')
|
|
24
|
-
.replace(/([^a-zA-Z])Sp(?=[A-Z])/g, '$1Pezsp')
|
|
25
|
-
// Client prefixes (sc_ becomes Sc in type names)
|
|
26
|
-
.replace(/^Sc(?=[A-Z])/g, 'Pezsc')
|
|
27
|
-
.replace(/([^a-zA-Z])Sc(?=[A-Z])/g, '$1Pezsc');
|
|
28
|
-
}
|
|
29
|
-
const NO_CODEC = ['Tuple', 'VecFixed'];
|
|
30
|
-
const ON_CODEC = Object.keys(typesCodec);
|
|
31
|
-
const ON_CODEC_TYPES = ['Codec', 'AnyJson', 'AnyFunction', 'AnyNumber', 'AnyString', 'AnyTuple', 'AnyU8a', 'ICompact', 'IEnum', 'IMap', 'INumber', 'IOption', 'IResult', 'ISet', 'IStruct', 'ITuple', 'IU8a', 'IVec', 'IMethod'];
|
|
32
|
-
export const HEADER = (type) => `// Auto-generated via \`yarn pezkuwi-types-from-${type}\`, do not edit\n/* eslint-disable */\n\n`;
|
|
33
|
-
function extractImports({ imports, types }) {
|
|
34
|
-
const toplevel = [
|
|
35
|
-
...Object.keys(imports.codecTypes),
|
|
36
|
-
...Object.keys(imports.extrinsicTypes),
|
|
37
|
-
...Object.keys(imports.genericTypes),
|
|
38
|
-
...Object.keys(imports.metadataTypes),
|
|
39
|
-
...Object.keys(imports.primitiveTypes)
|
|
40
|
-
];
|
|
41
|
-
return [
|
|
42
|
-
{
|
|
43
|
-
file: '@pezkuwi/types',
|
|
44
|
-
types: toplevel.filter((n) => !NO_CODEC.includes(n) && !ON_CODEC.includes(n))
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
file: '@pezkuwi/types/lookup',
|
|
48
|
-
types: Object.keys(imports.lookupTypes)
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
file: '@pezkuwi/types/types',
|
|
52
|
-
types: Object.keys(imports.typesTypes).filter((n) => !ON_CODEC_TYPES.includes(n))
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
file: '@pezkuwi/types-codec',
|
|
56
|
-
types: toplevel.filter((n) => !NO_CODEC.includes(n) && ON_CODEC.includes(n))
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
file: '@pezkuwi/types-codec/types',
|
|
60
|
-
types: Object.keys(imports.typesTypes).filter((n) => ON_CODEC_TYPES.includes(n))
|
|
61
|
-
},
|
|
62
|
-
...types
|
|
63
|
-
]
|
|
64
|
-
.filter(({ types }) => types.length)
|
|
65
|
-
.sort(({ file }, b) => file.localeCompare(b.file))
|
|
66
|
-
.map(({ file, types }) => `import type { ${types.sort().join(', ')} } from '${file}';`);
|
|
67
|
-
}
|
|
68
|
-
Handlebars.registerPartial({
|
|
69
|
-
header: Handlebars.compile(readTemplate('header'))
|
|
70
|
-
});
|
|
71
|
-
Handlebars.registerHelper({
|
|
72
|
-
importsAll() {
|
|
73
|
-
return extractImports(this)
|
|
74
|
-
.join('\n');
|
|
75
|
-
},
|
|
76
|
-
importsPackage() {
|
|
77
|
-
return extractImports(this)
|
|
78
|
-
.filter((l) => !l.includes("from '."))
|
|
79
|
-
.join('\n ');
|
|
80
|
-
},
|
|
81
|
-
importsRelative() {
|
|
82
|
-
return extractImports(this)
|
|
83
|
-
.filter((l) => l.includes("from '."))
|
|
84
|
-
.join('\n');
|
|
85
|
-
},
|
|
86
|
-
trim(options) {
|
|
87
|
-
return options.fn(this).trim();
|
|
88
|
-
},
|
|
89
|
-
upper(options) {
|
|
90
|
-
return options.fn(this).toUpperCase();
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
/** @internal */
|
|
94
|
-
export function exportInterface(lookupIndex = -1, name = '', base, body = '', withShortcut = false) {
|
|
95
|
-
// * @description extends [[${base}]]
|
|
96
|
-
const doc = withShortcut
|
|
97
|
-
? ''
|
|
98
|
-
: `/** @name ${name}${lookupIndex !== -1 ? ` (${lookupIndex})` : ''} */\n`;
|
|
99
|
-
return `${doc}${withShortcut ? '' : `export interface ${name} extends ${base} `}{${body.length ? '\n' : ''}${body}${withShortcut ? ' ' : ''}}`;
|
|
100
|
-
}
|
|
101
|
-
function singleParamNotation(registry, wrapper, typeDef, definitions, imports, withShortcut) {
|
|
102
|
-
const sub = typeDef.sub;
|
|
103
|
-
const lookupName = rebrandTypeName(sub.lookupName || '');
|
|
104
|
-
setImports(definitions, imports, [wrapper, lookupName]);
|
|
105
|
-
return paramsNotation(wrapper, lookupName || formatType(registry, definitions, sub.type, imports, withShortcut));
|
|
106
|
-
}
|
|
107
|
-
function dualParamsNotation(registry, wrapper, typeDef, definitions, imports, withShortcut) {
|
|
108
|
-
const [a, b] = typeDef.sub;
|
|
109
|
-
const aLookupName = rebrandTypeName(a.lookupName || '');
|
|
110
|
-
const bLookupName = rebrandTypeName(b.lookupName || '');
|
|
111
|
-
setImports(definitions, imports, [wrapper, aLookupName, bLookupName]);
|
|
112
|
-
return paramsNotation(wrapper, [
|
|
113
|
-
aLookupName || formatType(registry, definitions, a.type, imports, withShortcut),
|
|
114
|
-
bLookupName || formatType(registry, definitions, b.type, imports, withShortcut)
|
|
115
|
-
]);
|
|
116
|
-
}
|
|
117
|
-
const formatters = {
|
|
118
|
-
[TypeDefInfo.Compact]: (registry, typeDef, definitions, imports, withShortcut) => {
|
|
119
|
-
return singleParamNotation(registry, 'Compact', typeDef, definitions, imports, withShortcut);
|
|
120
|
-
},
|
|
121
|
-
[TypeDefInfo.DoNotConstruct]: (_registry, _typeDef, definitions, imports, _withShortcut) => {
|
|
122
|
-
setImports(definitions, imports, ['DoNotConstruct']);
|
|
123
|
-
return 'DoNotConstruct';
|
|
124
|
-
},
|
|
125
|
-
[TypeDefInfo.Enum]: (_registry, typeDef, _definitions, _imports, _withShortcut) => {
|
|
126
|
-
if (typeDef.lookupName) {
|
|
127
|
-
return rebrandTypeName(typeDef.lookupName);
|
|
128
|
-
}
|
|
129
|
-
throw new Error(`TypeDefInfo.Enum: Parameter formatting not implemented on ${stringify(typeDef)}`);
|
|
130
|
-
},
|
|
131
|
-
[TypeDefInfo.Int]: (_registry, typeDef, _definitions, _imports, _withShortcut) => {
|
|
132
|
-
throw new Error(`TypeDefInfo.Int: Parameter formatting not implemented on ${stringify(typeDef)}`);
|
|
133
|
-
},
|
|
134
|
-
[TypeDefInfo.UInt]: (_registry, typeDef, _definitions, _imports, _withShortcut) => {
|
|
135
|
-
throw new Error(`TypeDefInfo.UInt: Parameter formatting not implemented on ${stringify(typeDef)}`);
|
|
136
|
-
},
|
|
137
|
-
[TypeDefInfo.Null]: (_registry, _typeDef, definitions, imports, _withShortcut) => {
|
|
138
|
-
setImports(definitions, imports, ['Null']);
|
|
139
|
-
return 'Null';
|
|
140
|
-
},
|
|
141
|
-
[TypeDefInfo.Option]: (registry, typeDef, definitions, imports, withShortcut) => {
|
|
142
|
-
return singleParamNotation(registry, 'Option', typeDef, definitions, imports, withShortcut);
|
|
143
|
-
},
|
|
144
|
-
[TypeDefInfo.Plain]: (_registry, typeDef, definitions, imports, _withShortcut) => {
|
|
145
|
-
setImports(definitions, imports, [rebrandTypeName(typeDef.type)]);
|
|
146
|
-
return rebrandTypeName(typeDef.type);
|
|
147
|
-
},
|
|
148
|
-
[TypeDefInfo.Range]: (registry, typeDef, definitions, imports, withShortcut) => {
|
|
149
|
-
return singleParamNotation(registry, 'Range', typeDef, definitions, imports, withShortcut);
|
|
150
|
-
},
|
|
151
|
-
[TypeDefInfo.RangeInclusive]: (registry, typeDef, definitions, imports, withShortcut) => {
|
|
152
|
-
return singleParamNotation(registry, 'RangeInclusive', typeDef, definitions, imports, withShortcut);
|
|
153
|
-
},
|
|
154
|
-
[TypeDefInfo.Set]: (_registry, typeDef, _definitions, _imports, _withShortcut) => {
|
|
155
|
-
throw new Error(`TypeDefInfo.Set: Parameter formatting not implemented on ${stringify(typeDef)}`);
|
|
156
|
-
},
|
|
157
|
-
[TypeDefInfo.Si]: (registry, typeDef, definitions, imports, withShortcut) => {
|
|
158
|
-
return formatType(registry, definitions, registry.lookup.getTypeDef(typeDef.type), imports, withShortcut);
|
|
159
|
-
},
|
|
160
|
-
[TypeDefInfo.Struct]: (registry, typeDef, definitions, imports, withShortcut) => {
|
|
161
|
-
if (typeDef.lookupName) {
|
|
162
|
-
return rebrandTypeName(typeDef.lookupName);
|
|
163
|
-
}
|
|
164
|
-
const sub = typeDef.sub;
|
|
165
|
-
setImports(definitions, imports, ['Struct', ...sub.map(({ lookupName }) => rebrandTypeName(lookupName || ''))]);
|
|
166
|
-
return `{${withShortcut ? ' ' : '\n'}${sub.map(({ lookupName, name, type }, index) => [
|
|
167
|
-
name || `unknown${index}`,
|
|
168
|
-
rebrandTypeName(lookupName || '') || formatType(registry, definitions, type, imports, withShortcut)
|
|
169
|
-
]).map(([k, t]) => `${withShortcut ? '' : ' readonly '}${k}: ${t};`).join(withShortcut ? ' ' : '\n')}${withShortcut ? ' ' : '\n '}} & Struct`;
|
|
170
|
-
},
|
|
171
|
-
[TypeDefInfo.Tuple]: (registry, typeDef, definitions, imports, withShortcut) => {
|
|
172
|
-
const sub = typeDef.sub;
|
|
173
|
-
setImports(definitions, imports, ['ITuple', ...sub.map(({ lookupName }) => rebrandTypeName(lookupName || ''))]);
|
|
174
|
-
// `(a,b)` gets transformed into `ITuple<[a, b]>`
|
|
175
|
-
return paramsNotation('ITuple', `[${sub.map(({ lookupName, type }) => rebrandTypeName(lookupName || '') || formatType(registry, definitions, type, imports, withShortcut)).join(', ')}]`);
|
|
176
|
-
},
|
|
177
|
-
[TypeDefInfo.Vec]: (registry, typeDef, definitions, imports, withShortcut) => {
|
|
178
|
-
return singleParamNotation(registry, 'Vec', typeDef, definitions, imports, withShortcut);
|
|
179
|
-
},
|
|
180
|
-
[TypeDefInfo.VecFixed]: (registry, typeDef, definitions, imports, withShortcut) => {
|
|
181
|
-
const sub = typeDef.sub;
|
|
182
|
-
if (sub.type === 'u8') {
|
|
183
|
-
setImports(definitions, imports, ['U8aFixed']);
|
|
184
|
-
return 'U8aFixed';
|
|
185
|
-
}
|
|
186
|
-
return singleParamNotation(registry, 'Vec', typeDef, definitions, imports, withShortcut);
|
|
187
|
-
},
|
|
188
|
-
[TypeDefInfo.BTreeMap]: (registry, typeDef, definitions, imports, withShortcut) => {
|
|
189
|
-
return dualParamsNotation(registry, 'BTreeMap', typeDef, definitions, imports, withShortcut);
|
|
190
|
-
},
|
|
191
|
-
[TypeDefInfo.BTreeSet]: (registry, typeDef, definitions, imports, withShortcut) => {
|
|
192
|
-
return singleParamNotation(registry, 'BTreeSet', typeDef, definitions, imports, withShortcut);
|
|
193
|
-
},
|
|
194
|
-
[TypeDefInfo.HashMap]: (registry, typeDef, definitions, imports, withShortcut) => {
|
|
195
|
-
return dualParamsNotation(registry, 'HashMap', typeDef, definitions, imports, withShortcut);
|
|
196
|
-
},
|
|
197
|
-
[TypeDefInfo.Linkage]: (registry, typeDef, definitions, imports, withShortcut) => {
|
|
198
|
-
return singleParamNotation(registry, 'Linkage', typeDef, definitions, imports, withShortcut);
|
|
199
|
-
},
|
|
200
|
-
[TypeDefInfo.Result]: (registry, typeDef, definitions, imports, withShortcut) => {
|
|
201
|
-
return dualParamsNotation(registry, 'Result', typeDef, definitions, imports, withShortcut);
|
|
202
|
-
},
|
|
203
|
-
[TypeDefInfo.WrapperKeepOpaque]: (registry, typeDef, definitions, imports, withShortcut) => {
|
|
204
|
-
return singleParamNotation(registry, 'WrapperKeepOpaque', typeDef, definitions, imports, withShortcut);
|
|
205
|
-
},
|
|
206
|
-
[TypeDefInfo.WrapperOpaque]: (registry, typeDef, definitions, imports, withShortcut) => {
|
|
207
|
-
return singleParamNotation(registry, 'WrapperOpaque', typeDef, definitions, imports, withShortcut);
|
|
208
|
-
}
|
|
209
|
-
};
|
|
210
|
-
/**
|
|
211
|
-
* Correctly format a given type
|
|
212
|
-
*/
|
|
213
|
-
/** @internal */
|
|
214
|
-
export function formatType(registry, definitions, type, imports, withShortcut = false) {
|
|
215
|
-
let typeDef;
|
|
216
|
-
if (isString(type)) {
|
|
217
|
-
const _type = type.toString();
|
|
218
|
-
// If type is "unorthodox" (i.e. `{ something: any }` for an Enum input or `[a | b | c, d | e | f]` for a Tuple's similar types),
|
|
219
|
-
// we return it as-is
|
|
220
|
-
if (withShortcut && /(^{.+:.+})|^\([^,]+\)|^\(.+\)\[\]|^\[.+\]/.exec(_type) && !/\[\w+;\w+\]/.exec(_type)) {
|
|
221
|
-
return rebrandTypeName(_type);
|
|
222
|
-
}
|
|
223
|
-
typeDef = getTypeDef(type);
|
|
224
|
-
}
|
|
225
|
-
else {
|
|
226
|
-
typeDef = type;
|
|
227
|
-
}
|
|
228
|
-
setImports(definitions, imports, [rebrandTypeName(typeDef.lookupName || typeDef.type)]);
|
|
229
|
-
return rebrandTypeName(formatters[typeDef.info](registry, typeDef, definitions, imports, withShortcut));
|
|
230
|
-
}
|
package/build/util/imports.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export interface ModuleTypes {
|
|
2
|
-
types: Record<string, unknown>;
|
|
3
|
-
}
|
|
4
|
-
type TypeExist = Record<string, boolean>;
|
|
5
|
-
type TypeExistMap = Record<string, TypeExist>;
|
|
6
|
-
export interface TypeImports {
|
|
7
|
-
codecTypes: TypeExist;
|
|
8
|
-
extrinsicTypes: TypeExist;
|
|
9
|
-
genericTypes: TypeExist;
|
|
10
|
-
ignoredTypes: string[];
|
|
11
|
-
localTypes: TypeExistMap;
|
|
12
|
-
lookupTypes: TypeExistMap;
|
|
13
|
-
primitiveTypes: TypeExist;
|
|
14
|
-
metadataTypes: TypeExist;
|
|
15
|
-
typesTypes: TypeExist;
|
|
16
|
-
definitions: Record<string, ModuleTypes>;
|
|
17
|
-
typeToModule: Record<string, string>;
|
|
18
|
-
}
|
|
19
|
-
/** @internal */
|
|
20
|
-
export declare function setImports(allDefs: Record<string, ModuleTypes>, imports: TypeImports, types: (string | null | undefined)[]): void;
|
|
21
|
-
/** @internal */
|
|
22
|
-
export declare function createImports(importDefinitions: Record<string, Record<string, ModuleTypes>>, { types }?: ModuleTypes): TypeImports;
|
|
23
|
-
export {};
|