Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

concent-utils

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

concent-utils - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

10

lib/index.d.ts

@@ -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 || {};

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc