ing
This commit is contained in:
parent
69601984c2
commit
1fb44fdb5f
|
@ -20,7 +20,6 @@
|
|||
"stats": "set NODE_ENV=production && webpack --progress --config ./config/webpack/webpack.config.stats.js --profile --json > ./config/webpack/stats/stats.json"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/auth0-lock": "^10.16.2",
|
||||
"@types/history": "^4.6.2",
|
||||
"@types/jest": "^21.1.8",
|
||||
"@types/lodash": "^4.14.91",
|
||||
|
@ -74,7 +73,6 @@
|
|||
"webpack-visualizer-plugin": "^0.1.11"
|
||||
},
|
||||
"dependencies": {
|
||||
"auth0-lock": "^10.24.1",
|
||||
"history": "^4.7.2",
|
||||
"immutable": "^3.8.2",
|
||||
"inversify": "^4.9.0",
|
||||
|
|
|
@ -3,10 +3,8 @@ import {
|
|||
TypeUtil,
|
||||
} from '@overflow/commons/core/type';
|
||||
|
||||
import {
|
||||
AnnotatedElement,
|
||||
Annotation,
|
||||
} from '@overflow/commons/core/reflect';
|
||||
import {AnnotatedElement} from './annotated_element';
|
||||
import {Annotation} from './annotation';
|
||||
|
||||
export abstract class AccessibleObject implements AnnotatedElement {
|
||||
private _annotations: Map<ClassType, Annotation>;
|
||||
|
|
|
@ -2,9 +2,7 @@ import {
|
|||
ClassType,
|
||||
} from '@overflow/commons/core/type';
|
||||
|
||||
import {
|
||||
Annotation,
|
||||
} from '@overflow/commons/core/reflect';
|
||||
import {Annotation} from './annotation';
|
||||
|
||||
export interface AnnotatedElement {
|
||||
_addAnnotation<AnnotationType extends Annotation>(annotation: AnnotationType): void;
|
||||
|
|
|
@ -4,11 +4,10 @@ import {
|
|||
Metadata,
|
||||
} from '@overflow/commons/core/type';
|
||||
|
||||
import {
|
||||
AccessibleObject,
|
||||
Field,
|
||||
Method,
|
||||
} from '@overflow/commons/core/reflect';
|
||||
import {AccessibleObject} from './accessible_object';
|
||||
import {Constructor} from './constructor';
|
||||
import {Field} from './field';
|
||||
import {Method} from './method';
|
||||
|
||||
export class Class extends AccessibleObject {
|
||||
private _clazzType: ClassType;
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
// import {
|
||||
// PropertyKeyType,
|
||||
// } from '@overflow/commons/core/type';
|
||||
|
||||
// import {
|
||||
// Class,
|
||||
// Executable,
|
||||
// } from '@overflow/commons/core/reflect';
|
||||
|
||||
// export class Constructor extends Executable {
|
||||
|
||||
// public constructor(declaringClazz: Class, parameterTypes: any[]) {
|
||||
// super(declaringClazz, parameterTypes);
|
||||
// }
|
||||
|
||||
// public getName(): PropertyKeyType {
|
||||
// return '';
|
||||
// }
|
||||
// }
|
17
src/ts/@overflow/commons/core/reflect/constructor.ts
Normal file
17
src/ts/@overflow/commons/core/reflect/constructor.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
import {
|
||||
PropertyKeyType,
|
||||
} from '@overflow/commons/core/type';
|
||||
|
||||
import {Class} from './class';
|
||||
import {Executable} from './executable';
|
||||
|
||||
export class Constructor extends Executable {
|
||||
|
||||
public constructor(declaringClazz: Class, parameterTypes: any[]) {
|
||||
super(declaringClazz, parameterTypes);
|
||||
}
|
||||
|
||||
public getName(): PropertyKeyType {
|
||||
return '';
|
||||
}
|
||||
}
|
|
@ -2,12 +2,10 @@ import {
|
|||
PropertyKeyType,
|
||||
} from '@overflow/commons/core/type';
|
||||
|
||||
import {
|
||||
AccessibleObject,
|
||||
Class,
|
||||
Member,
|
||||
Parameter,
|
||||
} from '@overflow/commons/core/reflect';
|
||||
import {AccessibleObject} from './accessible_object';
|
||||
import {Class} from './class';
|
||||
import {Member} from './member';
|
||||
import {Parameter} from './parameter';
|
||||
|
||||
export abstract class Executable extends AccessibleObject implements Member {
|
||||
private _clazz: Class;
|
||||
|
|
|
@ -2,11 +2,9 @@ import {
|
|||
PropertyKeyType,
|
||||
} from '@overflow/commons/core/type';
|
||||
|
||||
import {
|
||||
AccessibleObject,
|
||||
Class,
|
||||
Member,
|
||||
} from '@overflow/commons/core/reflect';
|
||||
import {AccessibleObject} from './accessible_object';
|
||||
import {Class} from './class';
|
||||
import {Member} from './member';
|
||||
|
||||
export class Field extends AccessibleObject implements Member {
|
||||
private _clazz: Class;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
export * from './accessible_object';
|
||||
export * from './annotated_element';
|
||||
export * from './annotation';
|
||||
export * from './class_constructor';
|
||||
export * from './constructor';
|
||||
export * from './class';
|
||||
export * from './executable';
|
||||
export * from './field';
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
import {
|
||||
Class,
|
||||
} from '@overflow/commons/core/reflect';
|
||||
|
||||
import {
|
||||
PropertyKeyType,
|
||||
} from '@overflow/commons/core/type';
|
||||
|
||||
import {Class} from './class';
|
||||
|
||||
export interface Member {
|
||||
getDeclaringClass(): Class;
|
||||
getName(): PropertyKeyType;
|
||||
|
|
|
@ -2,10 +2,8 @@ import {
|
|||
PropertyKeyType,
|
||||
} from '@overflow/commons/core/type';
|
||||
|
||||
import {
|
||||
Class,
|
||||
Executable,
|
||||
} from '@overflow/commons/core/reflect';
|
||||
import {Class} from './class';
|
||||
import {Executable} from './executable';
|
||||
|
||||
export class Method extends Executable {
|
||||
private _name: PropertyKeyType;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import {
|
||||
AccessibleObject,
|
||||
Executable,
|
||||
} from '@overflow/commons/core/reflect';
|
||||
import {AccessibleObject} from './accessible_object';
|
||||
import {Executable} from './executable';
|
||||
|
||||
export class Parameter extends AccessibleObject {
|
||||
private _executable: Executable;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
export * from './action_mapping';
|
||||
export * from './parameter';
|
||||
export * from './reducer';
|
||||
export * from './rest_api';
|
||||
export * from './rpc_api';
|
||||
|
|
43
src/ts/@overflow/commons/redux/decorators/parameter.ts
Normal file
43
src/ts/@overflow/commons/redux/decorators/parameter.ts
Normal file
|
@ -0,0 +1,43 @@
|
|||
import {
|
||||
Annotation,
|
||||
} from '@overflow/commons/core/reflect';
|
||||
|
||||
import {
|
||||
PropertyKeyType,
|
||||
TypeUtil,
|
||||
} from '@overflow/commons/core/type';
|
||||
|
||||
import {
|
||||
Decorator,
|
||||
} from '@overflow/commons/decorator';
|
||||
|
||||
export interface ParameterAnnotationAttributes {
|
||||
name?: string;
|
||||
}
|
||||
|
||||
export class ParameterAnnotation implements Annotation {
|
||||
public readonly attributes: ParameterAnnotationAttributes;
|
||||
|
||||
public constructor(name: string | ParameterAnnotationAttributes) {
|
||||
if (undefined === name) {
|
||||
this.attributes = {
|
||||
name: '',
|
||||
};
|
||||
return;
|
||||
}
|
||||
|
||||
if (TypeUtil.isString(name)) {
|
||||
this.attributes = {
|
||||
name: <string>name,
|
||||
};
|
||||
} else {
|
||||
this.attributes = <ParameterAnnotationAttributes>name;
|
||||
}
|
||||
}
|
||||
|
||||
public parameterDecorator?(target: Object, propertyKey: PropertyKeyType, parameterIndex: number): void {
|
||||
console.log('Parameter');
|
||||
}
|
||||
}
|
||||
|
||||
export const Parameter = Decorator.create(ParameterAnnotation);
|
|
@ -1,5 +1,6 @@
|
|||
import {
|
||||
ActionMapping,
|
||||
Parameter,
|
||||
Reducer,
|
||||
RestAPI,
|
||||
} from '@overflow/commons/redux/decorators';
|
||||
|
@ -7,12 +8,17 @@ import {
|
|||
@Reducer()
|
||||
@ActionMapping('@overflow/modules/member/MemberReducer')
|
||||
export default class MemberReducer {
|
||||
private name: string;
|
||||
public constructor(@Parameter() name: string) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* signin
|
||||
*/
|
||||
@RestAPI('/account/signin')
|
||||
@ActionMapping('/signin')
|
||||
public signin(state: any, result: any, error: any): any {
|
||||
public signin(state: any, @Parameter() result: any, error: any): any {
|
||||
|
||||
return state;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user