declare module 'telegram-mtproto' { type ServerConfig = { dev?: boolean webogram?: boolean } type AppConfig = { debug?: boolean storage?: AsyncStorage } type ApiConfig = { invokeWithLayer?: number layer ?: number initConnection ?: number api_id ?: string device_model ?: string system_version ?: string app_version ?: string lang_code ?: string } type Config = { server?: ServerConfig api?: ApiConfig app?: AppConfig schema?: Object mtSchema?: Object } class ApiManager { constructor() constructor({ server, api, app, schema, mtSchema }: Config) readonly storage: AsyncStorage mtpInvokeApi(method: string): Promise mtpInvokeApi(method: string, params: Object): Promise mtpInvokeApi(method: string, params: Object, options: Object): Promise on(event: string|string[], handler: Function) } interface AsyncStorage { get(...keys: string[]): Promise set(obj: Object): Promise remove(...keys: string[]): Promise clear(): Promise<{}> } }