From 56a5b144647340c204fd1c927c8951c77ce451bd Mon Sep 17 00:00:00 2001 From: Zetazzz Date: Fri, 10 Nov 2023 15:18:22 +0800 Subject: [PATCH] edit type name --- .../misc/output-impl-interfaces/registry.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/__fixtures__/misc/output-impl-interfaces/registry.ts b/__fixtures__/misc/output-impl-interfaces/registry.ts index d6587f331e..75e66a1b34 100644 --- a/__fixtures__/misc/output-impl-interfaces/registry.ts +++ b/__fixtures__/misc/output-impl-interfaces/registry.ts @@ -12,7 +12,7 @@ export interface IProtoType { $typeUrl?: any; } -export interface TelescopeGeneratedType< +export interface TelescopeGeneratedDecoder< T = unknown, SDK = unknown, Amino = unknown @@ -41,22 +41,22 @@ export interface TelescopeGeneratedType< export class GlobalDecoderRegistry { static registry: { - [key: string]: TelescopeGeneratedType; + [key: string]: TelescopeGeneratedDecoder; } = {}; static register( key: string, - decoder: TelescopeGeneratedType + decoder: TelescopeGeneratedDecoder ) { GlobalDecoderRegistry.registry[key] = decoder; } static getDecoder( key: string - ): TelescopeGeneratedType { + ): TelescopeGeneratedDecoder { return GlobalDecoderRegistry.registry[key]; } static getDecoderByInstance( obj: unknown - ): TelescopeGeneratedType | null { + ): TelescopeGeneratedDecoder | null { if (obj === undefined || obj === null) { return null; } @@ -139,7 +139,6 @@ export class GlobalDecoderRegistry { const decoder = getDecoderByInstance(object); return decoder.toSDK!(object); } - static fromAmino(object: Amino): T { const decoder = getDecoderByInstance(object); return decoder.fromAmino!(object); @@ -152,7 +151,7 @@ export class GlobalDecoderRegistry { function getDecoderByInstance( obj: unknown -): TelescopeGeneratedType { +): TelescopeGeneratedDecoder { const decoder = GlobalDecoderRegistry.getDecoderByInstance( obj );