cogfy-data-exchange 1.0.21 → 1.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
1
  import type { FlowJson } from './flow-json';
2
2
  import type { NextScreens } from './routing';
3
3
  import type { ScreenData, ScreenName } from './screen';
4
- type ScreenErrorResult<S extends string> = {
4
+ type ScreenSelfResult<F extends FlowJson, S extends ScreenName<F>> = {
5
5
  screen: S;
6
- data: {
6
+ data: ScreenData<F, S> | {
7
7
  error_message: string;
8
8
  };
9
9
  };
@@ -22,5 +22,5 @@ export type NextResult<F extends FlowJson, S extends ScreenName<F>> = {
22
22
  screen: K;
23
23
  data: ScreenData<F, K>;
24
24
  };
25
- }[NextScreens<F, S>] | ScreenErrorResult<S> | FlowSuccessResult;
25
+ }[NextScreens<F, S>] | ScreenSelfResult<F, S> | FlowSuccessResult;
26
26
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cogfy-data-exchange",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -2,11 +2,9 @@ import type { FlowJson } from './flow-json'
2
2
  import type { NextScreens } from './routing'
3
3
  import type { ScreenData, ScreenName } from './screen'
4
4
 
5
- type ScreenErrorResult<S extends string> = {
5
+ type ScreenSelfResult<F extends FlowJson, S extends ScreenName<F>> = {
6
6
  screen: S
7
- data: {
8
- error_message: string
9
- }
7
+ data: ScreenData<F, S> | { error_message: string }
10
8
  }
11
9
 
12
10
  type FlowSuccessResult = {
@@ -25,5 +23,5 @@ export type NextResult<F extends FlowJson, S extends ScreenName<F>> =
25
23
  data: ScreenData<F, K>
26
24
  }
27
25
  }[NextScreens<F, S>]
28
- | ScreenErrorResult<S>
26
+ | ScreenSelfResult<F, S>
29
27
  | FlowSuccessResult