Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Commit

Permalink
Fix Error type
Browse files Browse the repository at this point in the history
  • Loading branch information
xanderberkein committed Aug 8, 2023
1 parent 7a5d10c commit e98bfb5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import RPC from './rpc';
import { Error, Methods } from './tl/types/schema';
import { Methods } from './tl/types/schema';

type MethodReturnMap<T extends Methods> = {
[K in keyof T]: T[K] extends { return: infer R } ? R : never;
Expand All @@ -10,6 +10,12 @@ type MethodOptions = {
dcId?: number;
};

type Error = {
_: string;
error_code: number;
error_message: string;
};

declare class CustomStorage {
set(key: string, value: string): Promise<void>;
get(key: string): Promise<string | null>;
Expand All @@ -26,7 +32,7 @@ declare class MTProto {
});

/**
* @throws {MTProtoError}
* @throws {Error}
*/
call<T extends keyof Methods>(
method: T,
Expand Down

0 comments on commit e98bfb5

Please sign in to comment.