@drincs/pixi-vn 1.3.36 → 1.4.0

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,4 +1,4 @@
1
- import { ChoiceInterface, CharacterInterface, GameStepState } from '@drincs/pixi-vn';
1
+ import { ChoiceInterface, StepLabelProps, StepLabelResult, CharacterInterface, GameStepState } from '@drincs/pixi-vn';
2
2
  import deepDiff from 'deep-diff';
3
3
  import { Difference } from 'microdiff';
4
4
  import { a as StorageElementType } from './StorageElementType-dAIVJeiw.js';
@@ -42,6 +42,30 @@ type StoredIndexedChoiceInterface = StoredChoiceInterface & {
42
42
  choiceIndex: number;
43
43
  };
44
44
 
45
+ /**
46
+ * Result of a {@link StepLabelType} execution.
47
+ *
48
+ * - `StepLabelResult`: a structured result consumed by the narration engine.
49
+ * - `void`: the step completed without returning an explicit result.
50
+ * - `string`: a simple token or message interpreted by higher-level logic.
51
+ *
52
+ * Prefer returning a well-typed {@link StepLabelResult} for anything that
53
+ * needs to be consumed programmatically. Use plain strings only where a
54
+ * lightweight, convention-based signal is sufficient and clearly documented
55
+ * by the surrounding game logic.
56
+ */
57
+ type StepLabelResultType = StepLabelResult | void | string;
58
+ type StepLabelPropsType<T extends {} = {}> = StepLabelProps & T;
59
+ /**
60
+ * StepLabel is a function that will be executed as the game continues.
61
+ */
62
+ type StepLabelType<T extends {} = {}> = (props: StepLabelPropsType<T>, info: {
63
+ /**
64
+ * The id of the label.
65
+ */
66
+ labelId: string;
67
+ }) => StepLabelResultType | Promise<StepLabelResultType>;
68
+
45
69
  interface DialogueInterface {
46
70
  /**
47
71
  * The text of the dialogue.
@@ -161,4 +185,4 @@ type HistoryChoiceMenuOption = {
161
185
  hidden: boolean;
162
186
  };
163
187
 
164
- export { type ChoiceOptionInterface as C, type DialogueInterface as D, type HistoryStep as H, type LabelIdType as L, type NarrationHistory as N, type OpenedLabel as O, type StoredIndexedChoiceInterface as S, type LabelRunModeType as a, type CloseChoiceOptionInterface as b, type CloseType as c, type StoredChoiceInterface as d, Close as e, type HistoryChoiceMenuOption as f };
188
+ export { type ChoiceOptionInterface as C, type DialogueInterface as D, type HistoryStep as H, type LabelIdType as L, type NarrationHistory as N, type OpenedLabel as O, type StepLabelType as S, type LabelRunModeType as a, type CloseChoiceOptionInterface as b, type CloseType as c, type StepLabelPropsType as d, type StepLabelResultType as e, type StoredIndexedChoiceInterface as f, type StoredChoiceInterface as g, Close as h, type HistoryChoiceMenuOption as i };
@@ -1,4 +1,4 @@
1
- import { ChoiceInterface, CharacterInterface, GameStepState } from '@drincs/pixi-vn';
1
+ import { ChoiceInterface, StepLabelProps, StepLabelResult, CharacterInterface, GameStepState } from '@drincs/pixi-vn';
2
2
  import deepDiff from 'deep-diff';
3
3
  import { Difference } from 'microdiff';
4
4
  import { a as StorageElementType } from './StorageElementType-dAIVJeiw.cjs';
@@ -42,6 +42,30 @@ type StoredIndexedChoiceInterface = StoredChoiceInterface & {
42
42
  choiceIndex: number;
43
43
  };
44
44
 
45
+ /**
46
+ * Result of a {@link StepLabelType} execution.
47
+ *
48
+ * - `StepLabelResult`: a structured result consumed by the narration engine.
49
+ * - `void`: the step completed without returning an explicit result.
50
+ * - `string`: a simple token or message interpreted by higher-level logic.
51
+ *
52
+ * Prefer returning a well-typed {@link StepLabelResult} for anything that
53
+ * needs to be consumed programmatically. Use plain strings only where a
54
+ * lightweight, convention-based signal is sufficient and clearly documented
55
+ * by the surrounding game logic.
56
+ */
57
+ type StepLabelResultType = StepLabelResult | void | string;
58
+ type StepLabelPropsType<T extends {} = {}> = StepLabelProps & T;
59
+ /**
60
+ * StepLabel is a function that will be executed as the game continues.
61
+ */
62
+ type StepLabelType<T extends {} = {}> = (props: StepLabelPropsType<T>, info: {
63
+ /**
64
+ * The id of the label.
65
+ */
66
+ labelId: string;
67
+ }) => StepLabelResultType | Promise<StepLabelResultType>;
68
+
45
69
  interface DialogueInterface {
46
70
  /**
47
71
  * The text of the dialogue.
@@ -161,4 +185,4 @@ type HistoryChoiceMenuOption = {
161
185
  hidden: boolean;
162
186
  };
163
187
 
164
- export { type ChoiceOptionInterface as C, type DialogueInterface as D, type HistoryStep as H, type LabelIdType as L, type NarrationHistory as N, type OpenedLabel as O, type StoredIndexedChoiceInterface as S, type LabelRunModeType as a, type CloseChoiceOptionInterface as b, type CloseType as c, type StoredChoiceInterface as d, Close as e, type HistoryChoiceMenuOption as f };
188
+ export { type ChoiceOptionInterface as C, type DialogueInterface as D, type HistoryStep as H, type LabelIdType as L, type NarrationHistory as N, type OpenedLabel as O, type StepLabelType as S, type LabelRunModeType as a, type CloseChoiceOptionInterface as b, type CloseType as c, type StepLabelPropsType as d, type StepLabelResultType as e, type StoredIndexedChoiceInterface as f, type StoredChoiceInterface as g, Close as h, type HistoryChoiceMenuOption as i };