@drincs/pixi-vn 0.5.0 → 0.5.2
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.
- package/dist/classes/CharacterBaseModel.js +6 -6
- package/dist/classes/CharacterBaseModel.js.map +1 -1
- package/dist/classes/CharacterBaseModel.mjs +6 -6
- package/dist/classes/CharacterBaseModel.mjs.map +1 -1
- package/dist/classes/ChoiceMenuOption.d.mts +17 -4
- package/dist/classes/ChoiceMenuOption.d.ts +17 -4
- package/dist/classes/ChoiceMenuOption.js +10 -1
- package/dist/classes/ChoiceMenuOption.js.map +1 -1
- package/dist/classes/ChoiceMenuOption.mjs +10 -1
- package/dist/classes/ChoiceMenuOption.mjs.map +1 -1
- package/dist/classes/StoredClassModel.js.map +1 -1
- package/dist/classes/StoredClassModel.mjs.map +1 -1
- package/dist/classes/index.js +6 -6
- package/dist/classes/index.js.map +1 -1
- package/dist/classes/index.mjs +6 -6
- package/dist/classes/index.mjs.map +1 -1
- package/dist/classes/ticker/TickerFadeAlpha.js.map +1 -1
- package/dist/classes/ticker/TickerFadeAlpha.mjs.map +1 -1
- package/dist/classes/ticker/TickerMove.js.map +1 -1
- package/dist/classes/ticker/TickerMove.mjs.map +1 -1
- package/dist/classes/ticker/TickerRotate.js.map +1 -1
- package/dist/classes/ticker/TickerRotate.mjs.map +1 -1
- package/dist/classes/ticker/index.js.map +1 -1
- package/dist/classes/ticker/index.mjs.map +1 -1
- package/dist/constants.d.mts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/constants.mjs.map +1 -1
- package/dist/functions/DialogueUtility.js +47 -17
- package/dist/functions/DialogueUtility.js.map +1 -1
- package/dist/functions/DialogueUtility.mjs +47 -17
- package/dist/functions/DialogueUtility.mjs.map +1 -1
- package/dist/functions/FlagsUtility.js.map +1 -1
- package/dist/functions/FlagsUtility.mjs.map +1 -1
- package/dist/functions/GameUtility.js.map +1 -1
- package/dist/functions/GameUtility.mjs.map +1 -1
- package/dist/functions/ImageUtility.js.map +1 -1
- package/dist/functions/ImageUtility.mjs.map +1 -1
- package/dist/functions/SavesUtility.js +25 -7
- package/dist/functions/SavesUtility.js.map +1 -1
- package/dist/functions/SavesUtility.mjs +25 -7
- package/dist/functions/SavesUtility.mjs.map +1 -1
- package/dist/functions/index.js +48 -18
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/index.mjs +48 -18
- package/dist/functions/index.mjs.map +1 -1
- package/dist/index.js +60 -30
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +60 -30
- package/dist/index.mjs.map +1 -1
- package/dist/interface/IDialogueHistory.d.mts +4 -4
- package/dist/interface/IDialogueHistory.d.ts +4 -4
- package/dist/interface/IHistoryStep.d.mts +2 -2
- package/dist/interface/IHistoryStep.d.ts +2 -2
- package/dist/managers/StepManager.d.mts +14 -0
- package/dist/managers/StepManager.d.ts +14 -0
- package/dist/managers/StepManager.js +18 -0
- package/dist/managers/StepManager.js.map +1 -1
- package/dist/managers/StepManager.mjs +18 -0
- package/dist/managers/StepManager.mjs.map +1 -1
- package/dist/managers/index.js +24 -6
- package/dist/managers/index.js.map +1 -1
- package/dist/managers/index.mjs +24 -6
- package/dist/managers/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Label from './Label.mjs';
|
|
2
2
|
import { CloseType } from '../types/CloseType.mjs';
|
|
3
3
|
import LabelRunModeType from '../types/LabelRunModeType.mjs';
|
|
4
|
-
import { StorageObjectType
|
|
4
|
+
import { StorageObjectType } from '../types/StorageElementType.mjs';
|
|
5
5
|
import { LabelIdType } from '../types/LabelIdType.mjs';
|
|
6
6
|
import '../types/StepLabelType.mjs';
|
|
7
7
|
import '@drincs/pixi-vn/dist/override';
|
|
@@ -56,19 +56,32 @@ declare class ChoiceMenuOptionClose {
|
|
|
56
56
|
* Text to be displayed in the menu
|
|
57
57
|
*/
|
|
58
58
|
text: string;
|
|
59
|
+
/**
|
|
60
|
+
* Type of the label to be opened
|
|
61
|
+
*/
|
|
62
|
+
type: CloseType;
|
|
63
|
+
/**
|
|
64
|
+
* Properties to be passed to the label
|
|
65
|
+
*/
|
|
66
|
+
props: StorageObjectType;
|
|
59
67
|
/**
|
|
60
68
|
* @param text Text to be displayed in the menu
|
|
61
69
|
*/
|
|
62
70
|
constructor(text: string);
|
|
63
71
|
}
|
|
64
|
-
type
|
|
72
|
+
type IStoratedChoiceMenuOption = {
|
|
65
73
|
text: string;
|
|
66
74
|
label: LabelIdType;
|
|
67
75
|
type: LabelRunModeType;
|
|
68
|
-
props:
|
|
76
|
+
props: StorageObjectType;
|
|
69
77
|
} | {
|
|
70
78
|
text: string;
|
|
71
79
|
type: CloseType;
|
|
72
80
|
};
|
|
81
|
+
type HistoryChoiceMenuOption = {
|
|
82
|
+
text: string;
|
|
83
|
+
type: CloseType | LabelRunModeType;
|
|
84
|
+
isMadeChoice: boolean;
|
|
85
|
+
};
|
|
73
86
|
|
|
74
|
-
export { ChoiceMenuOptionClose, type
|
|
87
|
+
export { ChoiceMenuOptionClose, type HistoryChoiceMenuOption, type IStoratedChoiceMenuOption, ChoiceMenuOption as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Label from './Label.js';
|
|
2
2
|
import { CloseType } from '../types/CloseType.js';
|
|
3
3
|
import LabelRunModeType from '../types/LabelRunModeType.js';
|
|
4
|
-
import { StorageObjectType
|
|
4
|
+
import { StorageObjectType } from '../types/StorageElementType.js';
|
|
5
5
|
import { LabelIdType } from '../types/LabelIdType.js';
|
|
6
6
|
import '../types/StepLabelType.js';
|
|
7
7
|
import '@drincs/pixi-vn/dist/override';
|
|
@@ -56,19 +56,32 @@ declare class ChoiceMenuOptionClose {
|
|
|
56
56
|
* Text to be displayed in the menu
|
|
57
57
|
*/
|
|
58
58
|
text: string;
|
|
59
|
+
/**
|
|
60
|
+
* Type of the label to be opened
|
|
61
|
+
*/
|
|
62
|
+
type: CloseType;
|
|
63
|
+
/**
|
|
64
|
+
* Properties to be passed to the label
|
|
65
|
+
*/
|
|
66
|
+
props: StorageObjectType;
|
|
59
67
|
/**
|
|
60
68
|
* @param text Text to be displayed in the menu
|
|
61
69
|
*/
|
|
62
70
|
constructor(text: string);
|
|
63
71
|
}
|
|
64
|
-
type
|
|
72
|
+
type IStoratedChoiceMenuOption = {
|
|
65
73
|
text: string;
|
|
66
74
|
label: LabelIdType;
|
|
67
75
|
type: LabelRunModeType;
|
|
68
|
-
props:
|
|
76
|
+
props: StorageObjectType;
|
|
69
77
|
} | {
|
|
70
78
|
text: string;
|
|
71
79
|
type: CloseType;
|
|
72
80
|
};
|
|
81
|
+
type HistoryChoiceMenuOption = {
|
|
82
|
+
text: string;
|
|
83
|
+
type: CloseType | LabelRunModeType;
|
|
84
|
+
isMadeChoice: boolean;
|
|
85
|
+
};
|
|
73
86
|
|
|
74
|
-
export { ChoiceMenuOptionClose, type
|
|
87
|
+
export { ChoiceMenuOptionClose, type HistoryChoiceMenuOption, type IStoratedChoiceMenuOption, ChoiceMenuOption as default };
|
|
@@ -4,7 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
require('crypto-js/sha1');
|
|
6
6
|
|
|
7
|
-
// src/
|
|
7
|
+
// src/types/CloseType.ts
|
|
8
|
+
var Close = "close";
|
|
8
9
|
function checkIfStepsIsEqual(step1, step2) {
|
|
9
10
|
return step1 === step2;
|
|
10
11
|
}
|
|
@@ -72,6 +73,14 @@ var ChoiceMenuOptionClose = class {
|
|
|
72
73
|
* Label to be opened when the option is selected
|
|
73
74
|
*/
|
|
74
75
|
this.label = new CloseLabel();
|
|
76
|
+
/**
|
|
77
|
+
* Type of the label to be opened
|
|
78
|
+
*/
|
|
79
|
+
this.type = Close;
|
|
80
|
+
/**
|
|
81
|
+
* Properties to be passed to the label
|
|
82
|
+
*/
|
|
83
|
+
this.props = {};
|
|
75
84
|
this.text = text;
|
|
76
85
|
}
|
|
77
86
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/functions/StepLabelUtility.ts","../../src/classes/Label.ts","../../src/classes/CloseLabel.ts","../../src/classes/ChoiceMenuOption.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../../src/types/CloseType.ts","../../src/functions/StepLabelUtility.ts","../../src/classes/Label.ts","../../src/classes/CloseLabel.ts","../../src/classes/ChoiceMenuOption.ts"],"names":[],"mappings":";AACO,IAAM,QAAmB;;;ACDhC,OAAO,UAAU;AAmBV,SAAS,oBAAoB,OAAiD,OAA0D;AAC3I,SAAO,UAAU;AACrB;;;ACSA,IAAqB,QAArB,MAA6D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMzD,IAAW,QAA4B;AAAE,UAAM,IAAI,MAAM,qDAAqD;AAAA,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMzG,4BAA4B,eAAgE;AAC/F,QAAI,cAAc,WAAW,GAAG;AAC5B,aAAO;AAAA,IACX;AACA,QAAI,MAAc;AAClB,kBAAc,QAAQ,CAAC,MAAM,UAAU;AACnC,UAAI,oBAAoB,MAAM,KAAK,MAAM,KAAK,CAAC,GAAG;AAC9C,cAAM;AAAA,MACV;AAAA,IACJ,CAAC;AACD,WAAO;AAAA,EACX;AAEJ;;;ACrDA,IAAqB,aAArB,cAAwC,MAAM;AAAE;;;ACUhD,IAAqB,mBAArB,MAAmE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAuB/D,YAAY,MAAc,OAAwB,OAAyB,QAAQ,OAAW;AAP9F;AAAA;AAAA;AAAA,iBAA2B,CAAC;AAQxB,SAAK,OAAO;AACZ,SAAK,QAAQ,IAAI,MAAM;AACvB,SAAK,OAAO;AACZ,QAAI,OAAO;AACP,WAAK,QAAQ;AAAA,IACjB;AAAA,EACJ;AACJ;AAUO,IAAM,wBAAN,MAA4B;AAAA;AAAA;AAAA;AAAA,EAoB/B,YAAY,MAAc;AAhB1B;AAAA;AAAA;AAAA,iBAAe,IAAI,WAAW;AAQ9B;AAAA;AAAA;AAAA,gBAAkB;AAIlB;AAAA;AAAA;AAAA,iBAA2B,CAAC;AAKxB,SAAK,OAAO;AAAA,EAChB;AACJ","sourcesContent":["export type CloseType = \"close\"\nexport const Close: CloseType = \"close\"","import sha1 from 'crypto-js/sha1';\nimport { StepHistoryDataType } from \"../types/StepHistoryDataType\";\nimport { StepLabelType } from \"../types/StepLabelType\";\n\n/**\n * Convert StepLabel to StepHistoryData\n * @param step\n * @returns\n */\nexport function getStepSha1(step: StepLabelType): StepHistoryDataType {\n let sha1String = sha1(step.toString().toLocaleLowerCase())\n return sha1String.toString()\n}\n/**\n * Check if two steps are equal\n * @param step1\n * @param step2\n * @returns\n */\nexport function checkIfStepsIsEqual(step1: StepHistoryDataType | StepLabelType<any>, step2: StepHistoryDataType | StepLabelType<any>): boolean {\n return step1 === step2\n}\n","import { checkIfStepsIsEqual } from \"../functions/StepLabelUtility\"\nimport { StorageObjectType } from \"../types\"\nimport { StepHistoryDataType } from \"../types/StepHistoryDataType\"\nimport { StepLabelType } from \"../types/StepLabelType\"\n\n/**\n * Label is a class that contains a list of steps, which will be performed as the game continues.\n * You must use the labelDecorator to register the label in the game.\n * For Ren'py this is the equivalent of a label.\n * @example\n * ```typescript\n * \\@labelDecorator() // this is equivalent to labelDecorator(\"StartLabel\")\n * export class StartLabel extends Label {\n * override get steps(): StepLabelType[] {\n * return [\n * () => {\n * GameWindowManager.clear()\n * setDialogue({ character: liam, text: \"Which test do you want to perform?\" })\n * setChoiceMenuOptions([\n * new ChoiceMenuOption(\"Events Test\", EventsTestLabel),\n * new ChoiceMenuOption(\"Show Image Test\", ShowImageTest),\n * ])\n * },\n * () => GameStepManager.jumpLabel(StartLabel),\n * ]\n * }\n * }\n * GameStepManager.callLabel(StartLabel)\n * ```\n */\nexport default class Label<T extends StorageObjectType = {}> {\n /**\n * Get the steps of the label.\n * This class should be extended and the steps method should be overridden.\n * Every time you update this list will also be updated when the other game versions load.\n */\n public get steps(): StepLabelType<T>[] { throw new Error(\"[Pixi'VN] The method Label.steps must be overridden\") }\n /**\n * Get the corresponding steps number\n * @param externalSteps\n * @returns Numer of corresponding steps, for example, if externalSteps is [ABC, DEF, GHI] and the steps of the label is [ABC, GHT], the result will be 1\n */\n public getCorrespondingStepsNumber(externalSteps: StepHistoryDataType[] | StepLabelType[]): number {\n if (externalSteps.length === 0) {\n return 0\n }\n let res: number = 0\n externalSteps.forEach((step, index) => {\n if (checkIfStepsIsEqual(step, this.steps[index])) {\n res = index\n }\n })\n return res\n }\n choiseIndex?: number\n}\n","import Label from \"./Label\"\n\nexport default class CloseLabel extends Label { }\n","import { Close, CloseType, LabelRunModeType, StorageObjectType } from \"../types\"\nimport { LabelIdType } from \"../types/LabelIdType\"\nimport CloseLabel from \"./CloseLabel\"\nimport Label from \"./Label\"\n\n/**\n * ChoiceMenuOption is a class that contains a Label and a text that will be displayed in the menu.\n * @example\n * ```typescript\n * new ChoiceMenuOption(\"Events Test\", EventsTestLabel)\n * ```\n */\nexport default class ChoiceMenuOption<T extends StorageObjectType> {\n /**\n * Text to be displayed in the menu\n */\n text: string\n /**\n * Label to be opened when the option is selected\n */\n label: Label<T>\n /**\n * Type of the label to be opened\n */\n type: LabelRunModeType\n /**\n * Properties to be passed to the label\n */\n props: StorageObjectType = {}\n /**\n * @param text Text to be displayed in the menu\n * @param label Label to be opened when the option is selected\n * @param type Type of the label to be opened\n * @param props Properties to be passed to the label, when the label is called. it cannot contain functions or classes.\n */\n constructor(text: string, label: typeof Label<T>, type: LabelRunModeType = \"call\", props?: T) {\n this.text = text\n this.label = new label()\n this.type = type\n if (props) {\n this.props = props\n }\n }\n}\n\n/**\n * ChoiceMenuOptionClose is a class that contains a text that will be displayed in the menu.\n * It is used to close the menu.\n * @example\n * ```typescript\n * new ChoiceMenuOptionClose(\"Return\")\n * ```\n */\nexport class ChoiceMenuOptionClose {\n /**\n * Label to be opened when the option is selected\n */\n label: Label = new CloseLabel()\n /**\n * Text to be displayed in the menu\n */\n text: string\n /**\n * Type of the label to be opened\n */\n type: CloseType = Close\n /**\n * Properties to be passed to the label\n */\n props: StorageObjectType = {}\n /**\n * @param text Text to be displayed in the menu\n */\n constructor(text: string) {\n this.text = text\n }\n}\n\nexport type IStoratedChoiceMenuOption = {\n text: string\n label: LabelIdType\n type: LabelRunModeType\n props: StorageObjectType\n} | {\n text: string\n type: CloseType\n}\n\nexport type HistoryChoiceMenuOption = {\n text: string\n type: CloseType | LabelRunModeType\n isMadeChoice: boolean\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import 'crypto-js/sha1';
|
|
2
2
|
|
|
3
|
-
// src/
|
|
3
|
+
// src/types/CloseType.ts
|
|
4
|
+
var Close = "close";
|
|
4
5
|
function checkIfStepsIsEqual(step1, step2) {
|
|
5
6
|
return step1 === step2;
|
|
6
7
|
}
|
|
@@ -68,6 +69,14 @@ var ChoiceMenuOptionClose = class {
|
|
|
68
69
|
* Label to be opened when the option is selected
|
|
69
70
|
*/
|
|
70
71
|
this.label = new CloseLabel();
|
|
72
|
+
/**
|
|
73
|
+
* Type of the label to be opened
|
|
74
|
+
*/
|
|
75
|
+
this.type = Close;
|
|
76
|
+
/**
|
|
77
|
+
* Properties to be passed to the label
|
|
78
|
+
*/
|
|
79
|
+
this.props = {};
|
|
71
80
|
this.text = text;
|
|
72
81
|
}
|
|
73
82
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/functions/StepLabelUtility.ts","../../src/classes/Label.ts","../../src/classes/CloseLabel.ts","../../src/classes/ChoiceMenuOption.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../../src/types/CloseType.ts","../../src/functions/StepLabelUtility.ts","../../src/classes/Label.ts","../../src/classes/CloseLabel.ts","../../src/classes/ChoiceMenuOption.ts"],"names":[],"mappings":";AACO,IAAM,QAAmB;;;ACDhC,OAAO,UAAU;AAmBV,SAAS,oBAAoB,OAAiD,OAA0D;AAC3I,SAAO,UAAU;AACrB;;;ACSA,IAAqB,QAArB,MAA6D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMzD,IAAW,QAA4B;AAAE,UAAM,IAAI,MAAM,qDAAqD;AAAA,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMzG,4BAA4B,eAAgE;AAC/F,QAAI,cAAc,WAAW,GAAG;AAC5B,aAAO;AAAA,IACX;AACA,QAAI,MAAc;AAClB,kBAAc,QAAQ,CAAC,MAAM,UAAU;AACnC,UAAI,oBAAoB,MAAM,KAAK,MAAM,KAAK,CAAC,GAAG;AAC9C,cAAM;AAAA,MACV;AAAA,IACJ,CAAC;AACD,WAAO;AAAA,EACX;AAEJ;;;ACrDA,IAAqB,aAArB,cAAwC,MAAM;AAAE;;;ACUhD,IAAqB,mBAArB,MAAmE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAuB/D,YAAY,MAAc,OAAwB,OAAyB,QAAQ,OAAW;AAP9F;AAAA;AAAA;AAAA,iBAA2B,CAAC;AAQxB,SAAK,OAAO;AACZ,SAAK,QAAQ,IAAI,MAAM;AACvB,SAAK,OAAO;AACZ,QAAI,OAAO;AACP,WAAK,QAAQ;AAAA,IACjB;AAAA,EACJ;AACJ;AAUO,IAAM,wBAAN,MAA4B;AAAA;AAAA;AAAA;AAAA,EAoB/B,YAAY,MAAc;AAhB1B;AAAA;AAAA;AAAA,iBAAe,IAAI,WAAW;AAQ9B;AAAA;AAAA;AAAA,gBAAkB;AAIlB;AAAA;AAAA;AAAA,iBAA2B,CAAC;AAKxB,SAAK,OAAO;AAAA,EAChB;AACJ","sourcesContent":["export type CloseType = \"close\"\nexport const Close: CloseType = \"close\"","import sha1 from 'crypto-js/sha1';\nimport { StepHistoryDataType } from \"../types/StepHistoryDataType\";\nimport { StepLabelType } from \"../types/StepLabelType\";\n\n/**\n * Convert StepLabel to StepHistoryData\n * @param step\n * @returns\n */\nexport function getStepSha1(step: StepLabelType): StepHistoryDataType {\n let sha1String = sha1(step.toString().toLocaleLowerCase())\n return sha1String.toString()\n}\n/**\n * Check if two steps are equal\n * @param step1\n * @param step2\n * @returns\n */\nexport function checkIfStepsIsEqual(step1: StepHistoryDataType | StepLabelType<any>, step2: StepHistoryDataType | StepLabelType<any>): boolean {\n return step1 === step2\n}\n","import { checkIfStepsIsEqual } from \"../functions/StepLabelUtility\"\nimport { StorageObjectType } from \"../types\"\nimport { StepHistoryDataType } from \"../types/StepHistoryDataType\"\nimport { StepLabelType } from \"../types/StepLabelType\"\n\n/**\n * Label is a class that contains a list of steps, which will be performed as the game continues.\n * You must use the labelDecorator to register the label in the game.\n * For Ren'py this is the equivalent of a label.\n * @example\n * ```typescript\n * \\@labelDecorator() // this is equivalent to labelDecorator(\"StartLabel\")\n * export class StartLabel extends Label {\n * override get steps(): StepLabelType[] {\n * return [\n * () => {\n * GameWindowManager.clear()\n * setDialogue({ character: liam, text: \"Which test do you want to perform?\" })\n * setChoiceMenuOptions([\n * new ChoiceMenuOption(\"Events Test\", EventsTestLabel),\n * new ChoiceMenuOption(\"Show Image Test\", ShowImageTest),\n * ])\n * },\n * () => GameStepManager.jumpLabel(StartLabel),\n * ]\n * }\n * }\n * GameStepManager.callLabel(StartLabel)\n * ```\n */\nexport default class Label<T extends StorageObjectType = {}> {\n /**\n * Get the steps of the label.\n * This class should be extended and the steps method should be overridden.\n * Every time you update this list will also be updated when the other game versions load.\n */\n public get steps(): StepLabelType<T>[] { throw new Error(\"[Pixi'VN] The method Label.steps must be overridden\") }\n /**\n * Get the corresponding steps number\n * @param externalSteps\n * @returns Numer of corresponding steps, for example, if externalSteps is [ABC, DEF, GHI] and the steps of the label is [ABC, GHT], the result will be 1\n */\n public getCorrespondingStepsNumber(externalSteps: StepHistoryDataType[] | StepLabelType[]): number {\n if (externalSteps.length === 0) {\n return 0\n }\n let res: number = 0\n externalSteps.forEach((step, index) => {\n if (checkIfStepsIsEqual(step, this.steps[index])) {\n res = index\n }\n })\n return res\n }\n choiseIndex?: number\n}\n","import Label from \"./Label\"\n\nexport default class CloseLabel extends Label { }\n","import { Close, CloseType, LabelRunModeType, StorageObjectType } from \"../types\"\nimport { LabelIdType } from \"../types/LabelIdType\"\nimport CloseLabel from \"./CloseLabel\"\nimport Label from \"./Label\"\n\n/**\n * ChoiceMenuOption is a class that contains a Label and a text that will be displayed in the menu.\n * @example\n * ```typescript\n * new ChoiceMenuOption(\"Events Test\", EventsTestLabel)\n * ```\n */\nexport default class ChoiceMenuOption<T extends StorageObjectType> {\n /**\n * Text to be displayed in the menu\n */\n text: string\n /**\n * Label to be opened when the option is selected\n */\n label: Label<T>\n /**\n * Type of the label to be opened\n */\n type: LabelRunModeType\n /**\n * Properties to be passed to the label\n */\n props: StorageObjectType = {}\n /**\n * @param text Text to be displayed in the menu\n * @param label Label to be opened when the option is selected\n * @param type Type of the label to be opened\n * @param props Properties to be passed to the label, when the label is called. it cannot contain functions or classes.\n */\n constructor(text: string, label: typeof Label<T>, type: LabelRunModeType = \"call\", props?: T) {\n this.text = text\n this.label = new label()\n this.type = type\n if (props) {\n this.props = props\n }\n }\n}\n\n/**\n * ChoiceMenuOptionClose is a class that contains a text that will be displayed in the menu.\n * It is used to close the menu.\n * @example\n * ```typescript\n * new ChoiceMenuOptionClose(\"Return\")\n * ```\n */\nexport class ChoiceMenuOptionClose {\n /**\n * Label to be opened when the option is selected\n */\n label: Label = new CloseLabel()\n /**\n * Text to be displayed in the menu\n */\n text: string\n /**\n * Type of the label to be opened\n */\n type: CloseType = Close\n /**\n * Properties to be passed to the label\n */\n props: StorageObjectType = {}\n /**\n * @param text Text to be displayed in the menu\n */\n constructor(text: string) {\n this.text = text\n }\n}\n\nexport type IStoratedChoiceMenuOption = {\n text: string\n label: LabelIdType\n type: LabelRunModeType\n props: StorageObjectType\n} | {\n text: string\n type: CloseType\n}\n\nexport type HistoryChoiceMenuOption = {\n text: string\n type: CloseType | LabelRunModeType\n isMadeChoice: boolean\n}\n"]}
|