@seayoo-web/pixi-live2d 0.0.9 → 0.1.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@seayoo-web/pixi-live2d",
3
3
  "description": "pixi-live2d viewer",
4
- "version": "0.0.9",
4
+ "version": "0.1.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",
package/types/index.d.ts CHANGED
@@ -1,5 +1,8 @@
1
- import { InternalModel, Live2DModel, MotionPriority } from "pixi-live2d-display/cubism4";
2
1
  import * as PIXI from "pixi.js";
2
+ declare const coreLoadPromise: Promise<boolean>;
3
+ export { coreLoadPromise };
4
+ import type { InternalModel as InternalModelType, Live2DModel as Live2DModelType } from "pixi-live2d-display/cubism4";
5
+ export type { MotionPriority } from "pixi-live2d-display/cubism4";
3
6
  declare global {
4
7
  interface Window {
5
8
  PIXI?: typeof PIXI;
@@ -28,12 +31,10 @@ export interface Live2DViewerOptions {
28
31
  /** 是否响应点击事件触发 TapBody 动作,默认为 true */
29
32
  enableTapBody?: boolean;
30
33
  /** 模型加载完成后的回调函数 */
31
- onModelLoaded?: (model: Live2DModel<InternalModel>) => void;
34
+ onModelLoaded?: (model: Live2DModelType<InternalModelType>) => void;
32
35
  /** 模型加载失败的回调函数 */
33
36
  onModelError?: (error: Error) => void;
34
37
  }
35
- export { MotionPriority } from "pixi-live2d-display/cubism4";
36
- export { Live2DModel } from "pixi-live2d-display/cubism4";
37
38
  export declare class Live2DViewer {
38
39
  /** 引擎加载状态 Promise,用于确保全局只加载一次 Core 库 */
39
40
  private static coreLoadingPromise;
@@ -45,7 +46,7 @@ export declare class Live2DViewer {
45
46
  /** PIXI 应用实例 */
46
47
  app: PIXI.Application;
47
48
  /** Live2D 模型实例 */
48
- model: Live2DModel<InternalModel> | null;
49
+ model: Live2DModelType<InternalModelType> | null;
49
50
  /** 配置项副本 */
50
51
  private options;
51
52
  /**
@@ -86,7 +87,7 @@ export declare class Live2DViewer {
86
87
  * @param startTime - 动作开始时间(秒),默认值为 0
87
88
  * @returns Promise,动作开始播放后 resolve
88
89
  */
89
- startMotion(group: string, no: number, priority?: MotionPriority, startTime?: number): Promise<boolean>;
90
+ startMotion(group: string, no: number, priority?: number, startTime?: number): Promise<boolean>;
90
91
  /**
91
92
  * 播放指定表情
92
93
  * @param name - 表情名称或索引
@@ -94,13 +95,6 @@ export declare class Live2DViewer {
94
95
  expression(name: string | number): Promise<boolean> | undefined;
95
96
  /** 等待当前动作播放结束 */
96
97
  waitForMotionFinish(): Promise<boolean>;
97
- /**
98
- * 启用动作循环播放模式
99
- * 从第 startTime 秒开始循环播放,直到动画结束
100
- * @param startTime - 循环开始时间(秒),默认为 2 秒
101
- * @returns 停止循环的函数
102
- */
103
- loop(startTime?: number): () => void;
104
98
  /** 销毁实例,清理资源和监听器 */
105
99
  destroy(): void;
106
100
  }