export * from '@drincs/nqtr/handlers'; import * as registries from '@drincs/nqtr/registries'; export { RegisteredActivities, RegisteredCommitments, RegisteredLocations, RegisteredMaps, RegisteredQuests, RegisteredRooms } from '@drincs/nqtr/registries'; import { OnRunProps as OnRunProps$1, ActivityInterface as ActivityInterface$1, CommitmentInterface as CommitmentInterface$1, LocationInterface as LocationInterface$1, MapInterface as MapInterface$1, RoomInterface as RoomInterface$1, QuestInterface as QuestInterface$1, StageInterface as StageInterface$1 } from '@drincs/nqtr'; import { StoredClassModel } from '@drincs/pixi-vn/storage'; import { CharacterInterface } from '@drincs/pixi-vn'; interface DateSchedulingInterface { /** * The start date. If the item hasn't started yet, it will be hidden. * If you set it to 3, the item will be hidden on dates 1 and 2 and will be shown starting on date 3. */ from: number; /** * The date when the item ends. If the item is ended yet, it will be deleted or hidden. * If you set { from: 0, to: 3 }, the item will be shown into dates 1 and 2 and will be deleted or hidden from date 3. * @default undefined */ to?: number; } interface TimeSchedulingInterface { /** * The time when the item starts. If the item is not started yet, it will be hidden. * If you set 3, the item will be hidden into times 1 and 2, and will be shown from time 3. */ from: number; /** * The time when the item ends. If the item is ended yet, it will be hidden. * If you set 3, the item will be shown into times 1 and 2 and will be hidden from time 3. * @default timeTracker.dayEndTime + 1 */ to?: number; } interface ActiveScheduling { /** * Time slot in which activity/commitment will be active. */ readonly timeSlot?: TimeSchedulingInterface[] | TimeSchedulingInterface; /** * Used to schedule what date it will be added and removed. */ readonly dateScheduling?: DateSchedulingInterface; } type ExecutionType = "automatic" | "interaction"; type OnRunProps = OnRunProps$1; /** * The function that is called when the class is runned. */ type OnRunEvent = (item: T, props: OnRunProps) => any | Promise; type OnRunFunction = (props: OnRunProps) => any | Promise; type OnRunAsyncFunction = (props: OnRunProps) => Promise; type QuestsRequiredType = { quest: QuestInterface; stageNumber: number; }; type TimeSlotInterface = { name: string; startTime: number; }; /** * Time Settings, which can be set using {@link timeTracker.editSettings} */ type TimeSettings = { /** * Minimum time of the day * @default 0 */ dayStartTime?: number; /** * Maximum time of the day * @default 24 */ dayEndTime?: number; /** * Default time spent * @default 1 */ defaultTimeSpent?: number; /** * Time slots * @default [] * @example * ```ts * [ * { name: 'Morning', startTime: 5 }, * { name: 'Afternoon', startTime: 12 }, * { name: 'Evening', startTime: 18 }, * { name: 'Night', startTime: 22 } * ] */ timeSlots?: TimeSlotInterface[]; /** * Week length * @default 7 */ weekLength?: number; /** * Weekend start day. For example, if the real life weekend starts on Saturday, then the value should be 6 * @default weekLength - 1 */ weekendStartDay?: number; /** * Week days name * @param weekDayNumber The current week day number (from: 0 - to: {@link weekLength} - 1). * @returns The name of the week day. * @example * ```ts * (weekDayNumber: number) => { * const weekDaysNames = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']; * return weekDaysNames[weekDayNumber]; * } * ``` */ getDayName?: (weekDayNumber: number) => string; }; interface ActivityInterface extends ActivityBaseInternalInterface, ActivityInterface$1 { } interface ActivityBaseInternalInterface extends ActiveScheduling { /** * The id of the activity/commitment. */ readonly id: string; /** * The function that is called when the activity/commitment is runned. */ readonly run: OnRunAsyncFunction; /** * Whether the activity/commitment is a deadline, so it will then be removed or hidden. * * It **depends only on the date**, not the time. So if you set { dateScheduling: { from: 0, to: 3 }, timeSlot { from: 10, to: 20 } } the activity/commitment hidden or deleted on date 3 at 0. */ readonly expired: boolean; /** * Whether the activity/commitment is active, so it will be shown in the routine and can be runned. * @param options The options to check if the activity/commitment is active. */ isActive(options?: ActiveScheduling): boolean; } interface ActivityProps { /** * The name * @default "" */ name?: string; /** * Time slot in which activity/commitment will be active. */ timeSlot?: TimeSchedulingInterface; /** * Used to schedule what date it will be added and removed. */ dateScheduling?: DateSchedulingInterface; /** * Whether is disabled. You can also pass a Pixi'VN flag name. * @default false */ disabled?: boolean | string; /** * Whether is hidden. You can also pass a Pixi'VN flag name. * @default false */ hidden?: boolean | string; /** * The icon of the activity. * @default undefined */ renderIcon?: string; } interface CommitmentInterface extends CommitmentBaseInternalInterface, CommitmentInterface$1 { } interface CommitmentBaseInternalInterface extends ActivityBaseInternalInterface { /** * The character or characters that are in the commitment and so in the room. */ readonly characters: CharacterInterface[]; /** * Execution type. If is "automatic" the onRun() runned automatically when the palayer is in the room. If is "interaction" the player must interact with the character to run the onRun() function. * If you set "automatic" remember to remove the commitment when it is no longer needed, because otherwise it repeats itself every time. */ executionType: ExecutionType; /** * The priority. The higher the number, the higher the priority. * To ensure that a character is not in 2 places at the same time, if there are 2 or more valid commits at the same time and with the same character, the one with the highest priority will be chosen. */ priority: number; } interface CommitmentInfo { commitment: CommitmentInterface; roomId: string; } interface CommitmentProps { /** * The name * @default "" */ name?: string; /** * Time slot in which activity/commitment will be active. */ readonly timeSlot?: TimeSchedulingInterface | undefined; /** * Used to schedule what date it will be added and removed. */ readonly dateScheduling?: DateSchedulingInterface | undefined; /** * The image ofthe Commitment. */ image?: string; /** * Execution type. If is "automatic" the onRun() runned automatically when the palayer is in the room. If is "interaction" the player must interact with the character to run the onRun() function. * If you set "automatic" remember to remove the commitment when it is no longer needed, because otherwise it repeats itself every time. * @default "interaction" */ executionType?: ExecutionType; /** * Is a function that is called when the player interacts with the character. * @param commitment * @returns * @default undefined */ onRun?: OnRunEvent; /** * Whether is disabled. You can also pass a Pixi'VN flag name. * If it is disabled this commitment will not be taken into consideration. So the characters will not be in the room, but will be busy with other commitments. * @default false */ disabled?: boolean | string; /** * Whether is hidden. You can also pass a Pixi'VN flag name. * @default false */ hidden?: boolean | string; /** * The icon of the commitment. */ icon?: string; /** * The priority. The higher the number, the higher the priority. * To ensure that a character is not in 2 places at the same time, if there are 2 or more valid commits at the same time and with the same character, the one with the highest priority will be chosen. * @default 0 */ priority?: number; } interface LocationBaseModelProps { /** * The name * @default "" */ name?: string; /** * Whether is disabled. You can also pass a Pixi'VN flag name. * @default false */ disabled?: boolean | string; /** * Whether is hidden. You can also pass a Pixi'VN flag name. * @default false */ hidden?: boolean | string; /** * The icon of the location. * @default undefined */ icon?: string; /** * The activities that are available in this location. * @default [] */ activities?: ActivityInterface[]; } interface NavigationAbstractInterface extends StoredClassModel { /** * Connects the activity to the class. * @param activity The activity to connect to the class. * @param options * @returns */ addActivity(activity: ActivityInterface, options?: ActiveScheduling): void; /** * Disconnects the activity from the class. * @param activity The activity to disconnect from the class. * @param options */ removeActivity(activity: ActivityInterface | string): void; /** * Removes the useless activities. */ clearExpiredActivities(): void; /** * All the ids of the activities associated with this class. Compared to {@link activities}, they are not filtered based on their scheduling. */ readonly activitiesIds: string[]; /** * The activities associated with this class, filtered based on their scheduling. */ activities: ActivityInterface[]; } interface LocationInterface extends LocationInternalInterface, LocationInterface$1 { } interface LocationInternalInterface extends NavigationAbstractInterface { /** * The id of the location. */ readonly id: string; /** * The map where the location is. */ readonly map: MapInterface; /** * Get all rooms in the location. * @returns The rooms in the location. */ readonly rooms: RoomInterface[]; } interface MapBaseModelProps { /** * The name * @default "" */ name?: string; /** * The image of the map. * @default undefined */ image?: string; /** * The activities that are available in this map. * @default [] */ activities?: ActivityInterface[]; } interface MapInterface extends MapBaseInternalInterface, MapInterface$1 { } interface MapBaseInternalInterface extends NavigationAbstractInterface { /** * The id of the map. */ readonly id: string; /** * Get all locations in the map. * @returns The locations in the map. */ readonly locations: LocationInterface[]; } interface RoomBaseModelProps { /** * The name * @default "" */ name?: string; /** * The image of the room. * @default undefined */ image?: string; /** * The activities that are available in this room. * @default [] */ activities?: ActivityInterface[]; /** * The routine of the room, it is an array of commitments that are executed in the room. You can also add commitments during the game session, but this property is useful to set the initial routine of the room. * @default undefined */ routine?: CommitmentInterface[]; /** * Whether is disabled. You can also pass a Pixi'VN flag name. * @default false */ disabled?: boolean | string; /** * Whether is hidden. You can also pass a Pixi'VN flag name. * @default false */ hidden?: boolean | string; /** * The icon of the room. * @default undefined */ icon?: string; } interface RoomInterface extends RoomBaseInternalInterface, RoomInterface$1 { } interface RoomBaseInternalInterface extends NavigationAbstractInterface { /** * The id of the room. */ readonly id: string; /** * The location where the room is. */ readonly location: LocationInterface; /** * Connects the commitment to the class. * @param commitment The commitment to connect to the class. * @param options * @returns */ addCommitment(commitment: CommitmentInterface, options?: ActiveScheduling): void; /** * Disconnects the commitment from the class. * @param commitment The commitment to disconnect from the class. * @param options */ removeCommitment(commitment: CommitmentInterface | string): void; /** * Get the character commitments of the room. */ readonly routine: CommitmentInterface[]; /** * Get the characters in the room. */ readonly characters: CharacterInterface[]; /** * Get the functions that will be executed when the room is visited. */ readonly automaticFunctions: OnRunAsyncFunction[]; } interface QuestInterface extends QuestBaseInternalInterface, QuestInterface$1 { } interface QuestBaseInternalInterface { /** * The id of the quest. */ readonly id: string; /** * The stages of the quest. */ readonly stages: StageInterface[]; /** * The index of the current stage. */ currentStageIndex?: number; /** * The current stage. */ readonly currentStage?: StageInterface; /** * If the quest is started. */ readonly started: boolean; /** * If the quest is started and not completed and not failed. */ readonly inProgress: boolean; /** * If the quest is completed. */ readonly completed: boolean; /** * If the quest is failed. */ readonly failed: boolean; /** * The function that will be called when the quest starts. */ readonly onStart?: OnRunEvent; /** * @deprecated Use {@link onContinue} instead. The function that will be called when the quest goes to the next stage. */ readonly onNextStage?: OnRunEvent; /** * The function that will be called when the quest goes to the next stage. */ readonly onContinue?: OnRunEvent; /** * Start the quest. * @param props The properties for the start stage. If you not want to pass any property, you can pass an {}. * @returns */ start(props: OnRunProps$1): Promise; /** * Go to the next stage if the current stage is completed. * If you want to force the change of stage, use {@link advanceUnconditionally}. * @param props The properties. If you not want to pass any property, you can pass an {}. * @returns true if the stage was changed, false otherwise. */ advanceIfCompleted(props: OnRunProps$1): Promise; /** * Complete the current stage and go to the next stage with {@link advanceUnconditionally}. * If you want to go to the next stage only if the current stage is completed, use {@link advanceIfCompleted}. * @param props The properties. If you not want to pass any property, you can pass an {}. * @returns true if the stage was changed, false otherwise. */ continue(props: OnRunProps$1): Promise; /** * Ignore the completed state of the current stage and go to the next stage without checking if the current stage is completed. * If you want to go to the next stage only if the current stage is completed, use {@link advanceIfCompleted}. * @param props The properties. If you not want to pass any property, you can pass an {}. * @returns returns true if the stage was changed, false otherwise. */ advanceUnconditionally(props: OnRunProps$1): Promise; /** * If the current stage must start. It is true if the current stage is not started, can start and not completed. */ readonly currentStageMustStart: boolean; /** * Start the current stage. This is a system function, do not use it directly. * @param props The properties for the start stage. If you not want to pass any property, you can pass an {}. */ startCurrentStage(props: OnRunProps$1): Promise; } interface QuestProps { /** * The name of the quest. * @default "" */ name?: string; /** * The description of the quest. * @default "" */ description?: string; /** * The icon of the quest. * @default undefined */ icon?: string; /** * The image of the quest. */ image?: string; /** * If the quest is in development. * @default false */ inDevelopment?: boolean; /** * The function that will be executed when the quest starts. */ onStart?: OnRunEvent; /** * @deprecated Use {@link onContinue} instead. The function that will be executed when a stage end in the quest. */ onNextStage?: OnRunEvent; /** * The function that will be executed when a stage end in the quest. */ onContinue?: OnRunEvent; } interface StageInterface extends StageBaseInternalInterface, StageInterface$1 { } interface StageBaseInternalInterface { /** * The id of the stage. */ readonly id: string; /** * The function that will be called when the stage starts. */ readonly onStart?: OnRunEvent; /** * The function that will be called when the stage ends. */ readonly onEnd?: OnRunEvent; /** * Check if the flag and goals are completed. * You can force the completion of the stage by setting the completed property to true. * @example * ```ts * export default class Stage extends StageStoredClass { * override get completed(): boolean { * if (super.completed) { * return true; * } * if (this.flags.length > 0) { * if (!this.flags.every((flag) => storage.getFlag(flag.flag))) { * return false; * } * return true; * } * return false; * } * override set completed(value: boolean) { * super.completed = value; * } * } * ``` */ completed: boolean; /** * If the stage is started. */ started: boolean; /** * The date when the stage starts. */ readonly startDate?: number; /** * Check if the stage can start. * @example * ```ts * export default class Stage extends StageStoredClass { * override get canStart(): boolean { * if (this.flagsRequired.length > 0 && !this.flagsRequired.every((flag) => storage.getFlag(flag.flag))) { * return false; * } * return super.canStart; * } * } * ``` */ readonly canStart: boolean; /** * The function that will be called when the stage starts. */ start(props: OnRunProps$1): Promise; /** * The number of day/date required to start the stage. */ readonly deltaDateRequired: number; /** * The list of quests required to start the stage. */ readonly questsRequired: QuestsRequiredType[]; } interface StageFlags { /** * The flag for checking if the condition is met. */ flag: string; /** * The description of the flag. */ description: string; } interface StageProps { /** * The flags of the stage. * @default [] */ flags?: StageFlags[]; /** * The name of the stage. * @default "" */ name?: string; /** * The description of the stage. * @default "" */ description?: string; /** * The advice description of the stage. * @default "" */ adviceDescription?: string; /** * The image of the stage. */ image?: string; /** * The number of day/date required to start the stage. * @example If the value is 3, and the previous stage ends on date 1, the stage will start on date 4. */ deltaDateRequired?: number; /** * The flags required to start the stage. * @default [] */ flagsRequired?: StageFlags[]; /** * The quests required to start the stage. * @default [] */ questsRequired?: QuestsRequiredType[]; /** * The description to request to start the stage. * @default "" */ requestDescriptionToStart?: string; /** * The function that will be executed when the stage starts. */ onStart?: OnRunEvent; /** * The function that will be executed when the stage ends. */ onEnd?: OnRunEvent; } interface ActivityStoredClassProps extends ActiveScheduling { } declare class ActivityStoredClass extends StoredClassModel implements ActivityBaseInternalInterface { private readonly _onRun; constructor(id: string, _onRun: OnRunEvent, props: ActivityStoredClassProps, category?: string); private _timeSlot?; get timeSlot(): TimeSchedulingInterface[] | TimeSchedulingInterface | undefined; private _dateScheduling?; get dateScheduling(): DateSchedulingInterface | undefined; protected addTempHistoryItem(): void; get run(): OnRunAsyncFunction; get expired(): boolean; isActive(options?: ActiveScheduling): boolean; } /** * The activity model. It is used to create an activity. * @example * ```tsx * export const nap = new ActivityModel("nap", * (_, event) => { * if (event) { * event.navigate("/game") * callLabelWithGoNavigationCallBack(napLabel, event) * } * else { * console.error("Event is undefined") * } * }, * { * name: "Nap", * timeSlot: { * from: 5, * to: 23, * }, * icon: "https://icon.jpg", * } * ) * ``` */ declare class ActivityBaseModel extends ActivityStoredClass { /** * @param id The activity id, that must be unique. * @param onRun The function that is called when the activity is runned. Have 2 parameters: the runned activity and the yourParams object, that is an object with the parameters that you want to pass to the onRun function. * @param props The activity properties. */ constructor(id: string, onRun: OnRunEvent, props: ActivityProps); private defaultName; /** * The name of the activity. */ get name(): string; set name(value: string | undefined); private defaultDisabled; /** * Whether is disabled. If it is a string, it is a Pixi'VN flag name. */ get disabled(): boolean; set disabled(value: boolean | string); private defaultHidden; /** * Whether is hidden. If it is a string, it is a Pixi'VN flag name. */ get hidden(): boolean; set hidden(value: boolean | string); private _icon?; /** * The icon of the activity. */ get icon(): string | undefined; } interface CommitmentStoredClassProps { /** * Execution type. If is "automatic" the onRun() runned automatically when the palayer is in the room. If is "interaction" the player must interact with the character to run the onRun() function. * If you set "automatic" remember to remove the commitment when it is no longer needed, because otherwise it repeats itself every time. */ executionType?: ExecutionType; /** * The priority. The higher the number, the higher the priority. * To ensure that a character is not in 2 places at the same time, if there are 2 or more valid commits at the same time and with the same character, the one with the highest priority will be chosen. */ priority?: number; /** * Time slot in which activity/commitment will be active. */ timeSlot?: TimeSchedulingInterface; /** * Used to schedule what date it will be added and removed. */ dateScheduling?: DateSchedulingInterface; } declare class CommitmentStoredClass extends ActivityStoredClass implements CommitmentBaseInternalInterface { private readonly _characters; constructor(id: string, _characters: CharacterInterface[], onRun: OnRunEvent | undefined, props: CommitmentStoredClassProps); private readonly defaultExecutionType; private readonly defaultPriority?; get characters(): CharacterInterface[]; get executionType(): ExecutionType; set executionType(value: ExecutionType); get priority(): number; set priority(value: number); protected addTempHistoryItem(): void; } /** * The base model of a commitment. I suggest you extend this class to create your own commitment model. * You must use the saveCommitment function to save the commitment in the registered commitments. * @example * ```ts * export const miaPlay = new CommitmentBaseModel("mia_play", mia, { * name: "Test", * image: "https://image.jpg", * executionType: ExecutionTypeEnum.INTERACTION, * onRun: (commitment) => { * // Do something * } * }) * saveCommitment(miaPlay) * ``` */ declare class CommitmentBaseModel extends CommitmentStoredClass { /** * @param id The id of the commitment, it must be unique. * @param character The character or characters that are in the commitment and so in the room. * @param props The properties of the commitment. */ constructor(id: string, character: CharacterInterface | CharacterInterface[] | undefined, props: CommitmentProps); private _name; /** * The name of the commitment. */ get name(): string; private _image?; /** * The image of the commitment. */ get image(): string | undefined; private _icon?; /** * The icon of the commitment. */ get icon(): string | undefined; private defaultDisabled; /** * Whether is disabled. You can also pass a Pixi'VN flag name. */ get disabled(): boolean; set disabled(value: boolean | string); private defaultHidden; /** * Whether is hidden. You can also pass a Pixi'VN flag name. */ get hidden(): boolean; set hidden(value: boolean | string); } declare abstract class NavigationAbstractClass extends StoredClassModel implements NavigationAbstractInterface { private defaultActivities; constructor(categoryId: string, id: string, defaultActivities?: ActivityInterface[]); private get defaultActivitiesIds(); private get activeActivityScheduling(); private get excludedActivitiesScheduling(); private removeActivityScheduling; private editActivityScheduling; private editExcludedActivityScheduling; private get additionalActivitiesIds(); private get excludedActivitiesIds(); get activitiesIds(): string[]; addActivity(activity: ActivityInterface, options?: ActiveScheduling): void; removeActivity(activity: ActivityInterface | string): void; clearExpiredActivities(): void; get activities(): ActivityInterface[]; } declare class LocationStoredClass extends NavigationAbstractClass implements LocationInternalInterface { /** * The map where the location is. */ private readonly _map; constructor(id: string, /** * The map where the location is. */ _map: MapInterface, activities?: ActivityInterface[]); get map(): MapInterface; get rooms(): RoomInterface[]; } /** * The base model of a location. I suggest you extend this class to create your own location model. * @example * ```typescript * export const mcHome = new LocationBaseModel('mc_home', mainMap, { * name: 'MC Home', * icon: "https://icon.jpg", * }); * ``` */ declare class LocationBaseModel extends LocationStoredClass implements LocationInternalInterface { /** * @param id The id of the location, it must be unique. * @param map The map where the location is. * @param props The properties of the location. */ constructor(id: string, map: MapInterface, props?: LocationBaseModelProps); private defaultName; /** * The name of the location. * If you set undefined, it will return the initial value of name. */ get name(): string; set name(value: string | undefined); private defaultDisabled; /** * Whether is disabled. If it is a string, it is a Pixi'VN flag name. */ get disabled(): boolean; set disabled(value: boolean | string); private defaultHidden; /** * Whether is hidden. If it is a string, it is a Pixi'VN flag name. */ get hidden(): boolean; set hidden(value: boolean | string); private _icon?; /** * The icon of the location. */ get icon(): string | undefined; } declare class MapStoredClass extends NavigationAbstractClass implements MapBaseInternalInterface { constructor(id: string, activities?: ActivityInterface[]); get locations(): LocationInterface[]; } /** * The base model of a map. I suggest you extend this class to create your own map model. * @example * ```typescript * export const mainMap = new MapBaseModel('main_map', { * name: 'Main Map', * image: "https://image.jpg", * }); * ``` */ declare class MapBaseModel extends MapStoredClass implements MapBaseInternalInterface { /** * @param id The id of the map, it must be unique. * @param props The properties of the map. */ constructor(id: string, props?: MapBaseModelProps); private defaultName; /** * The name of the map. * If you set undefined, it will return the initial value of name. */ get name(): string; set name(value: string | undefined); private _image?; /** * The image of the map. */ get image(): string | undefined; } declare class RoomStoredClass extends NavigationAbstractClass implements RoomBaseInternalInterface { /** * The location where the room is. */ private readonly _location; constructor(id: string, /** * The location where the room is. */ _location: LocationInterface, activities?: ActivityInterface[] | { activities: ActivityInterface[]; routine: CommitmentInterface[]; }); get routine(): CommitmentInterface[]; addCommitment(commitment: CommitmentInterface, options?: ActiveScheduling): void; removeCommitment(commitment: CommitmentInterface | string): void; get location(): LocationInterface; get characters(): CharacterInterface[]; get automaticFunctions(): OnRunAsyncFunction[]; } /** * The base model of a room. I suggest you extend this class to create your own room model. * **You must use the {@link RegisteredRooms.add} function to save the room in the registered rooms.** * @example * ```ts * export const mcRoom = new RoomBaseModel('mc_room', mcHome, { * name: "MC Room", * icon: "https://icon.jpg", * image: "https://image.jpg", * }) * RegisteredRooms.add(mcRoom) * ``` */ declare class RoomBaseModel extends RoomStoredClass { /** * @param id The id of the room, it must be unique. * @param location The location where the room is. * @param props The properties of the room. */ constructor(id: string, location: LocationInterface, props?: RoomBaseModelProps); private defaultName; /** * The name. * If you set undefined, it will return the initial value of name. */ get name(): string; set name(value: string | undefined); private _image?; /** * The image of the room. */ get image(): string | undefined; private defaultDisabled; /** * Whether is disabled. If it is a string, it is a Pixi'VN flag name. */ get disabled(): boolean; set disabled(value: boolean | string); private defaultHidden; /** * Whether is hidden. If it is a string, it is a Pixi'VN flag name. */ get hidden(): boolean; set hidden(value: boolean | string); private _icon?; /** * The function for rendering the icon of the room. */ get icon(): string | undefined; } interface QuestStoredClassProps { /** * The function that will be executed when the quest starts. */ onStart?: OnRunEvent; /** * @deprecated Use {@link onContinue} instead. */ onNextStage?: OnRunEvent; /** * The function that will be executed when a stage end in the quest. */ onContinue?: OnRunEvent; } declare class QuestStoredClass extends StoredClassModel implements QuestBaseInternalInterface { private readonly _stages; constructor(id: string, _stages: StageInterface[], props?: QuestStoredClassProps); get stages(): StageInterface[]; get currentStageIndex(): number | undefined; private set currentStageIndex(value); get currentStage(): StageInterface | undefined; get started(): boolean; get completed(): boolean; get inProgress(): boolean; get failed(): boolean; set failed(value: boolean); private _onStart?; get onStart(): undefined | OnRunEvent; private _onContinue?; get onContinue(): undefined | OnRunEvent; get onNextStage(): undefined | OnRunEvent; start(props: OnRunProps$1): Promise; /** * @deprecated Use {@link advanceIfCompleted} instead. */ goNextIfCompleted(props: OnRunProps$1): Promise; advanceIfCompleted(props: OnRunProps$1): Promise; /** * @deprecated Use {@link continue} instead. */ goNext(props: OnRunProps$1): Promise; continue(props: OnRunProps$1): Promise; /** * @deprecated Use {@link advanceUnconditionally} instead. */ forceGoNext(props: OnRunProps$1): Promise; advanceUnconditionally(props: OnRunProps$1): Promise; get currentStageMustStart(): boolean; startCurrentStage(props: OnRunProps$1): Promise; } declare class QuestBaseModel extends QuestStoredClass { constructor(id: string, stages: StageInterface[], props: QuestProps); private _name; /** * The name of the quest. */ get name(): string; private _description; /** * The description of the quest. */ get description(): string; private _icon?; /** * Icon of the quest. */ get icon(): string | undefined; private _image?; /** * Image of the quest. */ get image(): string | undefined; private _inDevelopment; /** * If the quest is in development. */ get inDevelopment(): boolean; } interface StageStoredClassProps { /** * The function that will be executed when the stage starts. */ onStart?: OnRunEvent; /** * The function that will be executed when the stage ends. */ onEnd?: OnRunEvent; /** * The number of day/date required to start the stage. * @example If the value is 3, and the previous stage ends on day 1, the stage will start on day 4. */ deltaDateRequired?: number; /** * The quests required to start the stage. * @default [] */ questsRequired?: QuestsRequiredType[]; } declare class StageStoredClass extends StoredClassModel implements StageBaseInternalInterface { constructor(id: string, props?: StageStoredClassProps); private _onStart?; get onStart(): undefined | OnRunEvent; private _onEnd?; get onEnd(): undefined | OnRunEvent; get completed(): boolean; set completed(value: boolean); get started(): boolean; set started(value: boolean); private get inizializeDate(); private set inizializeDate(value); get startDate(): number | undefined; get canStart(): boolean; inizialize(): void; start(props: OnRunProps$1): Promise; private _deltaDateRequired?; get deltaDateRequired(): number; private _questsRequired; get questsRequired(): QuestsRequiredType[]; } declare class StageBaseModel extends StageStoredClass { constructor(id: string, props: StageProps); private _name; /** * The name of the stage. */ get name(): string; private _description; /** * The description of the stage. */ get description(): string; private _adviceDescription; /** * The advice description of the stage. */ get adviceDescription(): string; private _image?; /** * The image of the stage. */ get image(): string | undefined; private _flags; /** * The list of flags that the player must complete to finish the stage. */ get flags(): StageFlags[]; private _flagsRequired; /** * The list of flags required to start the stage. */ get flagsRequired(): StageFlags[]; private _requestDescriptionToStart; /** * The description of the request to start the stage. */ get requestDescriptionToStart(): string; get completed(): boolean; set completed(value: boolean); get canStart(): boolean; } declare class NavigatorHandler { get rooms(): RoomInterface[]; get locations(): LocationInterface[]; get maps(): MapInterface[]; get currentRoomId(): string | undefined; get currentRoom(): RoomInterface | undefined; set currentRoom(room: RoomInterface | string); get currentLocation(): LocationInterface | undefined; get currentMap(): MapInterface | undefined; /** * Clear all the expired activities. */ clearExpiredActivities(): void; } declare class QuestHandler { /** * The quests registered in the game. */ get quests(): QuestInterface[]; /** * The quests that are started, so they are in progress or completed or failed. */ get startedQuests(): QuestInterface[]; /** * The quests that are in progress. */ get inProgressQuests(): QuestInterface[]; /** * The quests that are completed. */ get completedQuests(): QuestInterface[]; /** * The quests that are failed. */ get failedQuests(): QuestInterface[]; /** * The quests that are not started. */ get notStartedQuests(): QuestInterface[]; /** * Get the quest by the id. * @param id The id of the quest. * @returns The quest with the id. */ find(id: string): QuestInterface | undefined; /** * Start the quests that must start on the current stage. */ startsStageMustBeStarted(props: OnRunProps$1): Promise; } declare class RoutineHandler { /** * Get the temporary commitments by its id. * @returns The temporary commitments. */ private get temporaryRoutine(); get commitmentsIds(): string[]; /** * This feature adds the commitments during the game session. * @param commitment The commitment or commitments to add. * @param roomId The id of the room where the commitment is. */ add(commitment: CommitmentInterface[] | CommitmentInterface, roomId: string, options?: ActiveScheduling): void; /** * Get the commitments added during the game session. * @param id The id of the commitment. * @returns The commitment or undefined if not found. */ find(id: string): CommitmentInterface | undefined; /** * Remove the commitments added during the game session. * @param commitment The commitment or commitment id to remove. * @param roomId The id of the room where the commitment is. */ remove(commitment: CommitmentInterface | string, roomId?: string): void; /** * Clear all the expired commitments. */ clearExpiredRoutine(): void; get characterCommitments(): { [character: string]: [CommitmentInterface, string]; }; /** * Get the current commitments. The hidden commitments are not included. * In case there is a character who has two or more commitments at the same time, will be selected the commitment with the highest priority. * Higher priority commitments are calculated using the following steps: * 1. The commitments that have Commitments BaseModel.priority set to a higher value will be selected first. * 2. If there are commitments with the same priority, the commitments that are not fixed will be selected first. * 3. If there are commitments with the same priority and the same fixed status, priority will be given to the commitment with a lower index. * @returns The current commitments. */ get currentRoutine(): CommitmentInterface[]; get roomCommitments(): { [roomId: string]: CommitmentInterface[]; }; /** * Get the character commitment. * @param character The character. * @returns The commitment or undefined if not found. */ getCommitmentByCharacter(character: CharacterInterface): CommitmentInterface | undefined; } declare class TimeHandler { initialize(settings: TimeSettings): void; get dayStartTime(): number; get dayEndTime(): number; get defaultTimeSpent(): number; get timeSlots(): TimeSlotInterface[]; get weekLength(): number; get weekendStartDay(): number; /** * Week days name * @param weekDayNumber The current week day number (from: 0 - to: {@link weekLength} - 1). * @returns The name of the week day. * @example * ```ts * (weekDayNumber: number) => { * const weekDaysNames = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']; * return weekDaysNames[weekDayNumber]; * } * ``` */ get getDayName(): ((weekDayNumber: number) => string) | undefined; /** * Get the current time. Time is a numeric variable used to determine and manage time during a day/date. * It's recommended to use currentTime as if it were the current time. If you also want to manage minutes, you can use a float value. */ get currentTime(): number; set currentTime(value: number | undefined); /** * Get the current date. Date is a numeric variable used to determine and manage the number of days passed. * It's recommended to use currentDate as if it were the current day. */ get currentDate(): number; set currentDate(value: number | undefined); /** * If the current day is greater than or equal to the weekend start day, then it will return true. */ get isWeekend(): boolean; /** * Get the current week day number (from: 1 - to: {@link weekLength}). * For example, if the week length is 7 and the current day is 10, then the result will be 4. */ get currentWeekDayNumber(): number; /** * Get the current week day name. If the week days names are not defined, then it will return undefined. * For example, if the week days names are ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] and the current day is 10, then the result will be 'Thursday'. * @default "" */ get currentDayName(): string; /** * Get the current {@link timeSlots} index. * You can use this property to create "Image that changes based on the time period": * @example * ```tsx * import { weekLength } from '@drincs/nqtr'; * * function changeBackground() { * return ( * * ) * } */ get currentTimeSlot(): number; /** * This function will increase the current time by the given time spent. * If the new time is greater than or equal to the max day times, then it will increase the day and set the new time. * @param delta is the time spent in times (default: {@link defaultTimeSpent}) * @returns currentTimeSlot.currentTime */ increaseTime(delta?: number): number; /** * This function will increase the current date by the given delta. * @param delta is the number of days to increase (default: 1) * @param time is the time of the new day (default: {@link dayStartTime}) * @returns timeTracker.currentDate */ increaseDate(delta?: number, time?: number): number; /** * This function will check if the current time is between the given times. * @param fromTime the starting time. If the {@link currentTime} is equal to this time, the function will return true. * @param toTime the ending time. * @returns true if the current time is between the given times, otherwise false. */ nowIsBetween(fromTime: number | undefined, toTime: number | undefined): boolean; } declare const timeTracker: TimeHandler; declare const navigator: NavigatorHandler; declare const routine: RoutineHandler; declare const questsNotebook: QuestHandler; declare const handlers_navigator: typeof navigator; declare const handlers_questsNotebook: typeof questsNotebook; declare const handlers_routine: typeof routine; declare const handlers_timeTracker: typeof timeTracker; declare namespace handlers { export { handlers_navigator as navigator, handlers_questsNotebook as questsNotebook, handlers_routine as routine, handlers_timeTracker as timeTracker }; } declare const nqtr: { handlers: typeof handlers; registries: typeof registries; ActivityBaseModel: typeof ActivityBaseModel; ActivityStoredClass: typeof ActivityStoredClass; CommitmentBaseModel: typeof CommitmentBaseModel; CommitmentStoredClass: typeof CommitmentStoredClass; LocationBaseModel: typeof LocationBaseModel; LocationStoredClass: typeof LocationStoredClass; MapBaseModel: typeof MapBaseModel; MapStoredClass: typeof MapStoredClass; RoomBaseModel: typeof RoomBaseModel; RoomStoredClass: typeof RoomStoredClass; QuestBaseModel: typeof QuestBaseModel; QuestStoredClass: typeof QuestStoredClass; StageBaseModel: typeof StageBaseModel; StageStoredClass: typeof StageStoredClass; }; export { type ActiveScheduling, ActivityBaseModel, type ActivityInterface, type ActivityProps, ActivityStoredClass, type ActivityStoredClassProps, CommitmentBaseModel, type CommitmentInfo, type CommitmentInterface, type CommitmentProps, CommitmentStoredClass, type CommitmentStoredClassProps, type DateSchedulingInterface, type ExecutionType, type TimeSlotInterface as ITimeStlot, LocationBaseModel, type LocationBaseModelProps, type LocationInterface, LocationStoredClass, MapBaseModel, type MapBaseModelProps, type MapInterface, MapStoredClass, type OnRunAsyncFunction, type OnRunEvent, type OnRunFunction, type OnRunProps, QuestBaseModel, type QuestInterface, type QuestProps, QuestStoredClass, type QuestStoredClassProps, type QuestsRequiredType, RoomBaseModel, type RoomBaseModelProps, type RoomInterface, RoomStoredClass, StageBaseModel, type StageInterface, type StageProps, StageStoredClass, type StageStoredClassProps, type TimeSchedulingInterface, type TimeSettings, nqtr as default };