Skip to content

Commit 515b916

Browse files
deskohdaffl
authored andcommitted
fix: Typings fix and improvements. (#1364)
1 parent adb2543 commit 515b916

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

packages/authentication-client/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { AuthenticationResult, AuthenticationRequest } from '@feathersjs/authent
55
import { Storage, MemoryStorage, StorageWrapper } from './storage';
66

77
declare module '@feathersjs/feathers' {
8-
interface Application<ServiceTypes = any> {
8+
interface Application<ServiceTypes = {}> {
99
io?: any;
1010
rest?: any;
1111
primus?: any;

packages/authentication/test/jwt.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ const { authenticate } = hooks;
1414
describe('authentication/jwt', () => {
1515
let app: Application<{
1616
authentication: AuthenticationService & Service<AuthenticationResult>,
17-
users: Service<any>
17+
users: Service<any>,
18+
protected: Service<any>
1819
}>;
1920
let user: any;
2021
let accessToken: string;

packages/feathers/index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,10 @@ declare namespace createApplication {
178178

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

181-
interface Application<ServiceTypes = any> extends EventEmitter {
181+
interface Application<ServiceTypes = {}> extends EventEmitter {
182182
version: string;
183183

184-
services: ServiceTypes;
184+
services: keyof ServiceTypes extends never ? any : ServiceTypes;
185185

186186
mixins: ServiceMixin[];
187187

@@ -207,7 +207,7 @@ declare namespace createApplication {
207207

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

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

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

0 commit comments

Comments
 (0)