@airgram/core
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -1,2 +0,2 @@ | ||
import { ApiMethods, Config, Context, ErrorHandler, Instance, Middleware, MiddlewareOn, TdObject, TdProvider } from './types'; | ||
import { ApiMethods, BaseTdObject, Config, Context, ErrorHandler, Instance, Middleware, MiddlewareOn, TdObject, TdProvider } from './types'; | ||
export declare class Airgram<ProviderT extends TdProvider> implements Instance<ProviderT> { | ||
@@ -12,3 +12,3 @@ readonly config: Config<ProviderT>; | ||
catch(handler: (error: Error) => void): void; | ||
emit(update: TdObject): Promise<unknown>; | ||
emit<UpdateT extends BaseTdObject = TdObject>(update: UpdateT): Promise<unknown>; | ||
use(...fns: Middleware<Context>[]): void; | ||
@@ -15,0 +15,0 @@ private apiMiddleware; |
@@ -1,3 +0,2 @@ | ||
import { BaseTdObject, Composer as BaseComposer, Middleware, MiddlewareFn } from '../types'; | ||
export declare type NextFn = () => any; | ||
import { BaseTdObject, Composer as BaseComposer, Middleware, MiddlewareFn, NextFn } from '../types'; | ||
declare function compose<ContextT>(middlewares: Middleware<ContextT>[]): MiddlewareFn<ContextT>; | ||
@@ -4,0 +3,0 @@ declare function branch<ContextT>(predicate: unknown, trueMiddleware: Middleware<ContextT>, falseMiddleware: Middleware<ContextT>): MiddlewareFn<ContextT>; |
{ | ||
"name": "@airgram/core", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"private": false, | ||
@@ -11,3 +11,3 @@ "main": "index.js", | ||
}, | ||
"gitHead": "60f2dbdbf5b0178563c238a6bd9375823c0c4113", | ||
"gitHead": "5d0b784b9d2b9a786a2c2d91a623371168799568", | ||
"sideEffects": false, | ||
@@ -14,0 +14,0 @@ "author": "Alexander Krisko", |
@@ -14,2 +14,3 @@ import * as api from './api'; | ||
} | MiddlewareFn<ContextT>; | ||
export declare type NextFn = () => any; | ||
export interface Deferred { | ||
@@ -42,3 +43,3 @@ promise: Promise<void>; | ||
catch(handler: (error: Error) => void): void; | ||
emit(update: TdObject): Promise<unknown>; | ||
emit<UpdateT extends BaseTdObject>(update: UpdateT): Promise<unknown>; | ||
use(...fns: Middleware<(ApiResponse<unknown, TdObject> | UpdateContext<TdObject>)>[]): void; | ||
@@ -45,0 +46,0 @@ } |
814845