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

View File

@ -12,7 +12,7 @@
"lint": "ng lint", "lint": "ng lint",
"e2e": "ng e2e", "e2e": "ng e2e",
"wait-on:build:main:dev": "wait-on http-get://localhost:4200/ && yarn build:main:dev", "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, "private": true,
"dependencies": { "dependencies": {
@ -41,7 +41,7 @@
"@ngrx/schematics": "^6.1.0", "@ngrx/schematics": "^6.1.0",
"@ngrx/store": "^6.1.0", "@ngrx/store": "^6.1.0",
"@ngrx/store-devtools": "^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", "@overflow/rpc-js": "0.0.7",
"@types/fs-extra": "^5.0.4", "@types/fs-extra": "^5.0.4",
"@types/jasmine": "~2.8.6", "@types/jasmine": "~2.8.6",

View File

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

View File

@ -224,7 +224,13 @@
tree-kill "^1.0.0" tree-kill "^1.0.0"
webpack-sources "^1.1.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" version "0.0.7"
resolved "https://nexus.loafle.net/repository/npm-all/@overflow/core-js/-/core-js-0.0.7.tgz#07463557b77d967a011d2f7f6a6f7ab5b2df9252" resolved "https://nexus.loafle.net/repository/npm-all/@overflow/core-js/-/core-js-0.0.7.tgz#07463557b77d967a011d2f7f6a6f7ab5b2df9252"
dependencies: dependencies: