@novely/core 0.30.0 → 0.30.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/index.d.ts CHANGED
@@ -477,9 +477,7 @@ type ValidAction = ['choice', number] | ['clear', Set<keyof DefaultActionProxy>?
477
477
  type Story = Record<string, ValidAction[]>;
478
478
  type TextContent<L extends string, S extends State> = string | ((state: S) => string) | Record<L, string | ((state: S) => string)>;
479
479
  type FunctionableValue<T> = T | (() => T);
480
- type CustomHandlerGetResultDataFunction = {
481
- (data?: Record<string, unknown>): Record<string, unknown>;
482
- };
480
+ type CustomHandlerGetResultDataFunction = (data?: Record<string, unknown>) => Record<string, unknown>;
483
481
  type CustomHandlerGetResult<I extends boolean> = {
484
482
  delete: () => void;
485
483
  /**
@@ -503,6 +501,7 @@ type CustomHandlerFunctionGetFn = <I extends boolean = true>(insert?: I) => Cust
503
501
  type CustomHandlerFunctionParameters<L extends string, S extends State> = {
504
502
  get: CustomHandlerFunctionGetFn;
505
503
  state: StateFunction<S>;
504
+ restoring: boolean;
506
505
  goingBack: boolean;
507
506
  preview: boolean;
508
507
  lang: L;
@@ -567,9 +566,7 @@ type ChoiceCheckFunctionProps<L extends string, S extends State> = {
567
566
  */
568
567
  state: S;
569
568
  };
570
- type ChoiceCheckFunction<L extends string, S extends State> = {
571
- (props: ChoiceCheckFunctionProps<L, S>): boolean;
572
- };
569
+ type ChoiceCheckFunction<L extends string, S extends State> = (props: ChoiceCheckFunctionProps<L, S>) => boolean;
573
570
  type ConditionCheckFunction<S extends State, R extends string | true | false> = (state: S) => R;
574
571
  type FunctionAction<L extends string, S extends State> = (props: FunctionActionProps<L, S>) => Thenable<void>;
575
572
  type ActionInputSetup = (input: HTMLInputElement, cleanup: (cb: () => void) => void) => void;
@@ -608,9 +605,7 @@ type ActionProxy<Characters extends Record<string, Character>, Languages extends
608
605
  */
609
606
  stopVoice: () => ValidAction;
610
607
  jump: (scene: string) => ValidAction;
611
- showCharacter: {
612
- <C extends keyof Characters>(character: C, emotion?: keyof Characters[C]['emotions'], className?: string, style?: string): ValidAction;
613
- };
608
+ showCharacter: <C extends keyof Characters>(character: C, emotion?: keyof Characters[C]['emotions'], className?: string, style?: string) => ValidAction;
614
609
  hideCharacter: (character: keyof Characters, className?: string, style?: string, duration?: number) => ValidAction;
615
610
  animateCharacter: (character: keyof Characters, timeout: number, ...classes: string[]) => ValidAction;
616
611
  wait: (time: number | ((state: State) => number)) => ValidAction;
@@ -281,7 +281,7 @@ var Novely = (() => {
281
281
  }
282
282
  fn.apply(this, args);
283
283
  throttled = true;
284
- setTimeout(function() {
284
+ setTimeout(() => {
285
285
  throttled = false;
286
286
  if (savedArgs) {
287
287
  wrapper.apply(savedThis, savedArgs);
@@ -891,8 +891,8 @@ var Novely = (() => {
891
891
  renderer: createRenderer,
892
892
  initialScreen = "mainmenu",
893
893
  translation,
894
- state: defaultState,
895
- data: defaultData,
894
+ state: defaultState = {},
895
+ data: defaultData = {},
896
896
  autosaves = true,
897
897
  migrations = [],
898
898
  throttleTimeout = 799,
@@ -913,8 +913,6 @@ var Novely = (() => {
913
913
  const ASSETS_TO_PRELOAD = /* @__PURE__ */ new Set();
914
914
  const dataLoaded = createControlledPromise();
915
915
  let initialScreenWasShown = false;
916
- defaultData ||= {};
917
- defaultState ||= {};
918
916
  const intime = (value) => {
919
917
  return times.add(value), value;
920
918
  };
@@ -1815,7 +1813,7 @@ var Novely = (() => {
1815
1813
  Remove: "\u0423\u0434\u0430\u043B\u0438\u0442\u044C",
1816
1814
  LoadASaveFrom: "\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u0435 \u043E\u0442",
1817
1815
  DeleteASaveFrom: "\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u0435 \u043E\u0442",
1818
- TextSpeed: "\u0421\u043A\u043E\u0440\u043E\u0441\u0442\u044C \u0422\u0435\u043A\u0441\u0442\u0430",
1816
+ TextSpeed: "\u0421\u043A\u043E\u0440\u043E\u0441\u0442\u044C \u0442\u0435\u043A\u0441\u0442\u0430",
1819
1817
  TextSpeedSlow: "\u041C\u0435\u0434\u043B\u0435\u043D\u043D\u0430\u044F",
1820
1818
  TextSpeedMedium: "\u0421\u0440\u0435\u0434\u043D\u044F\u044F",
1821
1819
  TextSpeedFast: "\u0411\u044B\u0441\u0442\u0440\u0430\u044F",