This commit is contained in:
crusader 2018-09-06 12:34:22 +09:00
parent 675fb6b992
commit 7765d1ce77
4 changed files with 27 additions and 33 deletions

View File

@ -1,40 +1,28 @@
import {
PropertyKeyType,
Decorator,
DecoratorHelper,
Type
} from '@overflow/core-js';
export interface RPCSubscriberDecoratorAttribute {
method: string;
}
export function RPCSubscriber(attribute: RPCSubscriberDecoratorAttribute): MethodDecorator {
return function <T>(target: Object, propertyKey: PropertyKeyType, descriptor: TypedPropertyDescriptor<T>)
: TypedPropertyDescriptor<T> | void {
DecoratorHelper.register<RPCSubscriberDecoratorAttribute>(attribute, target, propertyKey, descriptor);
};
export class RPCSubscriberDecorator extends Decorator<RPCSubscriberDecoratorAttribute> {
public constructor(attribute: RPCSubscriberDecoratorAttribute) {
super(attribute);
}
// import {
// PropertyKeyType,
// Decorator,
// DecoratorHelper
// } from '@overflow/core-js';
public methodDecorator = <T>(target: Object, propertyKey: PropertyKeyType,
descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T> | void => {
}
// export interface RPCSubscriberDecoratorAttribute {
// method: string;
// }
}
// export class RPCSubscriberDecorator extends Decorator<RPCSubscriberDecoratorAttribute> {
// public constructor(config: RPCSubscriberDecoratorAttribute) {
// super(config);
// }
export function RPCSubscriber(attribute: RPCSubscriberDecoratorAttribute): MethodDecorator {
const decorator = DecoratorHelper.register(RPCSubscriberDecorator, attribute);
return decorator;
}
// public methodDecorator = <T>(target: Object, propertyKey: PropertyKeyType,
// descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T> | void => {
// }
// }
// export const RPCSubscriber = DecoratorHelper.create<RPCSubscriberDecoratorAttribute>(RPCSubscriberDecorator);
// export const RPCSubscriber = DecoratorHelper.create(RPCSubscriberDecorator);

View File

@ -12,7 +12,7 @@
"lint": "ng lint",
"e2e": "ng e2e",
"wait-on:build:main:dev": "wait-on http-get://localhost:4200/ && yarn build:main:dev",
"postinstall": "electron-builder install-app-deps"
"electron:builder:install-app-deps": "electron-builder install-app-deps"
},
"private": true,
"dependencies": {
@ -41,7 +41,7 @@
"@ngrx/schematics": "^6.1.0",
"@ngrx/store": "^6.1.0",
"@ngrx/store-devtools": "^6.1.0",
"@overflow/core-js": "0.0.7",
"@overflow/core-js": "0.0.10",
"@overflow/rpc-js": "0.0.7",
"@types/fs-extra": "^5.0.4",
"@types/jasmine": "~2.8.6",

View File

@ -7,8 +7,8 @@ import {
JSONClientCodec
} from '@overflow/rpc-js';
import { Subscription } from 'rxjs';
import { TypeUtil, Class, Annotation, PropertyKeyType, Method, ReflectionUtil } from '@overflow/core-js';
import { RPCSubscriberDecoratorAttribute } from '@overflow/commons/ui/decorator/RPCSubscriber';
import { TypeUtil, Class, Annotation, PropertyKeyType, Method, ReflectionUtil, Decorator } from '@overflow/core-js';
import { RPCSubscriberDecoratorAttribute, RPCSubscriberDecorator } from '@overflow/commons/ui/decorator/RPCSubscriber';
export const requesterID = 'scannerUser';
@ -109,7 +109,7 @@ export class ProbeService extends Client {
const methods = clazz.getMethods();
methods.forEach((method, propertyKey) => {
const annon = method.getAnnotation<Annotation<RPCSubscriberDecoratorAttribute>>(Annotation);
const annon = method.getAnnotation(RPCSubscriberDecorator);
if (undefined === annon) {
return;
}

View File

@ -224,7 +224,13 @@
tree-kill "^1.0.0"
webpack-sources "^1.1.0"
"@overflow/core-js@0.0.7", "@overflow/core-js@^0.0.7":
"@overflow/core-js@0.0.10":
version "0.0.10"
resolved "https://nexus.loafle.net/repository/npm-all/@overflow/core-js/-/core-js-0.0.10.tgz#15c34aa99aad53ef01cfb1b050e2592392071819"
dependencies:
reflect-metadata "^0.1.12"
"@overflow/core-js@^0.0.7":
version "0.0.7"
resolved "https://nexus.loafle.net/repository/npm-all/@overflow/core-js/-/core-js-0.0.7.tgz#07463557b77d967a011d2f7f6a6f7ab5b2df9252"
dependencies: