8000 fix: Updated typings for express middleware by deskoh · Pull Request #1839 · feathersjs/feathers · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
- run: npm test
env:
CI: true
- run: codeclimate-test-reporter < coverage/lcov.info
- run: |
if [ "$CODECLIMATE_REPO_TOKEN" != "" ]; then
codeclimate-test-reporter < coverage/lcov.info
fi
env:
CODECLIMATE_REPO_TOKEN: ${{ secrets.codeclimate }}
12 changes: 11 additions & 1 deletion packages/express/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Application as FeathersApplication, Params as FeathersParams, HookContext } from '@feathersjs/feathers';
import { Application as FeathersApplication, Params as FeathersParams, HookContext, SetupMethod, ServiceMethods } from '@feathersjs/feathers';
import express from 'express';

declare const feathersExpress: FeathersExpress;
Expand Down Expand Up @@ -47,4 +47,14 @@ declare module 'express-serve-static-core' {
data?: any;
hook?: HookContext;
}

type FeathersService = Partial<ServiceMethods<any> & SetupMethod>;

interface IRouterMatcher<T> {
// tslint:disable-next-line callable-types (Required for declaration merging)
<P extends Params = ParamsDictionary, ResBody = any, ReqBody = any>(
path: PathParams,
...handlers: (RequestHandler<P, ResBody, ReqBody> | FeathersService | Application)[]
): T;
}
}
0