narraleaf-react 0.24.0 → 0.25.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.
@@ -15,6 +15,23 @@ export declare class CharacterAction<T extends typeof CharacterActionTypes[keyof
15
15
  };
16
16
  static getVoice(state: GameState, sentence: Sentence): Sound | null;
17
17
  private static endVoiceWithPreference;
18
+ /**
19
+ * The line voice still running past the end of its own sentence, per game.
20
+ *
21
+ * Only `voiceEndMode: "none"` ever leaves one - the other two modes stop the clip at line end.
22
+ * A WeakMap rather than a field on `GameState` because this is bookkeeping between two
23
+ * consecutive `say`s, not state a host or a save has any business seeing.
24
+ */
25
+ private static readonly trailingVoice;
26
+ /**
27
+ * Cut whatever is still playing from an earlier line before this one's voice starts.
28
+ *
29
+ * "Let it play on" means the clip outlives its own sentence - it does not mean two actors talk
30
+ * at once. Without this, advancing through voiced lines under that mode layered every clip over
31
+ * the last one, and a player clicking quickly could stack three or four. Unvoiced lines pass by
32
+ * without cutting anything, which is the whole point of the mode.
33
+ */
34
+ static cutTrailingVoice(gameState: GameState, next: Sound | null): void;
18
35
  executeAction(gameState: GameState, injection: ActionExecutionInjection): ExecutedActionResult;
19
36
  stringify(_story: Story, _seen: Set<LogicAction.Actions>, _strict: boolean): string;
20
37
  }
@@ -54,6 +54,17 @@ export declare class DevTools {
54
54
  * (use a distinct prefix so they never collide with generated ids).
55
55
  */
56
56
  static setElementId(element: LogicAction.GameElement, id: string): void;
57
+ /**
58
+ * Name an element from the host's own documents, so story construction keeps that name instead
59
+ * of the position it happened to occupy.
60
+ *
61
+ * Unlike {@link setElementId}, this survives construction: generated ids are assigned after a
62
+ * host has finished building, and an id set with `setElementId` is overwritten there for
63
+ * anything the action tree reaches. Hosts that restore saved state should use this - a
64
+ * generated id moves to a different element the moment a line is written ahead of it, and the
65
+ * state a save carries then lands on the wrong element with nothing reporting it.
66
+ */
67
+ static setElementStaticId(element: LogicAction.GameElement, id: string | null): void;
57
68
  /**
58
69
  * Read a displayable's current transform-state props (position/opacity/zoom/rotation/scale/
59
70
  * effects...). Returns a shallow copy. Intended for editor hosts capturing a live pose
@@ -41,6 +41,8 @@ export type SceneDataRaw = {
41
41
  state: Record<string, any>;
42
42
  };
43
43
  export declare class Scene extends Constructable<LogicAction.Actions, Scene> {
44
+ /** Resolved voice src -> the one `Sound` that plays it. See {@link Scene.getVoice}. */
45
+ private readonly voiceCache;
44
46
  get local(): Persistent<any>;
45
47
  get background(): Image;
46
48
  get backgroundLayer(): Layer;