wasm-ast-types 0.1.2 → 0.1.3
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/main/wasm.js +3 -1
- package/module/wasm.js +1 -2
- package/package.json +2 -2
- package/types/index.d.ts +0 -1
- package/types/utils.d.ts +2 -3
- package/types/wasm.d.ts +16 -4
package/main/wasm.js
CHANGED
@@ -7,7 +7,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
8
8
|
value: true
|
9
9
|
});
|
10
|
-
exports.propertySignature = exports.createWasmQueryMethod = exports.createWasmExecMethod = exports.createTypedObjectParams = exports.createTypeOrInterface = exports.createTypeInterface = exports.createQueryInterface = exports.createQueryClass = exports.createPropertyFunctionWithObjectParams = exports.createExecuteInterface = exports.createExecuteClass = void 0;
|
10
|
+
exports.propertySignature = exports.getMessageProperties = exports.createWasmQueryMethod = exports.createWasmExecMethod = exports.createTypedObjectParams = exports.createTypeOrInterface = exports.createTypeInterface = exports.createQueryInterface = exports.createQueryClass = exports.createPropertyFunctionWithObjectParams = exports.createExecuteInterface = exports.createExecuteClass = void 0;
|
11
11
|
|
12
12
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
13
13
|
|
@@ -30,6 +30,8 @@ var getMessageProperties = function getMessageProperties(msg) {
|
|
30
30
|
return [];
|
31
31
|
};
|
32
32
|
|
33
|
+
exports.getMessageProperties = getMessageProperties;
|
34
|
+
|
33
35
|
var getTypeFromRef = function getTypeFromRef($ref) {
|
34
36
|
switch ($ref) {
|
35
37
|
case '#/definitions/Binary':
|
package/module/wasm.js
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
import * as t from '@babel/types';
|
2
2
|
import { camel, pascal } from 'case';
|
3
3
|
import { bindMethod, typedIdentifier, promiseTypeAnnotation, classDeclaration, classProperty, arrowFunctionExpression } from './utils';
|
4
|
-
|
5
|
-
const getMessageProperties = msg => {
|
4
|
+
export const getMessageProperties = msg => {
|
6
5
|
if (msg.anyOf) return msg.anyOf;
|
7
6
|
if (msg.oneOf) return msg.oneOf;
|
8
7
|
if (msg.allOf) return msg.allOf;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "wasm-ast-types",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.3",
|
4
4
|
"description": "CosmWasm TypeScript AST generation",
|
5
5
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
6
6
|
"homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme",
|
@@ -85,5 +85,5 @@
|
|
85
85
|
"ast-stringify": "0.1.0",
|
86
86
|
"case": "1.6.3"
|
87
87
|
},
|
88
|
-
"gitHead": "
|
88
|
+
"gitHead": "6820d1185529bc0a4f67743d69a0cfe087c57eb7"
|
89
89
|
}
|
package/types/index.d.ts
CHANGED
package/types/utils.d.ts
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
import * as t from '@babel/types';
|
2
|
-
import { Field } from './types';
|
3
2
|
import { TSTypeAnnotation, TSExpressionWithTypeArguments } from '@babel/types';
|
4
3
|
export declare const bindMethod: (name: string) => t.ExpressionStatement;
|
5
4
|
export declare const typedIdentifier: (name: string, typeAnnotation: TSTypeAnnotation, optional?: boolean) => t.Identifier;
|
@@ -21,9 +20,9 @@ export declare const shorthandProperty: (prop: string) => t.ObjectProperty;
|
|
21
20
|
export declare const importStmt: (names: string[], path: string) => t.ImportDeclaration;
|
22
21
|
export declare const importAminoMsg: () => t.ImportDeclaration;
|
23
22
|
export declare const getFieldDimensionality: (field: Field) => {
|
24
|
-
typeName:
|
23
|
+
typeName: any;
|
25
24
|
dimensions: number;
|
26
|
-
isArray:
|
25
|
+
isArray: any;
|
27
26
|
};
|
28
27
|
export declare const memberExpressionOrIdentifier: (names: any) => any;
|
29
28
|
export declare const memberExpressionOrIdentifierSnake: (names: any) => any;
|
package/types/wasm.d.ts
CHANGED
@@ -2,20 +2,32 @@ import * as t from '@babel/types';
|
|
2
2
|
interface QueryMsg {
|
3
3
|
$schema: string;
|
4
4
|
title: "QueryMsg";
|
5
|
-
oneOf
|
5
|
+
oneOf?: any;
|
6
|
+
allOf?: any;
|
7
|
+
anyOf?: any;
|
6
8
|
}
|
7
9
|
interface ExecuteMsg {
|
8
10
|
$schema: string;
|
9
11
|
title: "ExecuteMsg" | "ExecuteMsg_for_Empty";
|
10
|
-
oneOf
|
12
|
+
oneOf?: any;
|
13
|
+
allOf?: any;
|
14
|
+
anyOf?: any;
|
11
15
|
}
|
16
|
+
export declare const getMessageProperties: (msg: QueryMsg | ExecuteMsg) => any;
|
12
17
|
export declare const createWasmQueryMethod: (jsonschema: any) => t.ClassProperty;
|
13
18
|
export declare const createQueryClass: (className: string, implementsClassName: string, queryMsg: QueryMsg) => t.ExportNamedDeclaration;
|
14
19
|
export declare const createWasmExecMethod: (jsonschema: any) => t.ClassProperty;
|
15
20
|
export declare const createExecuteClass: (className: string, implementsClassName: string, extendsClassName: string, execMsg: ExecuteMsg) => t.ExportNamedDeclaration;
|
16
|
-
export declare const createExecuteInterface: (className: string, extendsClassName: string, execMsg: ExecuteMsg) => t.ExportNamedDeclaration;
|
21
|
+
export declare const createExecuteInterface: (className: string, extendsClassName: string | null, execMsg: ExecuteMsg) => t.ExportNamedDeclaration;
|
22
|
+
export declare const propertySignature: (name: string, typeAnnotation: t.TSTypeAnnotation, optional?: boolean) => {
|
23
|
+
type: string;
|
24
|
+
key: t.Identifier;
|
25
|
+
typeAnnotation: t.TSTypeAnnotation;
|
26
|
+
optional: boolean;
|
27
|
+
};
|
28
|
+
export declare const createTypedObjectParams: (jsonschema: any, camelize?: boolean) => t.ObjectPattern;
|
29
|
+
export declare const createPropertyFunctionWithObjectParams: (methodName: string, responseType: string, jsonschema: any) => t.TSPropertySignature;
|
17
30
|
export declare const createQueryInterface: (className: string, queryMsg: QueryMsg) => t.ExportNamedDeclaration;
|
18
|
-
export declare const propertySignature: (name: string, typeAnnotation: t.TSTypeAnnotation, optional?: boolean) => t.TSPropertySignature;
|
19
31
|
export declare const createTypeOrInterface: (Type: string, jsonschema: any) => t.ExportNamedDeclaration;
|
20
32
|
export declare const createTypeInterface: (jsonschema: any) => t.ExportNamedDeclaration;
|
21
33
|
export {};
|