1.1.13 • Published 6 months ago

@types/feathersjs__express v1.1.13

Weekly downloads
1,144
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/feathersjs__express

Summary

This package contains type definitions for @feathersjs/express (https://feathersjs.com).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/feathersjs__express.

index.d.ts

// Type definitions for @feathersjs/express 1.1
// Project: https://feathersjs.com
// Definitions by: Jan Lohage <https://github.com/j2L4e>
//                 Aleksey Klimenko <https://github.com/DadUndead>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8

import { Application as FeathersApplication, ServiceMethods, SetupMethod } from '@feathersjs/feathers';
import * as express from 'express';
import * as self from '@feathersjs/express';
import { IRouterHandler, PathParams, RequestHandler, RequestHandlerParams } from 'express-serve-static-core';

declare const feathersExpress: (<T>(app: FeathersApplication<T>) => Application<T>) & typeof self;
export default feathersExpress;

type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
// TypeScript methods cannot be overloaded with a different signature. Derive two application types without the use methods.
type ExpressAndFeathersApplicationWithoutUse<T> = Omit<express.Application, 'use'> & Omit<FeathersApplication<T>, 'use'>;
// Give the "any" type for the feathers options object a more precise name.
export type FeathersServiceOptions = any;

export interface FeathersRouterMatcher<T> {
    (path: PathParams, ...handlers: Array<(RequestHandler | RequestHandlerParams | Partial<ServiceMethods<any> & SetupMethod> | Application)>): T;
}

type FeathersApplicationRequestHandler<T> = express.IRouterHandler<T> & FeathersRouterMatcher<T> & ((...handlers: RequestHandlerParams[]) => T);

export interface Application<T = any> extends ExpressAndFeathersApplicationWithoutUse<T> {
    use: FeathersApplicationRequestHandler<T>;
}

export function errorHandler(options?: {
    public?: string | undefined,
    logger?: { error?: ((msg: string) => void) | undefined } | undefined,
    html?: any,
    json?: any,
}): express.ErrorRequestHandler;

export function notFound(): express.RequestHandler;

export const rest: {
    (handler?: express.RequestHandler): () => void;
    formatter: express.RequestHandler;
};

/*
 * Re-export of the express package.
 **/

export {
    CookieOptions,
    Errback,
    ErrorRequestHandler,
    Express,
    Handler,
    IRoute,
    IRouter,
    IRouterHandler,
    IRouterMatcher,
    json,
    MediaType,
    NextFunction,
    Request,
    RequestHandler,
    RequestParamHandler,
    Response,
    Router,
    RouterOptions,
    Send,
    static,
    urlencoded
} from 'express';

export const original: typeof express;

Additional Details

Credits

These definitions were written by Jan Lohage, and Aleksey Klimenko.

1.1.12

7 months ago

1.1.11

8 months ago

1.1.10

9 months ago

1.1.13

6 months ago

1.1.9

3 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago