@ez4/stateful
Advanced tools
Comparing version 0.0.0 to 0.1.0
import type { EntryState, EntryStates } from '../types/entry.js'; | ||
import type { StepState, StepHandlers } from '../types/step.js'; | ||
export declare const planSteps: <E extends EntryState>(newEntries: EntryStates<E> | undefined, oldEntries: EntryStates<E> | undefined, handlers: StepHandlers<E>) => StepState[]; | ||
export declare const planSteps: <E extends EntryState>(newEntries: EntryStates<E> | undefined, oldEntries: EntryStates<E> | undefined, handlers: StepHandlers<E>) => Promise<StepState[]>; |
@@ -0,1 +1,2 @@ | ||
import type { ObjectComparison } from '@ez4/utils'; | ||
import type { StepAction } from '../state/step.js'; | ||
@@ -10,2 +11,3 @@ import type { EntryState, TypedEntryState } from './entry.js'; | ||
order: number; | ||
preview?: ObjectComparison; | ||
}; | ||
@@ -39,5 +41,6 @@ /** | ||
* @param candidate Candidate entry. | ||
* @param context Action context. | ||
* @returns Must returns the resulting state of the create action. | ||
*/ | ||
create: (candidate: Readonly<E>, context: StepContext<E>) => unknown | undefined | Promise<unknown>; | ||
create: (candidate: Readonly<E>, context: StepContext<E>) => Record<string, any> | undefined | Promise<Record<string, any> | unknown>; | ||
/** | ||
@@ -47,15 +50,25 @@ * Handle entry replacement. | ||
* @param current Current entry. | ||
* @param context Action context. | ||
* @returns Must returns the resulting state of the replace action. | ||
*/ | ||
replace: (candidate: Readonly<E>, current: Readonly<E>, context: StepContext<E>) => unknown | undefined | Promise<unknown>; | ||
replace: (candidate: Readonly<E>, current: Readonly<E>, context: StepContext<E>) => Record<string, any> | undefined | Promise<Record<string, any> | undefined>; | ||
/** | ||
* Handle entry preview. | ||
* @param candidate Candidate entry. | ||
* @param current Current entry. | ||
* @returns Must returns the comparison object from the preview action. | ||
*/ | ||
preview: (candidate: Readonly<E>, current: Readonly<E>) => ObjectComparison | undefined | Promise<ObjectComparison | undefined>; | ||
/** | ||
* Handle entry updates. | ||
* @param candidate Candidate entry. | ||
* @param current Current entry. | ||
* @param context Action context. | ||
* @returns Must returns the resulting state of the update action. | ||
*/ | ||
update: (candidate: Readonly<E>, current: Readonly<E>, context: StepContext<E>) => unknown | undefined | Promise<unknown>; | ||
update: (candidate: Readonly<E>, current: Readonly<E>, context: StepContext<E>) => Record<string, any> | undefined | Promise<Record<string, any> | undefined>; | ||
/** | ||
* Handle entry deletion. | ||
* @param candidate Candidate entry. | ||
* @param context Action context. | ||
* @returns Must returns the resulting state of the delete action. | ||
@@ -62,0 +75,0 @@ */ |
{ | ||
"name": "@ez4/stateful", | ||
"description": "EZ4: Components to manage states with dependencies", | ||
"version": "0.0.0", | ||
"version": "0.1.0", | ||
"author": "Silas B.", | ||
@@ -24,5 +24,7 @@ "license": "MIT", | ||
"clean:registry": "rm -rf ../../.registry/@ez4/stateful", | ||
"prepublishOnly": "npm run clean && npm run build && npm run test", | ||
"publish": "npm publish --access public" | ||
"live:publish": "npm run test && npm publish --access public" | ||
}, | ||
"dependencies": { | ||
"@ez4/utils": "^0.1.0" | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
18690
284
1
+ Added@ez4/utils@^0.1.0
+ Added@ez4/utils@0.1.0(transitive)