simple-boot-core
Advanced tools
Comparing version 1.0.40 to 1.0.41
import 'reflect-metadata'; | ||
import { MetaDataPropertyAtomic } from '../MetaDataAtomic'; | ||
import { ConstructorType, ReflectMethod } from '../../types/Types'; | ||
declare type AOPOption = { | ||
type AOPOption = { | ||
type?: ConstructorType<any>; | ||
property: string; | ||
}; | ||
declare type AroundOption = { | ||
type AroundOption = { | ||
before?: (obj: any, propertyKey: string, args: any[]) => any[]; | ||
@@ -18,3 +18,3 @@ after?: (obj: any, propertyKey: string, args: any[], beforeReturn: any) => any[]; | ||
export declare const getAfters: (target: any) => MetaDataPropertyAtomic<any, AOPOption>[]; | ||
export declare const getProtoAfters: (target: any, propertyKey: string, type?: ConstructorType<any> | undefined) => MetaDataPropertyAtomic<any, AOPOption>[]; | ||
export declare const getProtoAfters: (target: any, propertyKey: string, type?: ConstructorType<any>) => MetaDataPropertyAtomic<any, AOPOption>[]; | ||
export declare const Before: (data: AOPOption) => { | ||
@@ -26,3 +26,3 @@ (target: Function): void; | ||
export declare const getBefores: (target: any) => MetaDataPropertyAtomic<any, AOPOption>[]; | ||
export declare const getProtoBefores: (target: any, propertyKey: string, type?: ConstructorType<any> | undefined) => MetaDataPropertyAtomic<any, AOPOption>[]; | ||
export declare const getProtoBefores: (target: any, propertyKey: string, type?: ConstructorType<any>) => MetaDataPropertyAtomic<any, AOPOption>[]; | ||
export declare class AroundForceReturn { | ||
@@ -29,0 +29,0 @@ value: any; |
@@ -7,7 +7,7 @@ import 'reflect-metadata'; | ||
} | ||
export declare type ExceptionHandlerConfig = { | ||
export type ExceptionHandlerConfig = { | ||
type?: ConstructorType<any>; | ||
throw?: boolean; | ||
}; | ||
export declare type SaveExceptionHandlerConfig = { | ||
export type SaveExceptionHandlerConfig = { | ||
propertyKey?: string | symbol; | ||
@@ -14,0 +14,0 @@ method: Function; |
@@ -7,3 +7,3 @@ import 'reflect-metadata'; | ||
} | ||
export declare type SituationType = string | InjectSituationType | ExceptionHandlerSituationType; | ||
export type SituationType = string | InjectSituationType | ExceptionHandlerSituationType; | ||
export declare class SituationTypeContainer { | ||
@@ -26,3 +26,3 @@ situationType: SituationType; | ||
} | ||
export declare type InjectConfig = { | ||
export type InjectConfig = { | ||
scheme?: string; | ||
@@ -37,3 +37,3 @@ type?: ConstructorType<any>; | ||
}; | ||
export declare type SaveInjectConfig = { | ||
export type SaveInjectConfig = { | ||
index: number; | ||
@@ -46,2 +46,2 @@ type?: ConstructorType<any>; | ||
export declare function Inject(config: InjectConfig): MethodParameter; | ||
export declare const getInject: (target: ConstructorType<any> | Function | any, propertyKey?: string | symbol | undefined) => SaveInjectConfig[]; | ||
export declare const getInject: (target: ConstructorType<any> | Function | any, propertyKey?: string | symbol) => SaveInjectConfig[]; |
import { ReflectMethod } from '../../types/Types'; | ||
export declare type InjectionConfig = {}; | ||
export type InjectionConfig = {}; | ||
export declare function Injection(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void; | ||
export declare function Injection(config?: InjectionConfig): ReflectMethod; | ||
export declare const getInjection: (target: any, propertyKey: string | symbol) => InjectionConfig | undefined; |
import { ReflectMethod, ConstructorType } from '../../types/Types'; | ||
declare type OnRouteOption = { | ||
type OnRouteOption = { | ||
isActivateMe?: boolean; | ||
@@ -4,0 +4,0 @@ }; |
import { ConstructorType, GenericClassDecorator, ReflectMethod } from '../../types/Types'; | ||
import { RouteFilter } from '../../route/RouteFilter'; | ||
export declare type Filterss = (RouteFilter | ConstructorType<RouteFilter>)[]; | ||
export declare type Filters = RouteFilter | ConstructorType<RouteFilter> | Filterss; | ||
export declare type RoteAndFilter = { | ||
export type Filterss = (RouteFilter | ConstructorType<RouteFilter>)[]; | ||
export type Filters = RouteFilter | ConstructorType<RouteFilter> | Filterss; | ||
export type RoteAndFilter = { | ||
filters: Filters; | ||
target: ConstructorType<Object>; | ||
}; | ||
export declare type RouteTargetMethod = { | ||
export type RouteTargetMethod = { | ||
target: ConstructorType<Object>; | ||
@@ -14,4 +14,4 @@ propertyKeys: (string | symbol)[]; | ||
}; | ||
export declare type RouteProperty = ConstructorType<Object> | RoteAndFilter | [ConstructorType<Object> | RoteAndFilter, any] | RouteTargetMethod | string; | ||
export declare type Route = { | ||
export type RouteProperty = ConstructorType<Object> | RoteAndFilter | [ConstructorType<Object> | RoteAndFilter, any] | RouteTargetMethod | string; | ||
export type Route = { | ||
[name: string]: RouteProperty; | ||
@@ -29,7 +29,7 @@ }; | ||
export declare const getRouter: (target: ConstructorType<any> | Function | any) => RouterConfig | undefined; | ||
declare type RouteConfig = { | ||
type RouteConfig = { | ||
path: string | string[]; | ||
filters?: Filters; | ||
}; | ||
export declare type SaveRouteConfig = { | ||
export type SaveRouteConfig = { | ||
propertyKey: string | symbol; | ||
@@ -36,0 +36,0 @@ method: Function; |
import { ConstructorType, MethodParameter, ReflectField } from '../../types/Types'; | ||
export declare const Valid: MethodParameter; | ||
export declare const getValidIndex: (target: ConstructorType<any> | Function | any, propertyKey?: string | symbol | undefined) => number[]; | ||
export declare type Validator = (value: any, ...params: any[]) => boolean; | ||
export declare type SaveValidator = { | ||
export declare const getValidIndex: (target: ConstructorType<any> | Function | any, propertyKey?: string | symbol) => number[]; | ||
export type Validator = (value: any, ...params: any[]) => boolean; | ||
export type SaveValidator = { | ||
propertyKey: string | symbol; | ||
@@ -15,3 +15,3 @@ validator: Validator; | ||
export declare const NotEmpty: Validator; | ||
export declare type ValidationResult = { | ||
export type ValidationResult = { | ||
name: string; | ||
@@ -18,0 +18,0 @@ valid: boolean; |
{ | ||
"name": "simple-boot-core", | ||
"version": "1.0.40", | ||
"version": "1.0.41", | ||
"main": "SimpleApplication.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -26,3 +26,3 @@ "use strict"; | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
while (g && (g = 0, op[0] && (_ = 0)), _) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
@@ -105,2 +105,5 @@ if (y = 0, t) op = [op[0] & 2, t.value]; | ||
} | ||
return [4, new Promise(function (r) { return setTimeout(r, 0); })]; | ||
case 1: | ||
_v.sent(); | ||
routers = []; | ||
@@ -110,36 +113,36 @@ routerAtomic = new SimAtomic_1.SimAtomic(this.rootRouter, this.simstanceManager); | ||
executeModule = this.getExecuteModule(routerAtomic, intent, routers); | ||
if (!(executeModule === null || executeModule === void 0 ? void 0 : executeModule.router)) return [3, 13]; | ||
if (!(executeModule === null || executeModule === void 0 ? void 0 : executeModule.router)) return [3, 14]; | ||
executeModule.routerChains = routers; | ||
if (!(((_a = executeModule.routerChains) === null || _a === void 0 ? void 0 : _a.length) && ((_b = executeModule.routerChains) === null || _b === void 0 ? void 0 : _b.length) > 0)) return [3, 4]; | ||
if (!(((_a = executeModule.routerChains) === null || _a === void 0 ? void 0 : _a.length) && ((_b = executeModule.routerChains) === null || _b === void 0 ? void 0 : _b.length) > 0)) return [3, 5]; | ||
i = 0; | ||
_v.label = 1; | ||
case 1: | ||
if (!(i < executeModule.routerChains.length)) return [3, 4]; | ||
_v.label = 2; | ||
case 2: | ||
if (!(i < executeModule.routerChains.length)) return [3, 5]; | ||
current = executeModule.routerChains[i]; | ||
next = executeModule.routerChains[i + 1]; | ||
value = current.value; | ||
if (!next) return [3, 3]; | ||
if (!next) return [3, 4]; | ||
return [4, ((_c = value === null || value === void 0 ? void 0 : value.canActivate) === null || _c === void 0 ? void 0 : _c.call(value, intent, (_d = next === null || next === void 0 ? void 0 : next.value) !== null && _d !== void 0 ? _d : null))]; | ||
case 2: | ||
case 3: | ||
_v.sent(); | ||
_v.label = 3; | ||
case 3: | ||
_v.label = 4; | ||
case 4: | ||
i++; | ||
return [3, 1]; | ||
case 4: | ||
return [3, 2]; | ||
case 5: | ||
this.activeRouterModule = executeModule; | ||
if (!!(executeModule === null || executeModule === void 0 ? void 0 : executeModule.module)) return [3, 6]; | ||
if (!!(executeModule === null || executeModule === void 0 ? void 0 : executeModule.module)) return [3, 7]; | ||
routerChain = executeModule.routerChains[executeModule.routerChains.length - 1]; | ||
return [4, ((_f = (_e = routerChain === null || routerChain === void 0 ? void 0 : routerChain.value) === null || _e === void 0 ? void 0 : _e.canActivate) === null || _f === void 0 ? void 0 : _f.call(_e, intent, executeModule.getModuleInstance()))]; | ||
case 5: | ||
case 6: | ||
_v.sent(); | ||
return [3, 8]; | ||
case 6: | ||
return [3, 9]; | ||
case 7: | ||
module_1 = null; | ||
module_1 = executeModule.getModuleInstance(); | ||
return [4, ((_j = (_h = (_g = executeModule.router) === null || _g === void 0 ? void 0 : _g.value) === null || _h === void 0 ? void 0 : _h.canActivate) === null || _j === void 0 ? void 0 : _j.call(_h, intent, module_1))]; | ||
case 7: | ||
case 8: | ||
_v.sent(); | ||
_v.label = 8; | ||
case 8: | ||
_v.label = 9; | ||
case 9: | ||
otherStorage = new Map(); | ||
@@ -186,20 +189,20 @@ otherStorage.set(Intent_1.Intent, intent); | ||
_i = 0, _t = Array.from(OnRoute_1.onRoutes); | ||
_v.label = 9; | ||
case 9: | ||
if (!(_i < _t.length)) return [3, 12]; | ||
_v.label = 10; | ||
case 10: | ||
if (!(_i < _t.length)) return [3, 13]; | ||
_u = _t[_i], key = _u[0], value = _u[1]; | ||
return [5, _loop_1(key, value)]; | ||
case 10: | ||
case 11: | ||
_v.sent(); | ||
_v.label = 11; | ||
case 11: | ||
_v.label = 12; | ||
case 12: | ||
_i++; | ||
return [3, 9]; | ||
case 12: return [2, this.activeRouterModule]; | ||
case 13: | ||
if (!(routers.length && routers.length > 0)) return [3, 17]; | ||
return [3, 10]; | ||
case 13: return [2, this.activeRouterModule]; | ||
case 14: | ||
if (!(routers.length && routers.length > 0)) return [3, 18]; | ||
i = 0; | ||
_v.label = 14; | ||
case 14: | ||
if (!(i < routers.length)) return [3, 17]; | ||
_v.label = 15; | ||
case 15: | ||
if (!(i < routers.length)) return [3, 18]; | ||
current = routers[i]; | ||
@@ -209,9 +212,9 @@ next = routers[i + 1]; | ||
return [4, ((_r = value === null || value === void 0 ? void 0 : value.canActivate) === null || _r === void 0 ? void 0 : _r.call(value, intent, (_s = next === null || next === void 0 ? void 0 : next.value) !== null && _s !== void 0 ? _s : null))]; | ||
case 15: | ||
case 16: | ||
_v.sent(); | ||
_v.label = 16; | ||
case 16: | ||
_v.label = 17; | ||
case 17: | ||
i++; | ||
return [3, 14]; | ||
case 17: | ||
return [3, 15]; | ||
case 18: | ||
routerModule = new RouterModule_1.RouterModule(this.simstanceManager, rootRouter, undefined, routers); | ||
@@ -218,0 +221,0 @@ this.activeRouterModule = routerModule; |
@@ -25,3 +25,3 @@ import 'reflect-metadata'; | ||
simAtomic<T>(type: ConstructorType<T>): SimAtomic<T>; | ||
getInstance<T>(type: ConstructorType<T>): T; | ||
getInstance<T>(type: ConstructorType<T>): NonNullable<T>; | ||
sim<T>(type: ConstructorType<T>): T | undefined; | ||
@@ -28,0 +28,0 @@ publishIntent(i: string, data?: any): any[]; |
@@ -7,3 +7,3 @@ import 'reflect-metadata'; | ||
import { SimOption } from '../SimOption'; | ||
export declare type FirstCheckMaker = (obj: { | ||
export type FirstCheckMaker = (obj: { | ||
target: Object; | ||
@@ -10,0 +10,0 @@ targetKey?: string | symbol; |
@@ -17,3 +17,3 @@ "use strict"; | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
while (g && (g = 0, op[0] && (_ = 0)), _) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
@@ -20,0 +20,0 @@ if (y = 0, t) op = [op[0] & 2, t.value]; |
export interface ConstructorType<T> { | ||
new (...args: any[]): T; | ||
} | ||
export declare type GenericClassDecorator<T> = (target: T) => void; | ||
export declare type ReflectField = (target: Object | { | ||
export type GenericClassDecorator<T> = (target: T) => void; | ||
export type ReflectField = (target: Object | { | ||
constructor: ConstructorType<any>; | ||
[key: string]: Function; | ||
}, propertyKey: string | symbol) => void; | ||
export declare type ReflectMethod = (target: any | ConstructorType<any> | { | ||
export type ReflectMethod = (target: any | ConstructorType<any> | { | ||
constructor: ConstructorType<any>; | ||
[key: string]: Function; | ||
}, propertyKey: string, descriptor: PropertyDescriptor) => any; | ||
export declare type MethodParameter = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void; | ||
export type MethodParameter = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void; |
2962
142829