fix(@feathersjs/various): proper module augmentation, add reexports (#23195)

* fix feathersjs__{authentication-client,express,socket-commons}

* fix feathersjs__authentication-client
This commit is contained in:
Jan Lohage
2018-01-25 13:41:41 -08:00
committed by Andy
parent 5ec69dfcc8
commit 9dec8df964
9 changed files with 78 additions and 57 deletions
@@ -1,4 +1,11 @@
import feathers from '@feathersjs/feathers';
import feathersAuthClient from '@feathersjs/authentication-client';
// we can't really do much, because the augmentation of @feathersjs/feathers breaks importing it here.
const configureFn = feathersAuthClient({});
const app = feathers();
app.configure(feathersAuthClient());
app.authenticate({strategy : 'abcdef'}).then(() => {});
app.logout().then(() => {});
// check if the non-augmented @feathersjs/feathers typings still work
app.on('asd', () => {});
app.service('asd').get(0).then(() => {});
@@ -1,14 +0,0 @@
declare module '@feathersjs/feathers' {
import {
FeathersAuthCredentials,
Passport
} from '@feathersjs/authentication-client';
interface Application<ServiceTypes> {
authenticate(options?: FeathersAuthCredentials): Promise<any>;
logout(): Promise<void>;
passport: Passport;
}
}
+10 -2
View File
@@ -3,8 +3,6 @@
// Definitions by: Abraao Alves <https://github.com/AbraaoAlves>, Jan Lohage <https://github.com/j2L4e>
// Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript
import './feathersjs__feathers';
export default function feathersAuthClient(config?: FeathersAuthClientConfig): () => void;
export interface FeathersAuthClientConfig {
@@ -62,3 +60,13 @@ export interface Passport {
getStorage(storage: any): any;
}
declare module '@feathersjs/feathers' {
interface Application<ServiceTypes> {
authenticate(options?: FeathersAuthCredentials): Promise<any>;
logout(): Promise<void>;
passport: Passport;
}
}