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

@easy-page/core

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@easy-page/core - npm Package Compare versions

Comparing version 0.1.8 to 0.1.9

14

core/protocol/interface.d.ts

@@ -6,3 +6,3 @@ export interface Empty {

export type EffectDataType<PageState = Record<string, unknown>, PageProps = Empty> = Partial<PageProps extends undefined ? PageState extends undefined ? PageProps : PageState : PageState extends undefined ? PageProps : PageState & PageProps>;
export type Context<FieldType, PageState, PageProps = Empty> = DataContext<FieldType, PageState, PageProps> & {
export type Context<FieldType, PageState, PageProps = Empty, DefaultValues = Record<string, any>> = DataContext<FieldType, PageState, PageProps, DefaultValues> & {
effectedData: Partial<EffectDataType<PageState, PageProps>>;

@@ -12,7 +12,7 @@ /** whether is the first time to run action after component has mounted */

};
export type DataContext<FieldType, PageState, PageProps> = {
export type DataContext<FieldType, PageState, PageProps, DefaultValues = Record<string, any>> = {
pageState: Partial<PageState>;
pageProps: Partial<PageProps>;
value: FieldType;
defaultValues: Partial<PageState>;
defaultValues: Partial<DefaultValues>;
};

@@ -35,3 +35,3 @@ /** returns type of effect action */

}) => ValidateResult | Promise<ValidateResult>;
export type EffectActionHandlerType<FieldType, PageState = Record<string, unknown>, PageProps = Record<string, unknown>, EffectedResultType = unknown> = (context: Context<FieldType, PageState, PageProps>) => EffectActionResult<FieldType, EffectedResultType> | Promise<EffectActionResult<FieldType, EffectedResultType>>;
export type EffectActionHandlerType<FieldType, PageState = Record<string, unknown>, PageProps = Record<string, unknown>, EffectedResultType = unknown, DefaultValues = Record<string, any>> = (context: Context<FieldType, PageState, PageProps, DefaultValues>) => EffectActionResult<FieldType, EffectedResultType> | Promise<EffectActionResult<FieldType, EffectedResultType>>;
export type EffectKeys<PageState = Record<string, unknown>, PageProps = Record<string, unknown>> = PageState extends undefined ? PageProps extends undefined ? Array<keyof PageState> : Array<keyof PageProps> : PageProps extends undefined ? Array<keyof PageState> : Array<keyof PageState | keyof PageProps>;

@@ -62,3 +62,3 @@ export type BaseSchema = {

disableInitRun?: boolean;
show: (context: Context<FieldType, PageState, PageProps>) => boolean;
show: <DefaultValues = Record<string, unknown>>(context: Context<FieldType, PageState, PageProps, DefaultValues>) => boolean;
};

@@ -75,5 +75,5 @@ /** extends info */

/** before submit handle data */
postprocess?: (context: DataContext<FieldType, PageState, PageProps>) => Record<string, unknown>;
postprocess?: <DefaultValues = Record<string, any>>(context: DataContext<FieldType, PageState, PageProps, DefaultValues>) => Record<string, unknown>;
/** inject data in form */
preprocess?: <DefaultValues = Record<string, any>>(context: Pick<DataContext<FieldType, DefaultValues, PageProps>, 'defaultValues' | 'pageProps'>) => FieldType;
preprocess?: <DefaultValues = Record<string, any>>(context: Pick<DataContext<FieldType, PageState, PageProps, DefaultValues>, 'defaultValues' | 'pageProps'>) => FieldType;
/** when state or props changed, do something */

@@ -80,0 +80,0 @@ actions?: Array<EffectActionType<FieldType, PageState, PageProps, EffectedResultType>>;

{
"name": "@easy-page/core",
"version": "0.1.8",
"version": "0.1.9",
"dependencies": {},

@@ -5,0 +5,0 @@ "main": "./index.js",

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