1.0.13 • Published 7 months ago

@types/feathersjs__authentication-client v1.0.13

Weekly downloads
854
License
MIT
Repository
github
Last release
7 months ago

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.

index.d.ts

// Type definitions for @feathersjs/authentication-client 1.0
// Project: https://feathersjs.com
// Definitions by: Abraao Alves <https://github.com/AbraaoAlves>, Jan Lohage <https://github.com/j2L4e>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
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

Credits

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

1.0.11

8 months ago

1.0.10

8 months ago

1.0.13

7 months ago

1.0.12

7 months ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

5 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago