concent-utils
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -49,8 +49,12 @@ /** | ||
export declare type ValidSetup = (ctx: ICtxBase) => IAnyObj | void; | ||
export declare type StepParam = ValidSetup | null; | ||
export declare function makeUseModelWithSetup<RootInfo, ModelDesc extends ModuleDesc>(moduleName: string): <Setup extends StepParam, CuDesc extends MultiComputed, P extends IAnyObj, Extra extends IAnyObj>(setup: Setup, opts?: Opts<CuDesc, P, Extra> | undefined) => IRefCtxM<RootInfo, P, ModelDesc, SettingsType<Setup>, ComputedValType<CuDesc>, Extra>; | ||
export declare type SetupParam = ValidSetup | null; | ||
/** | ||
* | ||
* @param moduleName | ||
*/ | ||
export declare function makeUseModelWithSetup<RootInfo, ModelDesc extends ModuleDesc>(moduleName: string): <Setup extends SetupParam, CuDesc extends MultiComputed, P extends IAnyObj, Extra extends IAnyObj>(setup: Setup, opts?: Opts<CuDesc, P, Extra> | undefined) => IRefCtxM<RootInfo, P, ModelDesc, SettingsType<Setup>, ComputedValType<CuDesc>, Extra>; | ||
/** | ||
* 函数型 cuSpec 需要用此函数来推导类型 | ||
* @param moduleName | ||
*/ | ||
export declare function makeUseModelWithSetupCuf<RootInfo, ModelDesc extends ModuleDesc>(moduleName: string): <Setup extends StepParam, CuDesc extends MultiComputedFn, P extends IAnyObj, Extra extends IAnyObj>(setup: Setup, opts?: CufOpts<CuDesc, P, Extra> | undefined) => IRefCtxM<RootInfo, P, ModelDesc, SettingsType<Setup>, ComputedValTypeForFn<CuDesc>, Extra>; | ||
export declare function makeUseModelWithSetupCuf<RootInfo, ModelDesc extends ModuleDesc>(moduleName: string): <Setup extends SetupParam, CuDesc extends MultiComputedFn, P extends IAnyObj, Extra extends IAnyObj>(setup: Setup, opts?: CufOpts<CuDesc, P, Extra> | undefined) => IRefCtxM<RootInfo, P, ModelDesc, SettingsType<Setup>, ComputedValTypeForFn<CuDesc>, Extra>; |
@@ -82,3 +82,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
var noop = function () { return ({}); }; | ||
/** | ||
* | ||
* @param moduleName | ||
*/ | ||
export function makeUseModelWithSetup(moduleName) { | ||
/** | ||
* function setup(ctx:CtrPre){ } | ||
* | ||
* useModelWithSetup(setup); | ||
* useModelWithSetup(setup, { extra, props, ceDesc }); | ||
*/ | ||
return function useModelWithSetup(setup, opts) { | ||
@@ -85,0 +95,0 @@ var _a = opts || {}, cuDesc = _a.cuDesc, props = _a.props, extra = _a.extra, _b = _a.passCuDesc, passCuDesc = _b === void 0 ? true : _b; |
@@ -21,3 +21,3 @@ { | ||
"@typescript-eslint/parser": "^4.7.0", | ||
"concent": "^2.13.3", | ||
"concent": "^2.13.10", | ||
"eslint": "^7.12.1", | ||
@@ -66,3 +66,3 @@ "eslint-config-prettier": "^6.15.0", | ||
}, | ||
"version": "1.1.0" | ||
"version": "1.1.1" | ||
} |
@@ -81,9 +81,20 @@ /** | ||
export type ValidSetup = (ctx: ICtxBase) => IAnyObj | void; | ||
export type StepParam = ValidSetup | null; | ||
export type SetupParam = ValidSetup | null; | ||
const noop = () => ({}); | ||
/** | ||
* | ||
* @param moduleName | ||
*/ | ||
export function makeUseModelWithSetup<RootInfo, ModelDesc extends ModuleDesc>(moduleName: string) { | ||
/** | ||
* function setup(ctx:CtrPre){ } | ||
* | ||
* useModelWithSetup(setup); | ||
* useModelWithSetup(setup, { extra, props, ceDesc }); | ||
*/ | ||
return function useModelWithSetup< | ||
Setup extends StepParam, CuDesc extends MultiComputed, P extends IAnyObj, Extra extends IAnyObj, | ||
Setup extends SetupParam, CuDesc extends MultiComputed, P extends IAnyObj, Extra extends IAnyObj, | ||
>(setup: Setup, opts?: Opts<CuDesc, P, Extra>) { | ||
@@ -106,3 +117,3 @@ const { cuDesc, props, extra, passCuDesc = true } = opts || {}; | ||
return function useModelWithSetupCuf< | ||
Setup extends StepParam, CuDesc extends MultiComputedFn, P extends IAnyObj, Extra extends IAnyObj, | ||
Setup extends SetupParam, CuDesc extends MultiComputedFn, P extends IAnyObj, Extra extends IAnyObj, | ||
>(setup: Setup, opts?: CufOpts<CuDesc, P, Extra>) { | ||
@@ -109,0 +120,0 @@ const { cuDesc, props, extra, passCuDesc = true } = opts || {}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19629
311