@doki-land/live2d-core 0.0.24 → 0.0.25
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/README.md +13 -13
- package/dist/index.d.ts +1 -9
- package/package.json +1 -1
- package/src/events.ts +0 -7
- package/src/index.ts +0 -8
- package/src/session.ts +0 -3
package/README.md
CHANGED
|
@@ -41,11 +41,11 @@ The package exposes types such as:
|
|
|
41
41
|
|
|
42
42
|
```ts
|
|
43
43
|
import type {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
AssetResolver,
|
|
45
|
+
FrameSnapshot,
|
|
46
|
+
Live2dSession,
|
|
47
|
+
ModelSettings,
|
|
48
|
+
ModelSource,
|
|
49
49
|
} from "@doki-land/live2d-core";
|
|
50
50
|
```
|
|
51
51
|
|
|
@@ -54,14 +54,14 @@ behavior:
|
|
|
54
54
|
|
|
55
55
|
```ts
|
|
56
56
|
const resolver: AssetResolver = {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
57
|
+
async fetchJson(url) {
|
|
58
|
+
const response = await fetch(url);
|
|
59
|
+
return response.json();
|
|
60
|
+
},
|
|
61
|
+
async fetchBytes(url) {
|
|
62
|
+
const response = await fetch(url);
|
|
63
|
+
return response.arrayBuffer();
|
|
64
|
+
},
|
|
65
65
|
};
|
|
66
66
|
```
|
|
67
67
|
|
package/dist/index.d.ts
CHANGED
|
@@ -98,12 +98,6 @@ type Live2dEventMap = {
|
|
|
98
98
|
};
|
|
99
99
|
type Live2dEventName = keyof Live2dEventMap;
|
|
100
100
|
type Live2dListener<K extends Live2dEventName> = (payload: Live2dEventMap[K]) => void;
|
|
101
|
-
/** @deprecated Use `Live2dEventMap`. */
|
|
102
|
-
type Live2DEventMap = Live2dEventMap;
|
|
103
|
-
/** @deprecated Use `Live2dEventName`. */
|
|
104
|
-
type Live2DEventName = Live2dEventName;
|
|
105
|
-
/** @deprecated Use `Live2dListener`. */
|
|
106
|
-
type Live2DListener<K extends Live2dEventName> = Live2dListener<K>;
|
|
107
101
|
declare class EventEmitter {
|
|
108
102
|
#private;
|
|
109
103
|
on<K extends Live2dEventName>(event: K, listener: Live2dListener<K>): () => void;
|
|
@@ -268,8 +262,6 @@ interface Live2dSession {
|
|
|
268
262
|
hitTest(x: number, y: number): string | null;
|
|
269
263
|
destroy(): void;
|
|
270
264
|
}
|
|
271
|
-
/** @deprecated Use `Live2dSession`. */
|
|
272
|
-
type Live2DSession = Live2dSession;
|
|
273
265
|
declare function createSessionStub(): Live2dSession;
|
|
274
266
|
|
|
275
267
|
/** Normalized stage placement for one actor (0,0) top-left → (1,1) bottom-right. */
|
|
@@ -427,4 +419,4 @@ interface Live2dStage {
|
|
|
427
419
|
|
|
428
420
|
declare const LIVE2D_CORE_VERSION: "0.0.0";
|
|
429
421
|
|
|
430
|
-
export { type ActorHit, type ActorInstance, type ActorTransform, type AssetKey, type AssetResolver, type CreateActorOptions, type CreateLive2dStageOptions, DEFAULT_ACTOR_TRANSFORM, type DrawableProgram, EventEmitter, type ExpressionDefinition, FrameBlendMode, type FrameDrawable, type FrameProfile, type FrameSnapshot, type HitAreaDefinition, type InternalModel, LIVE2D_CORE_VERSION, type
|
|
422
|
+
export { type ActorHit, type ActorInstance, type ActorTransform, type AssetKey, type AssetResolver, type CreateActorOptions, type CreateLive2dStageOptions, DEFAULT_ACTOR_TRANSFORM, type DrawableProgram, EventEmitter, type ExpressionDefinition, FrameBlendMode, type FrameDrawable, type FrameProfile, type FrameSnapshot, type HitAreaDefinition, type InternalModel, LIVE2D_CORE_VERSION, type Live2dActor, type Live2dEventMap, type Live2dEventName, type Live2dListener, type Live2dSession, type Live2dStage, type Live2dStageAssets, type LoadProgress, type LoadProgressStage, type ModelAsset, type ModelFormat, type ModelInstance, type ModelProgram, type ModelSettings, type ModelSource, type MotionDefinition, type ParameterProgram, type PlayMotionActorOptions, type PointerTrackingMode, type PointerTrackingPolicy, type SessionPhase, type SessionState, type StagePointerEvent, type StageUpdateMode, createSessionStub, detectModelSettingsFormat, modelSourceUrl };
|
package/package.json
CHANGED
package/src/events.ts
CHANGED
|
@@ -55,13 +55,6 @@ export type Live2dListener<K extends Live2dEventName> = (
|
|
|
55
55
|
payload: Live2dEventMap[K],
|
|
56
56
|
) => void;
|
|
57
57
|
|
|
58
|
-
/** @deprecated Use `Live2dEventMap`. */
|
|
59
|
-
export type Live2DEventMap = Live2dEventMap;
|
|
60
|
-
/** @deprecated Use `Live2dEventName`. */
|
|
61
|
-
export type Live2DEventName = Live2dEventName;
|
|
62
|
-
/** @deprecated Use `Live2dListener`. */
|
|
63
|
-
export type Live2DListener<K extends Live2dEventName> = Live2dListener<K>;
|
|
64
|
-
|
|
65
58
|
export class EventEmitter {
|
|
66
59
|
#listeners = new Map<string, Set<(payload: unknown) => void>>();
|
|
67
60
|
|
package/src/index.ts
CHANGED
|
@@ -24,12 +24,6 @@ export {
|
|
|
24
24
|
type Live2dListener,
|
|
25
25
|
type LoadProgress,
|
|
26
26
|
type LoadProgressStage,
|
|
27
|
-
/** @deprecated Use `Live2dEventMap`. */
|
|
28
|
-
type Live2DEventMap,
|
|
29
|
-
/** @deprecated Use `Live2dEventName`. */
|
|
30
|
-
type Live2DEventName,
|
|
31
|
-
/** @deprecated Use `Live2dListener`. */
|
|
32
|
-
type Live2DListener,
|
|
33
27
|
} from "./events.js";
|
|
34
28
|
export { detectModelSettingsFormat } from "./format/detect-format.js";
|
|
35
29
|
export {
|
|
@@ -59,8 +53,6 @@ export type {
|
|
|
59
53
|
export {
|
|
60
54
|
createSessionStub,
|
|
61
55
|
type Live2dSession,
|
|
62
|
-
/** @deprecated Use `Live2dSession`. */
|
|
63
|
-
type Live2DSession,
|
|
64
56
|
} from "./session.js";
|
|
65
57
|
export type {
|
|
66
58
|
ActorHit,
|
package/src/session.ts
CHANGED
|
@@ -27,9 +27,6 @@ export interface Live2dSession {
|
|
|
27
27
|
destroy(): void;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
/** @deprecated Use `Live2dSession`. */
|
|
31
|
-
export type Live2DSession = Live2dSession;
|
|
32
|
-
|
|
33
30
|
export function createSessionStub(): Live2dSession {
|
|
34
31
|
let canvas: HTMLCanvasElement | null = null;
|
|
35
32
|
let model: InternalModel | null = null;
|