|
| 1 | +Api.ts(6,5): error TS7056: The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed. |
| 2 | +Api.ts(7,5): error TS7056: The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed. |
| 3 | +Api.ts(8,5): error TS7056: The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed. |
| 4 | + |
| 5 | + |
| 6 | +==== http-client.ts (0 errors) ==== |
| 7 | + type TPromise<ResolveType, RejectType = any> = Omit<Promise<ResolveType>, "then" | "catch"> & { |
| 8 | + then<TResult1 = ResolveType, TResult2 = never>( |
| 9 | + onfulfilled?: ((value: ResolveType) => TResult1 | PromiseLike<TResult1>) | undefined | null, |
| 10 | + onrejected?: ((reason: RejectType) => TResult2 | PromiseLike<TResult2>) | undefined | null, |
| 11 | + ): TPromise<TResult1 | TResult2, RejectType>; |
| 12 | + catch<TResult = never>( |
| 13 | + onrejected?: ((reason: RejectType) => TResult | PromiseLike<TResult>) | undefined | null, |
| 14 | + ): TPromise<ResolveType | TResult, RejectType>; |
| 15 | + }; |
| 16 | + |
| 17 | + export interface HttpResponse<D extends unknown, E extends unknown = unknown> extends Response { |
| 18 | + data: D; |
| 19 | + error: E; |
| 20 | + } |
| 21 | + |
| 22 | + export class HttpClient<SecurityDataType = unknown> { |
| 23 | + public request = <T = any, E = any>(): TPromise<HttpResponse<T, E>> => { |
| 24 | + return '' as any; |
| 25 | + }; |
| 26 | + } |
| 27 | +==== Api.ts (3 errors) ==== |
| 28 | + import { HttpClient } from "./http-client"; |
| 29 | + |
| 30 | + export class Api<SecurityDataType = unknown> { |
| 31 | + constructor(private http: HttpClient<SecurityDataType>) { } |
| 32 | + |
| 33 | + abc1 = () => this.http.request(); |
| 34 | + ~~~~ |
| 35 | +!!! error TS7056: The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed. |
| 36 | + abc2 = () => this.http.request(); |
| 37 | + ~~~~ |
| 38 | +!!! error TS7056: The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed. |
| 39 | + abc3 = () => this.http.request(); |
| 40 | + ~~~~ |
| 41 | +!!! error TS7056: The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed. |
| 42 | + } |
0 commit comments