2020-11-06 08:10:30 +00:00
|
|
|
/**
|
|
|
|
* @author Martin Karkowski
|
|
|
|
* @email m.karkowski@zema.de
|
|
|
|
* @create date 2020-11-06 08:52:45
|
2020-12-04 18:10:33 +00:00
|
|
|
* @modify date 2020-12-02 08:56:41
|
2020-11-06 08:10:30 +00:00
|
|
|
* @desc [description]
|
|
|
|
*/
|
|
|
|
|
2020-12-04 18:10:33 +00:00
|
|
|
import {
|
|
|
|
IFunctionOptions,
|
|
|
|
INopeModule,
|
|
|
|
IPropertyOptions
|
|
|
|
} from "../types/nope/nopeModule.interface";
|
2020-11-05 17:01:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Decorator, used to export the Method.
|
2020-12-04 18:10:33 +00:00
|
|
|
* @param options
|
2020-11-05 17:01:38 +00:00
|
|
|
*/
|
|
|
|
export function exportMethod(options: IFunctionOptions) {
|
2020-12-04 18:10:33 +00:00
|
|
|
return function (
|
|
|
|
target: INopeModule,
|
|
|
|
methodName: string,
|
|
|
|
descriptor: PropertyDescriptor
|
|
|
|
) {
|
|
|
|
target._markedElements = target._markedElements || [];
|
|
|
|
target._markedElements.push({
|
|
|
|
accessor: methodName,
|
|
|
|
options,
|
|
|
|
type: "method"
|
|
|
|
});
|
|
|
|
};
|
2020-11-05 17:01:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Decorator, will create a POST and GET api for the Parameter.
|
2020-12-04 18:10:33 +00:00
|
|
|
* @param options
|
2020-11-05 17:01:38 +00:00
|
|
|
*/
|
|
|
|
export function exportProperty(options: IPropertyOptions) {
|
2020-12-04 18:10:33 +00:00
|
|
|
return function (
|
|
|
|
target: INopeModule,
|
|
|
|
propertyKey: string,
|
|
|
|
descriptor: PropertyDescriptor
|
|
|
|
) {
|
|
|
|
target._markedElements = target._markedElements || [];
|
|
|
|
target._markedElements.push({
|
|
|
|
accessor: propertyKey,
|
|
|
|
options,
|
|
|
|
type: "prop"
|
|
|
|
});
|
|
|
|
};
|
|
|
|
}
|