@types/feathersjs__authentication-client
TypeScript icon, indicating that this package has built-in type declarations

1.0.13 • Public • Published

Installation

npm install --save @types/feathersjs__authentication-client

Summary

This package contains type definitions for @feathersjs/authentication-client (https://feathersjs.com).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/feathersjs__authentication-client.

// eslint-disable-next-line @definitelytyped/no-self-import
import * as self from "@feathersjs/authentication-client";

declare const feathersAuthClient: ((config?: FeathersAuthClientConfig) => () => void) & typeof self;
export default feathersAuthClient;

export interface FeathersAuthClientConfig {
    storage?: Storage | undefined;
    header?: string | undefined;
    cookie?: string | undefined;
    storageKey?: string | undefined;
    jwtStrategy?: string | undefined;
    path?: string | undefined;
    entity?: string | undefined;
    service?: string | undefined;
    timeout?: number | undefined;
}

export interface FeathersAuthCredentials {
    strategy: string;

    [index: string]: any;
}

export const defaults: {
    header: string;
    cookie: string;
    storageKey: string;
    jwtStrategy: string;
    path: string;
    entity: string;
    service: string;
    timeout: number;
};

export interface Passport {
    setupSocketListeners(): void;

    connected(): Promise<any>;

    authenticate(credentials?: FeathersAuthCredentials): any;

    authenticateSocket(credentials: FeathersAuthCredentials, socket: any, emit: any): any;

    logoutSocket(socket: any, emit: any): Promise<any>;

    logout(): Promise<any>;

    setJWT(data: any): Promise<any>;

    getJWT(): Promise<any>;

    verifyJWT(token: string): Promise<any>;

    payloadIsValid(payload: string): boolean;

    getCookie(name: string): string;

    clearCookie(name: string): null;

    getStorage(storage: any): any;
}

declare module "@feathersjs/feathers" {
    interface Application<ServiceTypes> {
        authenticate(options?: FeathersAuthCredentials): Promise<any>;

        logout(): Promise<void>;

        passport: Passport;
    }
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 03:09:37 GMT
  • Dependencies: none

Credits

These definitions were written by Abraao Alves, and Jan Lohage.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/feathersjs__authentication-client

Weekly Downloads

378

Version

1.0.13

License

MIT

Unpacked Size

6.38 kB

Total Files

5

Last publish

Collaborators

  • types