From 7818aec0dd9fe7af6ec6c6c4971df8426ef4a5d6 Mon Sep 17 00:00:00 2001 From: Dmitrii Maganov Date: Wed, 25 Sep 2019 19:40:37 +0300 Subject: [PATCH] fix: Typing improvements (#1580) --- packages/authentication-client/src/core.ts | 6 +++--- packages/primus/index.d.ts | 3 +-- packages/socketio/index.d.ts | 6 +++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/authentication-client/src/core.ts b/packages/authentication-client/src/core.ts index 47b4040ed1..effec73b8f 100644 --- a/packages/authentication-client/src/core.ts +++ b/packages/authentication-client/src/core.ts @@ -1,5 +1,5 @@ import { NotAuthenticated, FeathersError } from '@feathersjs/errors'; -import { Application } from '@feathersjs/feathers'; +import { Application, Params } from '@feathersjs/feathers'; import { AuthenticationRequest, AuthenticationResult } from '@feathersjs/authentication'; import { Storage, StorageWrapper } from './storage'; @@ -149,12 +149,12 @@ export class AuthenticationClient { return authPromise; } - authenticate (authentication: AuthenticationRequest): Promise { + authenticate (authentication: AuthenticationRequest, params?: Params): Promise { if (!authentication) { return this.reAuthenticate(); } - const promise = this.service.create(authentication) + const promise = this.service.create(authentication, params) .then((authResult: AuthenticationResult) => { const { accessToken } = authResult; diff --git a/packages/primus/index.d.ts b/packages/primus/index.d.ts index b6a0f92e54..7226d5c3ea 100644 --- a/packages/primus/index.d.ts +++ b/packages/primus/index.d.ts @@ -6,7 +6,6 @@ declare const configurePrimus: FeathersPrimus; export = configurePrimus; interface FeathersPrimus { - (options: any, callback?: (primus: any) => void): () => void; - readonly SOCKET_KEY: unique symbol; + (options?: any, callback?: (primus: any) => void): (app: any) => void; default: FeathersPrimus; } diff --git a/packages/socketio/index.d.ts b/packages/socketio/index.d.ts index c17797a2a8..3bd63b2d5c 100644 --- a/packages/socketio/index.d.ts +++ b/packages/socketio/index.d.ts @@ -5,8 +5,8 @@ declare const socketio: FeathersSocketIO; export = socketio; interface FeathersSocketIO { - (callback?: (io: io.Server) => void): () => void; - (options: number | io.ServerOptions, callback?: (io: io.Server) => void): () => void; - (port: number, options?: io.ServerOptions, callback?: (io: io.Server) => void): () => void; + (callback?: (io: io.Server) => void): (app: any) => void; + (options: number | io.ServerOptions, callback?: (io: io.Server) => void): (app: any) => void; + (port: number, options?: io.ServerOptions, callback?: (io: io.Server) => void): (app: any) => void; default: FeathersSocketIO; }