diff --git a/types/feathersjs__feathers/index.d.ts b/types/feathersjs__feathers/index.d.ts index c10a173f06..6ae7b22238 100644 --- a/types/feathersjs__feathers/index.d.ts +++ b/types/feathersjs__feathers/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Jan Lohage , Abraao Alves // Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript -// TypeScript Version: 2.2 +// TypeScript Version: 2.3 /// @@ -30,7 +30,7 @@ export type ServerSideParams = Params; export interface Params { query?: Query; - paginate: false | Pick; + paginate?: false | Pick; [key: string]: any; // (JL) not sure if we want this } @@ -42,10 +42,11 @@ export interface Paginated { data: T[]; } -export type Hook = (hook: HookContext) => (Promise> | undefined); +// tslint:disable-next-line void-return +export type Hook = (hook: HookContext) => (Promise> | void); export interface HookContext { - app?: Application; + app?: Application; data?: T; error?: any; id?: string | number; @@ -89,7 +90,7 @@ export interface ServiceMethods { } export interface SetupMethod { - setup(app: Application, path: string): void; + setup(app: Application, path: string): void; } export interface ServiceOverloads { @@ -106,7 +107,7 @@ export interface ServiceAddons extends EventEmitter { export type Service = ServiceOverloads & ServiceAddons & ServiceMethods; -export interface Application extends EventEmitter { +export interface Application extends EventEmitter { get(name: string): any; set(name: string, value: any): this; @@ -129,7 +130,7 @@ export interface Application extends EventEmitter { service(location: string): Service; - use(path: string, service: Partial & SetupMethod> | Application, options?: any): this; + use(path: string, service: Partial & SetupMethod> | Application, options?: any): this; version: string; } diff --git a/types/feathersjs__socket-commons/index.d.ts b/types/feathersjs__socket-commons/index.d.ts index fca658bf76..043009fd5e 100644 --- a/types/feathersjs__socket-commons/index.d.ts +++ b/types/feathersjs__socket-commons/index.d.ts @@ -28,8 +28,10 @@ declare module '@feathersjs/feathers' { interface Application { channel(...names: string[]): Channel; - publish(callback: (data: T, hook: HookContext) => Channel | Channel[]): Application; + // tslint:disable-next-line void-return + publish(callback: (data: T, hook: HookContext) => Channel | Channel[] | void): Application; - publish(event: string, callback: (data: T, hook: HookContext) => Channel | Channel[]): Application; + // tslint:disable-next-line void-return + publish(event: string, callback: (data: T, hook: HookContext) => Channel | Channel[] | void): Application; } } diff --git a/types/feathersjs__socketio/index.d.ts b/types/feathersjs__socketio/index.d.ts index 34b78eb749..7ba889dfbe 100644 --- a/types/feathersjs__socketio/index.d.ts +++ b/types/feathersjs__socketio/index.d.ts @@ -7,6 +7,6 @@ /// /// -export default function feathersSocketIO(callback: (io: SocketIO.Server) => void): () => void; +export default function feathersSocketIO(callback?: (io: SocketIO.Server) => void): () => void; export default function feathersSocketIO(options: number | SocketIO.ServerOptions, callback?: (io: SocketIO.Server) => void): () => void; export default function feathersSocketIO(port: number, options?: SocketIO.ServerOptions, callback?: (io: SocketIO.Server) => void): () => void;