wasm-ast-types 1.2.0 → 1.3.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,54 +1,7 @@
1
1
  import * as t from '@babel/types';
2
- import { JSONSchema, IDLObject } from "@cosmology/ts-codegen-types";
2
+ import { JSONSchema } from "@cosmology/ts-codegen-types";
3
3
  import { UtilMapping } from "./imports";
4
- export interface ReactQueryOptions {
5
- enabled?: boolean;
6
- optionalClient?: boolean;
7
- version?: 'v3' | 'v4';
8
- mutations?: boolean;
9
- camelize?: boolean;
10
- queryKeys?: boolean;
11
- queryFactory?: boolean;
12
- }
13
- export interface TSClientOptions {
14
- enabled?: boolean;
15
- execExtendsQuery?: boolean;
16
- noImplicitOverride?: boolean;
17
- }
18
- export interface MessageComposerOptions {
19
- enabled?: boolean;
20
- }
21
- export interface MessageBuilderOptions {
22
- enabled?: boolean;
23
- }
24
- export interface RecoilOptions {
25
- enabled?: boolean;
26
- }
27
- export interface TSTypesOptions {
28
- enabled?: boolean;
29
- itemsUseTuples?: boolean;
30
- aliasExecuteMsg?: boolean;
31
- aliasEntryPoints?: boolean;
32
- }
33
- export interface ContractInfo {
34
- schemas: JSONSchema[];
35
- responses?: Record<string, JSONSchema>;
36
- idlObject?: Partial<IDLObject>;
37
- }
38
- export interface RenderOptions {
39
- enabled?: boolean;
40
- types?: TSTypesOptions;
41
- recoil?: RecoilOptions;
42
- messageComposer?: MessageComposerOptions;
43
- messageBuilder?: MessageBuilderOptions;
44
- client?: TSClientOptions;
45
- reactQuery?: ReactQueryOptions;
46
- }
47
- export interface ProviderInfo {
48
- classname: string;
49
- filename: string;
50
- basename: string;
51
- }
4
+ import { ContractInfo, ProviderInfo, RenderOptions } from '../types';
52
5
  export interface IContext {
53
6
  refLookup($ref: string): JSONSchema;
54
7
  addUtil(util: string): void;
@@ -8,7 +8,6 @@ const utils_1 = require("../utils");
8
8
  const imports_1 = require("./imports");
9
9
  const deepmerge_1 = __importDefault(require("deepmerge"));
10
10
  const path_1 = require("path");
11
- ;
12
11
  exports.defaultOptions = {
13
12
  enabled: true,
14
13
  types: {
@@ -37,6 +36,9 @@ exports.defaultOptions = {
37
36
  mutations: false,
38
37
  camelize: true,
39
38
  queryKeys: false
39
+ },
40
+ useContractHooks: {
41
+ enabled: false
40
42
  }
41
43
  };
42
44
  const getDefinitionSchema = (schemas) => {
@@ -2,7 +2,6 @@ import { refLookup } from "../utils";
2
2
  import { convertUtilsToImportList, getImportStatements } from "./imports";
3
3
  import deepmerge from "deepmerge";
4
4
  import { basename, extname } from 'path';
5
- ;
6
5
  export const defaultOptions = {
7
6
  enabled: true,
8
7
  types: {
@@ -31,6 +30,9 @@ export const defaultOptions = {
31
30
  mutations: false,
32
31
  camelize: true,
33
32
  queryKeys: false
33
+ },
34
+ useContractHooks: {
35
+ enabled: false
34
36
  }
35
37
  };
36
38
  export const getDefinitionSchema = (schemas) => {
package/esm/index.js CHANGED
@@ -6,3 +6,4 @@ export * from './message-composer';
6
6
  export * from './react-query';
7
7
  export * from './message-builder';
8
8
  export * from './provider';
9
+ export * from './types';
@@ -0,0 +1,2 @@
1
+ ;
2
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './plugins';
2
+ export * from './context';
@@ -0,0 +1,2 @@
1
+ ;
2
+ export {};
package/index.d.ts CHANGED
@@ -6,3 +6,4 @@ export * from './message-composer';
6
6
  export * from './react-query';
7
7
  export * from './message-builder';
8
8
  export * from './provider';
9
+ export * from './types';
package/index.js CHANGED
@@ -22,3 +22,4 @@ __exportStar(require("./message-composer"), exports);
22
22
  __exportStar(require("./react-query"), exports);
23
23
  __exportStar(require("./message-builder"), exports);
24
24
  __exportStar(require("./provider"), exports);
25
+ __exportStar(require("./types"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wasm-ast-types",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "CosmWasm TypeScript AST generation",
5
5
  "author": "Dan Lynch <pyramation@gmail.com>",
6
6
  "homepage": "https://github.com/cosmwasm/ts-codegen/tree/master/packages/ast#readme",
@@ -39,5 +39,5 @@
39
39
  "case": "1.6.3",
40
40
  "deepmerge": "4.2.2"
41
41
  },
42
- "gitHead": "8765a19d3cc72296ac528f9ec12f215e6017e34e"
42
+ "gitHead": "43cbdf2257bd5a86b5fc1bfa577a78a9f18ec7cd"
43
43
  }
@@ -1,5 +1,5 @@
1
1
  import * as t from "@babel/types";
2
- import { ProviderInfo } from "../context";
2
+ import { ProviderInfo } from "../types";
3
3
  export declare const createProvider: (name: string, providerInfos: {
4
4
  [key: string]: ProviderInfo;
5
5
  }) => t.ExportNamedDeclaration;
@@ -0,0 +1,22 @@
1
+ import { IDLObject, JSONSchema } from "@cosmology/ts-codegen-types";
2
+ import { MessageBuilderOptions, MessageComposerOptions, ReactQueryOptions, RecoilOptions, TSClientOptions, TSTypesOptions, UseContractsOptions } from "./plugins";
3
+ export interface ContractInfo {
4
+ schemas: JSONSchema[];
5
+ responses?: Record<string, JSONSchema>;
6
+ idlObject?: Partial<IDLObject>;
7
+ }
8
+ export interface RenderOptions {
9
+ enabled?: boolean;
10
+ types?: TSTypesOptions;
11
+ recoil?: RecoilOptions;
12
+ messageComposer?: MessageComposerOptions;
13
+ messageBuilder?: MessageBuilderOptions;
14
+ client?: TSClientOptions;
15
+ reactQuery?: ReactQueryOptions;
16
+ useContractHooks?: UseContractsOptions;
17
+ }
18
+ export interface ProviderInfo {
19
+ classname: string;
20
+ filename: string;
21
+ basename: string;
22
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ ;
@@ -0,0 +1,2 @@
1
+ export * from './plugins';
2
+ export * from './context';
package/types/index.js ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./plugins"), exports);
18
+ __exportStar(require("./context"), exports);
@@ -0,0 +1,32 @@
1
+ export interface ReactQueryOptions {
2
+ enabled?: boolean;
3
+ optionalClient?: boolean;
4
+ version?: 'v3' | 'v4';
5
+ mutations?: boolean;
6
+ camelize?: boolean;
7
+ queryKeys?: boolean;
8
+ queryFactory?: boolean;
9
+ }
10
+ export interface TSClientOptions {
11
+ enabled?: boolean;
12
+ execExtendsQuery?: boolean;
13
+ noImplicitOverride?: boolean;
14
+ }
15
+ export interface MessageComposerOptions {
16
+ enabled?: boolean;
17
+ }
18
+ export interface MessageBuilderOptions {
19
+ enabled?: boolean;
20
+ }
21
+ export interface RecoilOptions {
22
+ enabled?: boolean;
23
+ }
24
+ export interface TSTypesOptions {
25
+ enabled?: boolean;
26
+ itemsUseTuples?: boolean;
27
+ aliasExecuteMsg?: boolean;
28
+ aliasEntryPoints?: boolean;
29
+ }
30
+ export interface UseContractsOptions {
31
+ enabled?: boolean;
32
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ ;