From 315a6b1876088b4f7155f58d269190bbe3aa2c88 Mon Sep 17 00:00:00 2001 From: cbrzn Date: Mon, 20 Jun 2022 14:02:50 +0200 Subject: [PATCH] fix: add "Types." to Json in ts binding --- packages/schema/bind/src/bindings/typescript/functions.ts | 2 +- packages/test-cases/cases/bind/sanity/output/app-ts/types.ts | 4 ++-- .../test-cases/cases/bind/sanity/output/plugin-ts/types.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/schema/bind/src/bindings/typescript/functions.ts b/packages/schema/bind/src/bindings/typescript/functions.ts index 202ca6a648..bc80d02255 100644 --- a/packages/schema/bind/src/bindings/typescript/functions.ts +++ b/packages/schema/bind/src/bindings/typescript/functions.ts @@ -66,7 +66,7 @@ const _toTypescript = ( switch (type) { case "JSON": - type = "Json"; + type = "Types.Json"; break; default: if (type.includes("Enum_")) { diff --git a/packages/test-cases/cases/bind/sanity/output/app-ts/types.ts b/packages/test-cases/cases/bind/sanity/output/app-ts/types.ts index 3bd22c19dc..b325904177 100644 --- a/packages/test-cases/cases/bind/sanity/output/app-ts/types.ts +++ b/packages/test-cases/cases/bind/sanity/output/app-ts/types.ts @@ -38,8 +38,8 @@ export interface CustomType { optBigint?: Types.BigInt | null; bignumber: Types.BigNumber; optBignumber?: Types.BigNumber | null; - json: Json; - optJson?: Json | null; + json: Types.Json; + optJson?: Types.Json | null; bytes: Types.Bytes; optBytes?: Types.Bytes | null; boolean: Types.Boolean; diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-ts/types.ts b/packages/test-cases/cases/bind/sanity/output/plugin-ts/types.ts index f63231ef88..004fd2aaa9 100644 --- a/packages/test-cases/cases/bind/sanity/output/plugin-ts/types.ts +++ b/packages/test-cases/cases/bind/sanity/output/plugin-ts/types.ts @@ -50,8 +50,8 @@ export interface CustomType { optBigint?: Types.BigInt | null; bignumber: Types.BigNumber; optBignumber?: Types.BigNumber | null; - json: Json; - optJson?: Json | null; + json: Types.Json; + optJson?: Types.Json | null; bytes: Types.Bytes; optBytes?: Types.Bytes | null; boolean: Types.Boolean;