refactor: use type which is closer to pre-defined typescript type for answer.ts
This commit is contained in:
parent
09d609f414
commit
846a64f993
@ -1,6 +1,6 @@
|
||||
import { registerHandler } from '../ipc-server';
|
||||
|
||||
export function answer(channel: IpcChannel): DecoratorFactory<IIpcController> {
|
||||
export function answer(channel: IpcChannel): IpcControllerMethodDecorator {
|
||||
return function (target: IIpcController, propertyKey): void {
|
||||
registerHandler(channel, target, propertyKey);
|
||||
};
|
||||
|
1
types/decorator-factory.d.ts
vendored
1
types/decorator-factory.d.ts
vendored
@ -1 +0,0 @@
|
||||
type DecoratorFactory<T> = (target: T, propertyKey: string, descriptor: PropertyDescriptor) => void;
|
4
types/ipc-controller-method-decorator.d.ts
vendored
Normal file
4
types/ipc-controller-method-decorator.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
/**
|
||||
* @see MethodDecorator
|
||||
*/
|
||||
type IpcControllerMethodDecorator = <T>(target: IIpcController, propertyKey: string, descriptor: TypedPropertyDescriptor<T>) => void
|
Loading…
x
Reference in New Issue
Block a user