@laplace.live/pixijs-live2d 0.1.0 → 0.3.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/extra.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Graphics, Renderer, Text } from "pixi.js";
2
2
  //#region src/tools/HitAreaFrames.d.ts
3
- declare class HitAreaFrames extends Graphics {
3
+ export declare class HitAreaFrames extends Graphics {
4
4
  initialized: boolean;
5
5
  texts: Text[];
6
6
  strokeWidth: number;
@@ -12,5 +12,4 @@ declare class HitAreaFrames extends Graphics {
12
12
  protected _render(renderer: Renderer): void;
13
13
  }
14
14
  //#endregion
15
- export { HitAreaFrames };
16
15
  //# sourceMappingURL=extra.d.ts.map
package/dist/index.d.ts CHANGED
@@ -103,17 +103,17 @@ declare class CubismIdManager {
103
103
  }
104
104
  //#endregion
105
105
  //#region vendor/cubism/src/live2dcubismframework.d.ts
106
- declare function strtod(s: string, endPtr: string[]): number;
106
+ export declare function strtod(s: string, endPtr: string[]): number;
107
107
  /**
108
108
  * Framework内で使う定数の宣言
109
109
  */
110
- declare const Constant: Readonly<Record<string, number>>;
111
- declare function csmDelete<T>(address: T): void;
110
+ export declare const Constant: Readonly<Record<string, number>>;
111
+ export declare function csmDelete<T>(address: T): void;
112
112
  /**
113
113
  * Live2D Cubism SDK Original Workflow SDKのエントリポイント
114
114
  * 利用開始時はCubismFramework.initialize()を呼び、CubismFramework.dispose()で終了する。
115
115
  */
116
- declare class CubismFramework {
116
+ export declare class CubismFramework {
117
117
  /**
118
118
  * Cubism FrameworkのAPIを使用可能にする。
119
119
  * APIを実行する前に必ずこの関数を実行すること。
@@ -178,14 +178,14 @@ declare class CubismFramework {
178
178
  */
179
179
  private constructor();
180
180
  }
181
- declare class Option {
181
+ export declare class Option {
182
182
  logFunction: Live2DCubismCore.csmLogFunction;
183
183
  loggingLevel: LogLevel;
184
184
  }
185
185
  /**
186
186
  * ログ出力のレベル
187
187
  */
188
- declare enum LogLevel {
188
+ export declare enum LogLevel {
189
189
  LogLevel_Verbose = 0 // 詳細ログ
190
190
  ,
191
191
  LogLevel_Debug = 1 // デバッグログ
@@ -200,8 +200,8 @@ declare enum LogLevel {
200
200
  }
201
201
  //#endregion
202
202
  //#region src/cubism-common/constants.d.ts
203
- declare const LOGICAL_WIDTH = 2;
204
- declare const LOGICAL_HEIGHT = 2;
203
+ export declare const LOGICAL_WIDTH = 2;
204
+ export declare const LOGICAL_HEIGHT = 2;
205
205
  //#endregion
206
206
  //#region src/types/helpers.d.ts
207
207
  type JSONObject = object;
@@ -211,7 +211,7 @@ type Mutable<T> = { -readonly [P in keyof T]: T[P]; };
211
211
  /**
212
212
  * Parses, and provides access to the settings JSON.
213
213
  */
214
- declare abstract class ModelSettings {
214
+ export declare abstract class ModelSettings {
215
215
  json: JSONObject;
216
216
  /**
217
217
  * The model's name, typically used for displaying or logging. By default it's inferred from
@@ -2724,7 +2724,7 @@ interface CommonLayout {
2724
2724
  /**
2725
2725
  * Indicates the motion priority.
2726
2726
  */
2727
- declare enum MotionPriority {
2727
+ export declare enum MotionPriority {
2728
2728
  /** States that the model is currently not playing any motion. This priority cannot be applied to a motion. */
2729
2729
  NONE = 0,
2730
2730
  /** Low priority, used when starting idle motions automatically. */
@@ -2737,7 +2737,7 @@ declare enum MotionPriority {
2737
2737
  /**
2738
2738
  * Handles the state of a MotionManager.
2739
2739
  */
2740
- declare class MotionState {
2740
+ export declare class MotionState {
2741
2741
  /**
2742
2742
  * Tag for logging.
2743
2743
  */
@@ -2937,7 +2937,7 @@ declare abstract class ParallelMotionManager<Motion = never, MotionSpec = never>
2937
2937
  /**
2938
2938
  * Interpolates the transition of focus position.
2939
2939
  */
2940
- declare class FocusController {
2940
+ export declare class FocusController {
2941
2941
  /** The focus position. */
2942
2942
  targetX: number;
2943
2943
  /** The focus position. */
@@ -2968,19 +2968,19 @@ declare class FocusController {
2968
2968
  /**
2969
2969
  * Common hit area definition shared between all Cubism versions.
2970
2970
  */
2971
- interface CommonHitArea {
2971
+ export interface CommonHitArea {
2972
2972
  id: string;
2973
2973
  name: string;
2974
2974
  index: number;
2975
2975
  }
2976
- declare function normalizeHitAreaDefs(raw: unknown, resolveIndex: (id: string) => number): CommonHitArea[];
2977
- interface Bounds {
2976
+ export declare function normalizeHitAreaDefs(raw: unknown, resolveIndex: (id: string) => number): CommonHitArea[];
2977
+ export interface Bounds {
2978
2978
  x: number;
2979
2979
  y: number;
2980
2980
  width: number;
2981
2981
  height: number;
2982
2982
  }
2983
- interface InternalModelOptions extends MotionManagerOptions {
2983
+ export interface InternalModelOptions extends MotionManagerOptions {
2984
2984
  /**
2985
2985
  * Define natural movements depth (0.0-1.0).
2986
2986
  * @default 1.0
@@ -3012,7 +3012,7 @@ interface InternalModelOptions extends MotionManagerOptions {
3012
3012
  * A wrapper that manages the states of a Live2D core model, and delegates all operations to it.
3013
3013
  * @emits {@link InternalModelEvents}
3014
3014
  */
3015
- declare abstract class InternalModel extends EventEmitter {
3015
+ export declare abstract class InternalModel extends EventEmitter {
3016
3016
  /**
3017
3017
  * The managed Live2D core model.
3018
3018
  */
@@ -3024,6 +3024,12 @@ declare abstract class InternalModel extends EventEmitter {
3024
3024
  abstract parallelMotionManager: ParallelMotionManager<CubismMotion>[];
3025
3025
  pose?: unknown;
3026
3026
  physics?: unknown;
3027
+ /**
3028
+ * Retune the idle breath live, where the engine has one — `breathDepth` is a construction
3029
+ * option, and a host that exposes it as a control needs to change it after load. Absent on a
3030
+ * model type with no breath, so callers skip rather than branch.
3031
+ */
3032
+ setBreath?(enabled: boolean, depth?: number): void;
3027
3033
  /**
3028
3034
  * Original canvas width of the model. Note this doesn't represent the model's real size,
3029
3035
  * as the model can overflow from its canvas.
@@ -3192,7 +3198,7 @@ declare abstract class InternalModel extends EventEmitter {
3192
3198
  }
3193
3199
  //#endregion
3194
3200
  //#region src/cubism-common/MotionManager.d.ts
3195
- interface MotionManagerOptions {
3201
+ export interface MotionManagerOptions {
3196
3202
  /**
3197
3203
  * How to preload the motions.
3198
3204
  * @default {@link MotionPreloadStrategy.NONE}
@@ -3209,7 +3215,7 @@ interface MotionManagerOptions {
3209
3215
  */
3210
3216
  checkMotionConsistency?: boolean;
3211
3217
  }
3212
- interface MotionStartOptions {
3218
+ export interface MotionStartOptions {
3213
3219
  sound?: string;
3214
3220
  volume?: number;
3215
3221
  expression?: number | string;
@@ -3222,11 +3228,11 @@ interface MotionStartOptions {
3222
3228
  */
3223
3229
  loop?: boolean;
3224
3230
  }
3225
- type MotionStartRandomOptions = Omit<MotionStartOptions, 'ignoreParamIds'>;
3231
+ export type MotionStartRandomOptions = Omit<MotionStartOptions, 'ignoreParamIds'>;
3226
3232
  /**
3227
3233
  * Indicates how the motions will be preloaded.
3228
3234
  */
3229
- declare enum MotionPreloadStrategy {
3235
+ export declare enum MotionPreloadStrategy {
3230
3236
  /** Preload all the motions. */
3231
3237
  ALL = "ALL",
3232
3238
  /** Preload only the idle motions. */
@@ -3239,7 +3245,7 @@ declare enum MotionPreloadStrategy {
3239
3245
  * Responsible for loading, playing, and managing motion states and audio.
3240
3246
  * @emits {@link MotionManagerEvents}
3241
3247
  */
3242
- declare abstract class MotionManager<Motion = unknown, MotionSpec = unknown> extends EventEmitter {
3248
+ export declare abstract class MotionManager<Motion = unknown, MotionSpec = unknown> extends EventEmitter {
3243
3249
  /**
3244
3250
  * Tag for logging.
3245
3251
  * @type {string}
@@ -3524,7 +3530,7 @@ declare abstract class MotionManager<Motion = unknown, MotionSpec = unknown> ext
3524
3530
  * any number can be active at once, each fading in/out on its own.
3525
3531
  * @emits {@link ExpressionManagerEvents}
3526
3532
  */
3527
- declare abstract class ExpressionManager<Expression = unknown, ExpressionSpec = unknown> extends EventEmitter<keyof ExpressionManagerEvents> {
3533
+ export declare abstract class ExpressionManager<Expression = unknown, ExpressionSpec = unknown> extends EventEmitter<keyof ExpressionManagerEvents> {
3528
3534
  /**
3529
3535
  * Indicates the content type used when loading expressions.
3530
3536
  * @default "json"
@@ -3687,11 +3693,11 @@ declare abstract class ExpressionManager<Expression = unknown, ExpressionSpec =
3687
3693
  }
3688
3694
  //#endregion
3689
3695
  //#region src/cubism-common/SoundManager.d.ts
3690
- declare const VOLUME = 0.5;
3696
+ export declare const VOLUME = 0.5;
3691
3697
  /**
3692
3698
  * Manages all the sounds.
3693
3699
  */
3694
- declare class SoundManager {
3700
+ export declare class SoundManager {
3695
3701
  /**
3696
3702
  * Audio elements playing or pending to play. Finished audios will be removed automatically.
3697
3703
  */
@@ -3867,7 +3873,7 @@ declare const CSM_LOG_LEVEL: number;
3867
3873
  /**
3868
3874
  * Global configs.
3869
3875
  */
3870
- declare const config: {
3876
+ export declare const config: {
3871
3877
  LOG_LEVEL_VERBOSE: number;
3872
3878
  LOG_LEVEL_WARNING: number;
3873
3879
  LOG_LEVEL_ERROR: number;
@@ -4014,7 +4020,7 @@ declare module '@/cubism-common/ModelSettings' {
4014
4020
  _objectURL?: string;
4015
4021
  }
4016
4022
  }
4017
- type ExtendedFileList = File[] & {
4023
+ export type ExtendedFileList = File[] & {
4018
4024
  settings?: ModelSettings;
4019
4025
  };
4020
4026
  /**
@@ -4027,7 +4033,7 @@ type ExtendedFileList = File[] & {
4027
4033
  * Though named as a "Loader", this class has nothing to do with Live2DLoader,
4028
4034
  * it only contains a middleware for the Live2DFactory.
4029
4035
  */
4030
- declare class FileLoader {
4036
+ export declare class FileLoader {
4031
4037
  static live2dFactory?: typeof Live2DFactory;
4032
4038
  /**
4033
4039
  * Stores all the object URLs of uploaded files.
@@ -4133,10 +4139,10 @@ declare class Automator {
4133
4139
  /**
4134
4140
  * Useless class. May be useful in the future.
4135
4141
  */
4136
- declare class Live2DTransform extends Transform {}
4142
+ export declare class Live2DTransform extends Transform {}
4137
4143
  //#endregion
4138
4144
  //#region src/Live2DModel.d.ts
4139
- interface Live2DModelOptions extends InternalModelOptions, AutomatorOptions {
4145
+ export interface Live2DModelOptions extends InternalModelOptions, AutomatorOptions {
4140
4146
  /**
4141
4147
  * Defines which bounds are used to resolve the normalized {@link Live2DModel.anchor}.
4142
4148
  * `'canvas'` preserves the historical model-canvas behavior, while `'drawable'`
@@ -4153,7 +4159,7 @@ interface Live2DModelOptions extends InternalModelOptions, AutomatorOptions {
4153
4159
  */
4154
4160
  textureOptions?: Live2DTextureSourceOptions;
4155
4161
  }
4156
- type Live2DConstructor = {
4162
+ export type Live2DConstructor = {
4157
4163
  new (options?: Live2DModelOptions): Live2DModel;
4158
4164
  };
4159
4165
  type Live2DPrepareInstruction = {
@@ -4194,7 +4200,7 @@ declare class Live2DPipe {
4194
4200
  * extensions.add(Live2DPlugin)
4195
4201
  * ```
4196
4202
  */
4197
- declare const Live2DPlugin: typeof Live2DPipe;
4203
+ export declare const Live2DPlugin: typeof Live2DPipe;
4198
4204
  /**
4199
4205
  * A wrapper that allows the Live2D model to be used as a DisplayObject in PixiJS.
4200
4206
  *
@@ -4204,7 +4210,7 @@ declare const Live2DPlugin: typeof Live2DPipe;
4204
4210
  * ```
4205
4211
  * @emits {@link Live2DModelEvents}
4206
4212
  */
4207
- declare class Live2DModel<IM extends InternalModel = InternalModel> extends Container {
4213
+ export declare class Live2DModel<IM extends InternalModel = InternalModel> extends Container {
4208
4214
  /** @internal */
4209
4215
  renderPipeId: string;
4210
4216
  /** @internal */
@@ -4515,7 +4521,7 @@ declare class Live2DModel<IM extends InternalModel = InternalModel> extends Cont
4515
4521
  }
4516
4522
  //#endregion
4517
4523
  //#region src/factory/Live2DFactory.d.ts
4518
- interface Live2DFactoryOptions extends Live2DModelOptions {
4524
+ export interface Live2DFactoryOptions extends Live2DModelOptions {
4519
4525
  /**
4520
4526
  * Whether to check the consistency of the moc file. It's an internal
4521
4527
  * function of Cubism core and only available since Cubism 4 R7.
@@ -4554,7 +4560,7 @@ interface Live2DFactoryOptions extends Live2DModelOptions {
4554
4560
  /**
4555
4561
  * The context transferred through the model creation middlewares.
4556
4562
  */
4557
- interface Live2DFactoryContext {
4563
+ export interface Live2DFactoryContext {
4558
4564
  source: any;
4559
4565
  options: Live2DFactoryOptions;
4560
4566
  live2dModel: Live2DModel;
@@ -4564,7 +4570,7 @@ interface Live2DFactoryContext {
4564
4570
  /**
4565
4571
  * Represents a Cubism version.
4566
4572
  */
4567
- interface Live2DRuntime {
4573
+ export interface Live2DRuntime {
4568
4574
  /**
4569
4575
  * The version number. Higher version takes priority when matching the runtime.
4570
4576
  */
@@ -4625,7 +4631,7 @@ interface Live2DRuntime {
4625
4631
  * - Motion loading: implements the load method of MotionManager.
4626
4632
  * - Expression loading: implements the load method of ExpressionManager.
4627
4633
  */
4628
- declare class Live2DFactory {
4634
+ export declare class Live2DFactory {
4629
4635
  /**
4630
4636
  * All registered runtimes, sorted by versions in descending order.
4631
4637
  */
@@ -4689,11 +4695,11 @@ declare class Live2DFactory {
4689
4695
  }
4690
4696
  //#endregion
4691
4697
  //#region src/factory/Live2DLoader.d.ts
4692
- type Live2DLoaderTarget = Live2DModel | InternalModel | MotionManager | ExpressionManager;
4698
+ export type Live2DLoaderTarget = Live2DModel | InternalModel | MotionManager | ExpressionManager;
4693
4699
  /**
4694
4700
  * The context transferred through Live2DLoader middlewares.
4695
4701
  */
4696
- interface Live2DLoaderContext {
4702
+ export interface Live2DLoaderContext {
4697
4703
  /** The XHR's response type. */
4698
4704
  type: XMLHttpRequestResponseType;
4699
4705
  /** Will be resolved by {@link ModelSettings.resolveURL} if a ModelSettings is provided. */
@@ -4708,7 +4714,7 @@ interface Live2DLoaderContext {
4708
4714
  /** Loaded data. */
4709
4715
  result?: unknown;
4710
4716
  }
4711
- declare class Live2DLoader {
4717
+ export declare class Live2DLoader {
4712
4718
  static middlewares: Middleware<Live2DLoaderContext>[];
4713
4719
  /**
4714
4720
  * Loads a resource.
@@ -4726,7 +4732,7 @@ declare class Live2DLoader {
4726
4732
  * - `status` - The HTTP status.
4727
4733
  * - `aborted` - True if the error is caused by aborting the XHR.
4728
4734
  */
4729
- declare class XHRLoader {
4735
+ export declare class XHRLoader {
4730
4736
  /**
4731
4737
  * All the created XHRs, keyed by their owners respectively.
4732
4738
  */
@@ -4762,7 +4768,7 @@ declare class XHRLoader {
4762
4768
  /**
4763
4769
  * Remove an element from array.
4764
4770
  */
4765
- declare function remove<T>(array: T[], item: T): void;
4771
+ export declare function remove<T>(array: T[], item: T): void;
4766
4772
  //#endregion
4767
4773
  //#region src/utils/log.d.ts
4768
4774
  /**
@@ -4778,7 +4784,7 @@ declare function remove<T>(array: T[], item: T): void;
4778
4784
  * };
4779
4785
  * ```
4780
4786
  */
4781
- declare const logger: {
4787
+ export declare const logger: {
4782
4788
  log(tag: string, ...messages: unknown[]): void;
4783
4789
  warn(tag: string, ...messages: unknown[]): void;
4784
4790
  error(tag: string, ...messages: unknown[]): void;
@@ -4789,9 +4795,9 @@ declare const logger: {
4789
4795
  * These functions can be slightly faster than the ones in Lodash.
4790
4796
  * @packageDocumentation
4791
4797
  */
4792
- declare function clamp(num: number, lower: number, upper: number): number;
4793
- declare function rand(min: number, max: number): number;
4794
- declare function MBToByte(value: number): number;
4798
+ export declare function clamp(num: number, lower: number, upper: number): number;
4799
+ export declare function rand(min: number, max: number): number;
4800
+ export declare function MBToByte(value: number): number;
4795
4801
  //#endregion
4796
4802
  //#region src/utils/obj.d.ts
4797
4803
  /**
@@ -4802,7 +4808,7 @@ declare function MBToByte(value: number): number;
4802
4808
  * @param fromKey - Key of the property in source object.
4803
4809
  * @param toKey - Key of the property in destination object.
4804
4810
  */
4805
- declare function copyProperty<From, FromKey extends keyof From, ToKey extends keyof any, To extends Partial<Record<ToKey, From[FromKey]>>>(type: string, from: From, to: To, fromKey: FromKey, toKey: ToKey): void;
4811
+ export declare function copyProperty<From, FromKey extends keyof From, ToKey extends keyof any, To extends Partial<Record<ToKey, From[FromKey]>>>(type: string, from: From, to: To, fromKey: FromKey, toKey: ToKey): void;
4806
4812
  /**
4807
4813
  * Copies an array at `key`, filtering the items that match the `type`.
4808
4814
  * @param type - Type expected to match `typeof` on the items.
@@ -4811,11 +4817,11 @@ declare function copyProperty<From, FromKey extends keyof From, ToKey extends ke
4811
4817
  * @param fromKey - Key of the array property in source object.
4812
4818
  * @param toKey - Key of the array property in destination object.
4813
4819
  */
4814
- declare function copyArray<FromKey extends keyof any, From extends Partial<Record<FromKey, any[]>>, ToKey extends keyof any, To extends Partial<Record<ToKey, any[]>>>(type: string, from: From, to: To, fromKey: FromKey, toKey: ToKey): void;
4820
+ export declare function copyArray<FromKey extends keyof any, From extends Partial<Record<FromKey, any[]>>, ToKey extends keyof any, To extends Partial<Record<ToKey, any[]>>>(type: string, from: From, to: To, fromKey: FromKey, toKey: ToKey): void;
4815
4821
  /**
4816
4822
  * @see {@link https://www.typescriptlang.org/docs/handbook/mixins.html}
4817
4823
  */
4818
- declare function applyMixins(derivedCtor: new (...args: any[]) => any, baseCtors: Array<new (...args: any[]) => any>): void;
4824
+ export declare function applyMixins(derivedCtor: new (...args: any[]) => any, baseCtors: Array<new (...args: any[]) => any>): void;
4819
4825
  //#endregion
4820
4826
  //#region src/utils/string.d.ts
4821
4827
  /**
@@ -4823,15 +4829,16 @@ declare function applyMixins(derivedCtor: new (...args: any[]) => any, baseCtors
4823
4829
  * @param url - URL of a file.
4824
4830
  * @return Name of the parent folder, or the file itself if it has no parent folder.
4825
4831
  */
4826
- declare function folderName(url: string): string;
4832
+ export declare function folderName(url: string): string;
4827
4833
  //#endregion
4828
4834
  //#region src/utils/url.d.ts
4829
4835
  /**
4830
4836
  * Resolves a path/URL against a base string without relying on Node's `url` module.
4831
4837
  */
4832
- declare function resolveURL(base: string, path: string): string;
4833
- //#endregion
4834
- //#region src/types/cubism-shim.d.ts
4838
+ export declare function resolveURL(base: string, path: string): string;
4839
+ declare namespace cubism_shim_d_exports {
4840
+ export { Expression, FileReferences, Group, HitArea, ModelJSON, Motion };
4841
+ }
4835
4842
  interface Motion {
4836
4843
  File: string;
4837
4844
  FadeInTime?: number;
@@ -5704,8 +5711,8 @@ declare class CubismModelSettingJson extends ICubismModelSetting {
5704
5711
  //#endregion
5705
5712
  //#region src/cubism/CubismModelSettings.d.ts
5706
5713
  type CubismModelSettingJsonMixin = Omit<CubismModelSettingJson, 'name'>;
5707
- interface CubismModelSettings extends CubismModelSettingJsonMixin {}
5708
- declare class CubismModelSettings extends ModelSettings {
5714
+ export interface CubismModelSettings extends CubismModelSettingJsonMixin {}
5715
+ export declare class CubismModelSettings extends ModelSettings {
5709
5716
  json: ModelJSON;
5710
5717
  moc: string;
5711
5718
  textures: string[];
@@ -5730,7 +5737,7 @@ declare class CubismModelSettings extends ModelSettings {
5730
5737
  }
5731
5738
  //#endregion
5732
5739
  //#region src/cubism/CubismExpressionManager.d.ts
5733
- declare class CubismExpressionManager extends ExpressionManager<CubismExpressionMotion, Expression> {
5740
+ export declare class CubismExpressionManager extends ExpressionManager<CubismExpressionMotion, Expression> {
5734
5741
  readonly expressionDataType: "arraybuffer";
5735
5742
  readonly definitions: Expression[];
5736
5743
  /** Active fade entries in activation order; deactivated ones stay until fully faded out. */
@@ -6897,7 +6904,7 @@ declare class CubismRenderer_WebGL extends CubismRenderer {
6897
6904
  }
6898
6905
  //#endregion
6899
6906
  //#region src/cubism/CubismMotionManager.d.ts
6900
- declare class CubismMotionManager extends MotionManager<CubismMotion, Motion> {
6907
+ export declare class CubismMotionManager extends MotionManager<CubismMotion, Motion> {
6901
6908
  readonly definitions: Partial<Record<string, Motion[]>>;
6902
6909
  readonly groups: {
6903
6910
  readonly idle: "Idle";
@@ -6926,7 +6933,7 @@ declare class CubismMotionManager extends MotionManager<CubismMotion, Motion> {
6926
6933
  }
6927
6934
  //#endregion
6928
6935
  //#region src/cubism/CubismParallelMotionManager.d.ts
6929
- declare class CubismParallelMotionManager extends ParallelMotionManager<CubismMotion, Motion> {
6936
+ export declare class CubismParallelMotionManager extends ParallelMotionManager<CubismMotion, Motion> {
6930
6937
  readonly queueManager: CubismMotionQueueManager;
6931
6938
  readonly settings: CubismModelSettings;
6932
6939
  constructor(parent: CubismInternalModel);
@@ -6941,7 +6948,7 @@ declare class CubismParallelMotionManager extends ParallelMotionManager<CubismMo
6941
6948
  }
6942
6949
  //#endregion
6943
6950
  //#region src/cubism/CubismInternalModel.d.ts
6944
- declare class CubismInternalModel extends InternalModel {
6951
+ export declare class CubismInternalModel extends InternalModel {
6945
6952
  settings: CubismModelSettings;
6946
6953
  options: InternalModelOptions;
6947
6954
  coreModel: CubismModel;
@@ -6949,6 +6956,8 @@ declare class CubismInternalModel extends InternalModel {
6949
6956
  parallelMotionManager: CubismParallelMotionManager[];
6950
6957
  lipSync: boolean;
6951
6958
  breath: CubismBreath;
6959
+ /** Whether the idle breath contributes at all; see {@link setBreath}. */
6960
+ breathEnabled: boolean;
6952
6961
  eyeBlink?: CubismEyeBlink;
6953
6962
  pose?: CubismPose;
6954
6963
  physics?: CubismPhysics;
@@ -6988,6 +6997,16 @@ declare class CubismInternalModel extends InternalModel {
6988
6997
  update(dt: DOMHighResTimeStamp, now: DOMHighResTimeStamp): void;
6989
6998
  updateFocus(): void;
6990
6999
  updateFacialEmotion(mouthForm: number): void;
7000
+ /**
7001
+ * The idle breath set, scaled by `breathDepth`. Amplitudes and periods are the Cubism sample's
7002
+ * own: a head sway across `ParamAngle*`/`ParamBodyAngleX` alongside `ParamBreath` itself.
7003
+ */
7004
+ protected applyBreathParameters(): void;
7005
+ /**
7006
+ * Retune the idle breath live. `enabled: false` stops the contribution outright rather than
7007
+ * scaling it to nothing, so a host can turn it off without losing the depth it returns to.
7008
+ */
7009
+ setBreath(enabled: boolean, depth?: number): void;
6991
7010
  updateNaturalMovements(dt: DOMHighResTimeStamp, _now: DOMHighResTimeStamp): void;
6992
7011
  draw(gl: WebGLRenderingContext): void;
6993
7012
  extendParallelMotionManager(managerCount: number): void;
@@ -7004,20 +7023,20 @@ interface CubismConfig {
7004
7023
  /**
7005
7024
  * Configures global Cubism startup settings.
7006
7025
  */
7007
- declare function configureCubismSDK(config?: CubismConfig): void;
7026
+ export declare function configureCubismSDK(config?: CubismConfig): void;
7008
7027
  /**
7009
7028
  * Promises that the Cubism framework is ready to work.
7010
7029
  * @return Promise that resolves if the startup has succeeded, rejects if failed.
7011
7030
  */
7012
- declare function cubismReady(): Promise<void>;
7031
+ export declare function cubismReady(): Promise<void>;
7013
7032
  /**
7014
7033
  * Starts up the Cubism framework.
7015
7034
  */
7016
- declare function startUpCubism(options?: Option, memorySizeMB?: number): void;
7035
+ export declare function startUpCubism(options?: Option, memorySizeMB?: number): void;
7017
7036
  /**
7018
7037
  * Reconfigures Cubism settings and restarts the framework so they take effect.
7019
7038
  */
7020
- declare function reconfigureCubismSDK(config?: CubismConfig): void;
7039
+ export declare function reconfigureCubismSDK(config?: CubismConfig): void;
7021
7040
  //#endregion
7022
- export { Bounds, CommonHitArea, type CommonLayout, Constant, type CreateTextureOptions, CubismExpressionManager, CubismFramework, CubismInternalModel, CubismModelSettings, CubismMotionManager, CubismParallelMotionManager, ExpressionManager, type ExpressionManagerEvents, ExtendedFileList, FileLoader, FocusController, InternalModel, type InternalModelEvents, InternalModelOptions, type JSONObject, LOGICAL_HEIGHT, LOGICAL_WIDTH, Live2DConstructor, Live2DFactory, Live2DFactoryContext, Live2DFactoryOptions, Live2DLoader, Live2DLoaderContext, Live2DLoaderTarget, Live2DModel, type Live2DModelEvents, Live2DModelOptions, Live2DPlugin, Live2DRuntime, type Live2DTextureLODFilter, type Live2DTextureLODMode, type Live2DTextureLODOptions, type Live2DTextureSourceOptions, Live2DTransform, LogLevel, MBToByte, ModelSettings, MotionManager, type MotionManagerEvents, MotionManagerOptions, MotionPreloadStrategy, MotionPriority, MotionStartOptions, MotionStartRandomOptions, MotionState, type Mutable, Option, SoundManager, type TextureLODPlan, type TextureLODPlanInput, VOLUME, XHRLoader, applyMixins, clamp, config, configureCubismSDK, copyArray, copyProperty, csmDelete, cubismReady, folderName, logger, normalizeHitAreaDefs, rand, reconfigureCubismSDK, remove, resolveURL, startUpCubism, strtod };
7041
+ export type { CommonLayout, CreateTextureOptions, ExpressionManagerEvents, InternalModelEvents, JSONObject, Live2DModelEvents, Live2DTextureLODFilter, Live2DTextureLODMode, Live2DTextureLODOptions, Live2DTextureSourceOptions, MotionManagerEvents, Mutable, TextureLODPlan, TextureLODPlanInput };
7023
7042
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -15140,6 +15140,8 @@ var CubismInternalModel = class extends InternalModel {
15140
15140
  parallelMotionManager;
15141
15141
  lipSync = true;
15142
15142
  breath = CubismBreath.create();
15143
+ /** Whether the idle breath contributes at all; see {@link setBreath}. */
15144
+ breathEnabled = true;
15143
15145
  eyeBlink;
15144
15146
  renderer = new CubismRenderer_WebGL(0, 0);
15145
15147
  idManager;
@@ -15192,13 +15194,7 @@ var CubismInternalModel = class extends InternalModel {
15192
15194
  eyeBlink.setParameterIds?.(parameterIds);
15193
15195
  this.eyeBlink = eyeBlink;
15194
15196
  }
15195
- this.breath.setParameters([
15196
- new BreathParameterData(this.idParamAngleX, 0, 15 * this.options.breathDepth, 6.5345, .5),
15197
- new BreathParameterData(this.idParamAngleY, 0, 8 * this.options.breathDepth, 3.5345, .5),
15198
- new BreathParameterData(this.idParamAngleZ, 0, 10 * this.options.breathDepth, 5.5345, .5),
15199
- new BreathParameterData(this.idParamBodyAngleX, 0, 4 * this.options.breathDepth, 15.5345, .5),
15200
- new BreathParameterData(this.idParamBreath, 0, .5, 3.2345, .5)
15201
- ]);
15197
+ this.applyBreathParameters();
15202
15198
  this.renderer.initialize(this.coreModel, getRequiredMaskRenderTextureCount(this.coreModel));
15203
15199
  this.renderer.useHighPrecisionMask(this.renderer.isUsingHighPrecisionMask() || resolveHighPrecisionMaskOption(this.coreModel, this.options.useHighPrecisionMask));
15204
15200
  this.renderer.setIsPremultipliedAlpha(true);
@@ -15315,8 +15311,31 @@ var CubismInternalModel = class extends InternalModel {
15315
15311
  updateFacialEmotion(mouthForm) {
15316
15312
  this.coreModel.addParameterValueById(this.idParamMouthForm, mouthForm);
15317
15313
  }
15314
+ /**
15315
+ * The idle breath set, scaled by `breathDepth`. Amplitudes and periods are the Cubism sample's
15316
+ * own: a head sway across `ParamAngle*`/`ParamBodyAngleX` alongside `ParamBreath` itself.
15317
+ */
15318
+ applyBreathParameters() {
15319
+ const depth = this.options.breathDepth ?? 1;
15320
+ this.breath.setParameters([
15321
+ new BreathParameterData(this.idParamAngleX, 0, 15 * depth, 6.5345, .5),
15322
+ new BreathParameterData(this.idParamAngleY, 0, 8 * depth, 3.5345, .5),
15323
+ new BreathParameterData(this.idParamAngleZ, 0, 10 * depth, 5.5345, .5),
15324
+ new BreathParameterData(this.idParamBodyAngleX, 0, 4 * depth, 15.5345, .5),
15325
+ new BreathParameterData(this.idParamBreath, 0, .5 * depth, 3.2345, .5)
15326
+ ]);
15327
+ }
15328
+ /**
15329
+ * Retune the idle breath live. `enabled: false` stops the contribution outright rather than
15330
+ * scaling it to nothing, so a host can turn it off without losing the depth it returns to.
15331
+ */
15332
+ setBreath(enabled, depth = this.options.breathDepth ?? 1) {
15333
+ this.breathEnabled = enabled;
15334
+ this.options.breathDepth = depth;
15335
+ this.applyBreathParameters();
15336
+ }
15318
15337
  updateNaturalMovements(dt, _now) {
15319
- this.breath?.updateParameters(this.coreModel, dt / 1e3);
15338
+ if (this.breathEnabled) this.breath?.updateParameters(this.coreModel, dt / 1e3);
15320
15339
  }
15321
15340
  draw(gl) {
15322
15341
  const matrix = this.drawingMatrix;