Skip to content

Commit

Permalink
fix: Typings fix and improvements. (#1364)
Browse files Browse the repository at this point in the history
  • Loading branch information
deskoh authored and daffl committed May 31, 2019
1 parent adb2543 commit 515b916
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/authentication-client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { AuthenticationResult, AuthenticationRequest } from '@feathersjs/authent
import { Storage, MemoryStorage, StorageWrapper } from './storage';

declare module '@feathersjs/feathers' {
interface Application<ServiceTypes = any> {
interface Application<ServiceTypes = {}> {
io?: any;
rest?: any;
primus?: any;
Expand Down
3 changes: 2 additions & 1 deletion packages/authentication/test/jwt.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ const { authenticate } = hooks;
describe('authentication/jwt', () => {
let app: Application<{
authentication: AuthenticationService & Service<AuthenticationResult>,
users: Service<any>
users: Service<any>,
protected: Service<any>
}>;
let user: any;
let accessToken: string;
Expand Down
6 changes: 3 additions & 3 deletions packages/feathers/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ declare namespace createApplication {

type ServiceMixin = (service: Service<any>, path: string) => void;

interface Application<ServiceTypes = any> extends EventEmitter {
interface Application<ServiceTypes = {}> extends EventEmitter {
version: string;

services: ServiceTypes;
services: keyof ServiceTypes extends never ? any : ServiceTypes;

mixins: ServiceMixin[];

Expand All @@ -207,7 +207,7 @@ declare namespace createApplication {

service<L extends keyof ServiceTypes> (location: L): ServiceTypes[L];

service (location: string): Service<any>;
service (location: string): keyof ServiceTypes extends never ? any : never;

use (path: string, service: Partial<ServiceMethods<any> & SetupMethod> | Application, options?: any): this;

Expand Down

0 comments on commit 515b916

Please sign in to comment.