Skip to content

Commit

Permalink
Merge pull request #444 from polywrap/prealpha-dev
Browse files Browse the repository at this point in the history
Prep 0.0.1-prealpha.35
  • Loading branch information
dOrgJelli authored Aug 20, 2021
2 parents 76eadb4 + c102c0a commit 7ad54f4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Web3API 0.0.1-prealpha.35
## Bugs
* `@web3api/schema-bind`: Fix TypeScript plugin enum bindings.

# Web3API 0.0.1-prealpha.34
## Bugs
* `@web3api/schema-bind`: Fix TypeScript enum bindings.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.1-prealpha.34
0.0.1-prealpha.35
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ export interface {{type}} {

{{/objectTypes}}
{{#enumTypes}}
enum {{type}}Enum {
export enum {{type}}Enum {
{{#constants}}
{{.}},
{{/constants}}
}

type {{type}}String =
export type {{type}}String =
{{#constants}}
| "{{.}}"
{{/constants}}
Expand All @@ -55,12 +55,19 @@ export interface {{type}} {
{{/importedObjectTypes}}
{{#importedEnumTypes}}
/* URI: "{{uri}}" */
export enum {{type}} {
export enum {{type}}Enum {
{{#constants}}
{{.}},
{{/constants}}
}

export type {{type}}String =
{{#constants}}
| "{{.}}"
{{/constants}}

export type {{type}} = {{type}}Enum | {{type}}String;

{{/importedEnumTypes}}
/// Imported Objects END ///

Expand Down
12 changes: 9 additions & 3 deletions packages/test-cases/cases/bind/sanity/output/plugin-ts/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ export interface AnotherType {
circular?: Types.CustomType | null;
}

enum CustomEnumEnum {
export enum CustomEnumEnum {
STRING,
BYTES,
}

type CustomEnumString =
export type CustomEnumString =
| "STRING"
| "BYTES"

Expand All @@ -91,11 +91,17 @@ export interface TestImport_AnotherObject {
}

/* URI: "testimport.uri.eth" */
export enum TestImport_Enum {
export enum TestImport_EnumEnum {
STRING,
BYTES,
}

export type TestImport_EnumString =
| "STRING"
| "BYTES"

export type TestImport_Enum = TestImport_EnumEnum | TestImport_EnumString;

/// Imported Objects END ///

/// Imported Queries START ///
Expand Down

0 comments on commit 7ad54f4

Please sign in to comment.