bard-legends-framework 1.11.4 → 1.12.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.
package/dist/index.d.ts CHANGED
@@ -1,8 +1,21 @@
1
1
  import * as actions_lib from 'actions-lib';
2
- import { IDAttachable, AttachmentID, Attachable, IdleSingleEvent, IdleSequence, Variable, Reducer, Sequence, SingleNotifier, Notifier, SingleEvent, Action, ClassID, NotifierCallbackFunction, IAttachment } from 'actions-lib';
2
+ import { IdleSingleEvent, IDAttachable, AttachmentID, Attachable, IdleSequence, Variable, Reducer, Sequence, SingleNotifier, Notifier, SingleEvent, Action, ClassID, NotifierCallbackFunction, IAttachment } from 'actions-lib';
3
3
  import { Vector, DynamicID, Vec2, RGBColor, Radian, Rectangle, Grid, GridNeighborType, Line } from 'helpers-lib';
4
- import p2$1 from 'p2';
5
4
  import * as Pixi from 'pixi.js';
5
+ import p2$1 from 'p2';
6
+ import { LayoutStyles } from '@pixi/layout';
7
+
8
+ type AudioAppearTransitionType = 'ease' | 'instant';
9
+ declare const SOUND_TRANSITION_DURATION = 1000;
10
+ declare class Audio {
11
+ private constructor();
12
+ setVolumes(volumes: {
13
+ master: number;
14
+ music: number;
15
+ sound: number;
16
+ }): void;
17
+ appear(on: boolean, type?: AudioAppearTransitionType): IdleSingleEvent;
18
+ }
6
19
 
7
20
  /**
8
21
  * Binds a controller to its gateway (the class produced by `Gateway<T>()`). The controller must
@@ -158,18 +171,6 @@ declare abstract class View extends IDAttachable {
158
171
  update: (time: number, delta: number) => void;
159
172
  }
160
173
 
161
- type AudioAppearTransitionType = 'ease' | 'instant';
162
- declare const SOUND_TRANSITION_DURATION = 1000;
163
- declare class Audio {
164
- private constructor();
165
- setVolumes(volumes: {
166
- master: number;
167
- music: number;
168
- sound: number;
169
- }): void;
170
- appear(on: boolean, type?: AudioAppearTransitionType): IdleSingleEvent;
171
- }
172
-
173
174
  interface FocusingNewTargetInfo {
174
175
  time: number;
175
176
  duration: number;
@@ -322,9 +323,14 @@ declare class Game {
322
323
  readonly devMode: boolean;
323
324
  constructor(partialConfiguration?: Partial<GameConfiguration>);
324
325
  setup(setupOptions: GameSetupOptions): Promise<void>;
326
+ generateTexture(options: Pixi.GenerateTextureOptions | Pixi.Container): Pixi.Texture;
325
327
  setResolution(resolution: number): void;
326
328
  }
327
329
 
330
+ declare class ElectronGame {
331
+ static start(configuration: Partial<Omit<GameConfiguration, 'devMode' | 'maxScreenResolution'>>, setupOptions: GameSetupOptions): Promise<Game>;
332
+ }
333
+
328
334
  interface SoundOptions {
329
335
  readonly time?: number;
330
336
  readonly volume?: number;
@@ -407,40 +413,17 @@ declare class MusicPlayer extends IDAttachable {
407
413
  close(): IdleSingleEvent;
408
414
  }
409
415
 
410
- declare enum ContainerEventType {
411
- Click = "click",
412
- MouseOver = "mouseover",
413
- MouseOut = "mouseout",
414
- PointerDown = "pointerdown",
415
- PointerUp = "pointerup",
416
- PointerUpOutside = "pointerupoutside",
417
- PointerMove = "pointermove",
418
- PointerCancel = "pointercancel",
419
- PointerOver = "pointerover",
420
- PointerOut = "pointerout",
421
- PointerEnter = "pointerenter",
422
- PointerLeave = "pointerleave",
423
- Added = "added",
424
- Removed = "removed",
425
- Update = "update",
426
- Change = "change",
427
- Wheel = "wheel"
416
+ interface PixiDisplayObject {
417
+ x: number;
418
+ y: number;
419
+ rotation: number;
420
+ alpha: number;
428
421
  }
429
- type ContainerEventTypeToResultType = {
430
- [K in ContainerEventType]: K extends ContainerEventType.Wheel ? {
431
- deltaY: number;
432
- } : undefined;
433
- };
434
- declare enum Cursor {
435
- Default = "default",
436
- Pointer = "pointer"
437
- }
438
- declare abstract class ContainerAttributes extends IDAttachable {
439
- protected constructor();
440
- get size(): Vector;
441
- set size(value: Vector);
442
- getSize(): Vector;
443
- setSize(value: Vector): this;
422
+ declare abstract class DisplayObjectAttributes extends IDAttachable {
423
+ protected readonly _pixiDisplayObject: PixiDisplayObject;
424
+ protected constructor(_pixiDisplayObject: PixiDisplayObject);
425
+ protected abstract _applyScale(x: number, y: number): void;
426
+ protected abstract _getHoldFromModifier(holdFrom: Vector): Vector;
444
427
  /**
445
428
  * @param value The position to set
446
429
  * @param options.holdFrom An anchor point to hold the position from
@@ -457,7 +440,6 @@ declare abstract class ContainerAttributes extends IDAttachable {
457
440
  set x(value: number);
458
441
  get y(): number;
459
442
  set y(value: number);
460
- on<T extends ContainerEventType>(eventType: T): Sequence<ContainerEventTypeToResultType[T]>;
461
443
  setRotation(value: Radian): this;
462
444
  get rotation(): Radian;
463
445
  set rotation(value: Radian);
@@ -466,38 +448,9 @@ declare abstract class ContainerAttributes extends IDAttachable {
466
448
  */
467
449
  get rotationValue(): number;
468
450
  set rotationValue(value: number);
469
- setZIndex(value: number): this;
470
- get zIndex(): number;
471
- set zIndex(value: number);
472
- setSkewX(radian: Radian): this;
473
- get skewX(): Radian;
474
- set skewX(radian: Radian);
475
- setSkewY(radian: Radian): this;
476
- get skewY(): Radian;
477
- set skewY(radian: Radian);
478
- setSortableChildren(value: boolean): this;
479
- get sortableChildren(): boolean;
480
- set sortableChildren(value: boolean);
481
451
  setAlpha(value: number): this;
482
452
  get alpha(): number;
483
453
  set alpha(value: number);
484
- setInteractive(value: boolean): this;
485
- get interactive(): boolean;
486
- set interactive(value: boolean);
487
- /**
488
- * Renders this subtree as an isolated render group: its cached render instructions are not
489
- * rebuilt when other parts of the scene change, and moving the group only updates one transform.
490
- * Use for subtrees that move as a whole (world under a camera) or rarely change (HUD vs world).
491
- */
492
- setRenderGroup(value?: boolean): this;
493
- setCursor(value: Cursor): this;
494
- get cursor(): Cursor;
495
- set cursor(value: Cursor);
496
- protected getMask(): Pixi.Container;
497
- setMask(mask: ContainerAttributes | undefined): this;
498
- hitTest(stagePosition: Vector): boolean;
499
- get boundingBox(): Rectangle;
500
- ignoreBounds(value?: boolean): this;
501
454
  setMirror(mirror?: boolean): this;
502
455
  get mirror(): boolean;
503
456
  set mirror(value: boolean);
@@ -572,11 +525,40 @@ declare class Sprite extends Container {
572
525
  download(): this;
573
526
  }
574
527
 
528
+ type LayoutStyle = LayoutStyles;
529
+ declare enum ContainerEventType {
530
+ Click = "click",
531
+ MouseOver = "mouseover",
532
+ MouseOut = "mouseout",
533
+ PointerDown = "pointerdown",
534
+ PointerUp = "pointerup",
535
+ PointerUpOutside = "pointerupoutside",
536
+ PointerMove = "pointermove",
537
+ PointerCancel = "pointercancel",
538
+ PointerOver = "pointerover",
539
+ PointerOut = "pointerout",
540
+ PointerEnter = "pointerenter",
541
+ PointerLeave = "pointerleave",
542
+ Added = "added",
543
+ Removed = "removed",
544
+ Update = "update",
545
+ Change = "change",
546
+ Wheel = "wheel"
547
+ }
548
+ type ContainerEventTypeToResultType = {
549
+ [K in ContainerEventType]: K extends ContainerEventType.Wheel ? {
550
+ deltaY: number;
551
+ } : undefined;
552
+ };
553
+ declare enum Cursor {
554
+ Default = "default",
555
+ Pointer = "pointer"
556
+ }
575
557
  interface SetParentOptions {
576
558
  addUnder: boolean;
577
559
  cropOverflowingParts: boolean;
578
560
  }
579
- declare class Container extends ContainerAttributes {
561
+ declare class Container extends DisplayObjectAttributes {
580
562
  protected static allContainers: Map<number, Container>;
581
563
  readonly filters: Filters;
582
564
  protected addChildTo: Container;
@@ -584,8 +566,50 @@ declare class Container extends ContainerAttributes {
584
566
  addUnder: boolean;
585
567
  cropOverflowingParts: boolean;
586
568
  };
587
- constructor();
569
+ constructor(pixiContainer?: Pixi.Container);
588
570
  destroy(): void;
571
+ protected _applyScale(x: number, y: number): void;
572
+ protected _getHoldFromModifier(holdFrom: Vector): Vector;
573
+ get size(): Vector;
574
+ set size(value: Vector);
575
+ getSize(): Vector;
576
+ setSize(value: Vector): this;
577
+ /**
578
+ * Makes this object a flex item of a LayoutContainer parent, treated as a box measured by its bounds.
579
+ * @param style Optional per-item overrides (alignSelf, margins, width, height...)
580
+ * @returns this
581
+ */
582
+ setLayout(style?: LayoutStyle): this;
583
+ on<T extends ContainerEventType>(eventType: T): Sequence<ContainerEventTypeToResultType[T]>;
584
+ setZIndex(value: number): this;
585
+ get zIndex(): number;
586
+ set zIndex(value: number);
587
+ setSkewX(radian: Radian): this;
588
+ get skewX(): Radian;
589
+ set skewX(radian: Radian);
590
+ setSkewY(radian: Radian): this;
591
+ get skewY(): Radian;
592
+ set skewY(radian: Radian);
593
+ setSortableChildren(value: boolean): this;
594
+ get sortableChildren(): boolean;
595
+ set sortableChildren(value: boolean);
596
+ setInteractive(value: boolean): this;
597
+ get interactive(): boolean;
598
+ set interactive(value: boolean);
599
+ /**
600
+ * Renders this subtree as an isolated render group: its cached render instructions are not
601
+ * rebuilt when other parts of the scene change, and moving the group only updates one transform.
602
+ * Use for subtrees that move as a whole (world under a camera) or rarely change (HUD vs world).
603
+ */
604
+ setRenderGroup(value?: boolean): this;
605
+ setCursor(value: Cursor): this;
606
+ get cursor(): Cursor;
607
+ set cursor(value: Cursor);
608
+ protected getMask(): Pixi.Container;
609
+ setMask(mask: Container | undefined): this;
610
+ hitTest(stagePosition: Vector): boolean;
611
+ get boundingBox(): Rectangle;
612
+ ignoreBounds(value?: boolean): this;
589
613
  getBoundingMask(): Sprite;
590
614
  displayParent(parent: Container | number, partialOptions?: Partial<SetParentOptions>): this;
591
615
  }
@@ -982,6 +1006,16 @@ declare class ScrollMaskUI extends Container {
982
1006
  constructor(container: Container, size: Vector, padding: number, direction?: ScrollDirection);
983
1007
  }
984
1008
 
1009
+ /**
1010
+ * A flexbox container.
1011
+ */
1012
+ declare class LayoutContainer extends Container {
1013
+ constructor(style?: LayoutStyle);
1014
+ setLayout(style: LayoutStyle): this;
1015
+ debug(): this;
1016
+ debugBackground(): this;
1017
+ }
1018
+
985
1019
  interface KeyboardKeyInfo {
986
1020
  readonly key: string;
987
1021
  readonly code: string;
@@ -1342,4 +1376,26 @@ declare abstract class MovablePhysicsEntity extends PhysicsEntity {
1342
1376
  convertToDTO(): PhysicsBodyDTO;
1343
1377
  }
1344
1378
 
1345
- export { AdvancedSound, type AdvancedSoundOptions, AnimationFlicker, AnimationInterpolationFunctions, type AnimationOptions, Animations, AnimationsCompletionHandlingType, Animator, type AnimatorAnimation, type AssetDefinition, type AudioAppearTransitionType, BORDER_MATERIAL_NAME, BardLegendsTestingHelper, type BlendMode, type BorderProperties, Camera, CameraGateway, type CircleShapeData, ClosestAvailableSpaceHelper, type CollisionDetails, type CollisionReport, Container, ContainerEventType, ControllerDecorator, type CreateDashedLineOptions, type CreatePhysicsWorldRequestDTO, Cursor, DEFAULT_SHADER_RESOLUTION, DeltaTime, DisplayObjectArray, type DisplayObjectArrayOptions, type DropShadowOptions, Entity, EntityDecorator, type EntityID, type ExplosionHit, FadeInContent, type FadeInContentOptions, FocusingAnimation, Game, Gateway, type GlowEffectOptions, type GlowOptions, type GlowingShapeDefinition, Graphics, type HitTestOptions, ImmovablePhysicsEntity, type InteractingBodyGroups, type KeyboardKeyInfo, KeyboardService, type MapSizeDTO, type MaterialContactDefinition, type MaterialDefinition, MenuEntity, type MenuOptions, MenuUI, MenuView, MouseService, MouseTargetFocusService, MovableEntity, MovablePhysicsEntity, Music, MusicPlayer, type MusicPlayerOptions, type PartialTextOptions, PathFinder, type PathFinderResult, type PhysicsBodyDTO, PhysicsEntity, type PhysicsEntityDefinition, type PhysicsExplosionOptions, PhysicsGateway, PhysicsShapeType, type PhysicsWorldID, Placeholder, type PolygonDefinition, type PolygonShapeData, ROTATIONAL_SPEED_LIMIT, type RayCast, type RayCastHit, ReAnimateHandlingType, type RectangleShapeData, RichText, type RichTextOptions, type RichTextRectangleCut, type RichTextStyles, SOUND_TRANSITION_DURATION, SPEED_LIMIT, Scene, SceneDecorator, ScrollAreaUI, ScrollDirection, type ScrollInContentOptions, ScrollMaskUI, Service, ServiceDecorator, type SetParentOptions, type ShapeDefinition, SingletonEntity, SlideInContent, SlideInContentByIndex, SlideStateAnimation, SlideStateAnimationState, Sound, type SoundDefinition, type SoundID, type SoundIDRegistry, type SoundOptions, Sprite, type SpriteDefinition, type SpriteID, type SpriteIDRegistry, StateAnimation, type StateAnimationOptions, type StateAnimationState, Text, type TextAlignment, type TextOptions, ThroughEmptyStateAnimation, UpdatableContainer, UpdateCycle, VectorFieldPathFinder, VectorSet, View, ViewDecorator, type ViewDecoratorMeta };
1379
+ interface ElectronAppOptions {
1380
+ readonly devMode: boolean;
1381
+ readonly maxScreenResolution: {
1382
+ readonly width: number;
1383
+ readonly height: number;
1384
+ } | undefined;
1385
+ }
1386
+ interface ElectronBridge {
1387
+ save(data: string | undefined, fileName: string): Promise<void>;
1388
+ load(fileName: string): Promise<string | undefined>;
1389
+ getOptions(): Promise<ElectronAppOptions>;
1390
+ setFullScreen(fullScreen: boolean): void;
1391
+ rendererReady(): void;
1392
+ onWindowFocus(callback: (focused: boolean) => void): () => void;
1393
+ quit(): void;
1394
+ }
1395
+ declare global {
1396
+ interface Window {
1397
+ api: ElectronBridge;
1398
+ }
1399
+ }
1400
+
1401
+ export { AdvancedSound, type AdvancedSoundOptions, AnimationFlicker, AnimationInterpolationFunctions, type AnimationOptions, Animations, AnimationsCompletionHandlingType, Animator, type AnimatorAnimation, type AssetDefinition, type AudioAppearTransitionType, BORDER_MATERIAL_NAME, BardLegendsTestingHelper, type BlendMode, type BorderProperties, Camera, CameraGateway, type CircleShapeData, ClosestAvailableSpaceHelper, type CollisionDetails, type CollisionReport, Container, ContainerEventType, ControllerDecorator, type CreateDashedLineOptions, type CreatePhysicsWorldRequestDTO, Cursor, DEFAULT_SHADER_RESOLUTION, DeltaTime, DisplayObjectArray, type DisplayObjectArrayOptions, type DropShadowOptions, type ElectronAppOptions, type ElectronBridge, ElectronGame, Entity, EntityDecorator, type EntityID, type ExplosionHit, FadeInContent, type FadeInContentOptions, FocusingAnimation, Game, Gateway, type GlowEffectOptions, type GlowOptions, type GlowingShapeDefinition, Graphics, type HitTestOptions, ImmovablePhysicsEntity, type InteractingBodyGroups, type KeyboardKeyInfo, KeyboardService, LayoutContainer, type LayoutStyle, type MapSizeDTO, type MaterialContactDefinition, type MaterialDefinition, MenuEntity, type MenuOptions, MenuUI, MenuView, MouseService, MouseTargetFocusService, MovableEntity, MovablePhysicsEntity, Music, MusicPlayer, type MusicPlayerOptions, type PartialTextOptions, PathFinder, type PathFinderResult, type PhysicsBodyDTO, PhysicsEntity, type PhysicsEntityDefinition, type PhysicsExplosionOptions, PhysicsGateway, PhysicsShapeType, type PhysicsWorldID, Placeholder, type PolygonDefinition, type PolygonShapeData, ROTATIONAL_SPEED_LIMIT, type RayCast, type RayCastHit, ReAnimateHandlingType, type RectangleShapeData, RichText, type RichTextOptions, type RichTextRectangleCut, type RichTextStyles, SOUND_TRANSITION_DURATION, SPEED_LIMIT, Scene, SceneDecorator, ScrollAreaUI, ScrollDirection, type ScrollInContentOptions, ScrollMaskUI, Service, ServiceDecorator, type SetParentOptions, type ShapeDefinition, SingletonEntity, SlideInContent, SlideInContentByIndex, SlideStateAnimation, SlideStateAnimationState, Sound, type SoundDefinition, type SoundID, type SoundIDRegistry, type SoundOptions, Sprite, type SpriteDefinition, type SpriteID, type SpriteIDRegistry, StateAnimation, type StateAnimationOptions, type StateAnimationState, Text, type TextAlignment, type TextOptions, ThroughEmptyStateAnimation, UpdatableContainer, UpdateCycle, VectorFieldPathFinder, VectorSet, View, ViewDecorator, type ViewDecoratorMeta };