From 40710eda1532e8e2c95ef94df0c4e7ab398d31e0 Mon Sep 17 00:00:00 2001 From: NickBolles Date: Tue, 15 Jan 2019 00:13:03 -0600 Subject: [PATCH] Add express and service to @feathersjs/authentication --- types/feathersjs__authentication/index.d.ts | 26 ++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/types/feathersjs__authentication/index.d.ts b/types/feathersjs__authentication/index.d.ts index 7bb88a903d..c3fbce5ebf 100644 --- a/types/feathersjs__authentication/index.d.ts +++ b/types/feathersjs__authentication/index.d.ts @@ -1,11 +1,15 @@ // Type definitions for @feathersjs/authentication 2.1 // Project: http://feathersjs.com/ -// Definitions by: Abraao Alves , Jan Lohage +// Definitions by: Abraao Alves +// Jan Lohage +// Nick Bolles // Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript // TypeScript Version: 2.3 import { Hook } from '@feathersjs/feathers'; import * as self from '@feathersjs/authentication'; +import { RequestHandler, Application } from 'express'; +import { create } from 'domain'; declare const feathersAuthentication: ((config?: FeathersAuthenticationOptions) => () => void) & typeof self; export default feathersAuthentication; @@ -52,6 +56,26 @@ export interface FeathersAuthenticationOptions { }; } +export namespace express { + function exposeHeaders(): RequestHandler; + function exposeCookies(): RequestHandler; + function authenticate(strategy: string | string[], options?: FeathersAuthenticationOptions): RequestHandler; + function setCookie(options?: FeathersAuthenticationOptions): RequestHandler; + function successRedirect(): RequestHandler; + function failureRedirect(options?: FeathersAuthenticationOptions): RequestHandler; + function emitEvents(): RequestHandler; +} + +export function service(options: FeathersAuthenticationOptions): (app?: Application) => void; + +export namespace service { + class Service { + constructor(app: Application) + create(data: any, params: any): Promise<{ accessToken: string }>; + remove(id: null | string, params: any): Promise<{ accessToken: string }>; + } +} + export namespace AuthHooks { interface HashPassOptions { passwordField: string;