forked from stevenjoezhang/live2d-widget
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinterface.ts
62 lines (55 loc) · 1.17 KB
/
interface.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/// API interface
/** Model info */
export type ModelInfo = {
model: {
id: number;
message: string;
};
};
/** Texture info */
export type TextureInfo = {
textures: {
id: number;
};
};
/** API interface */
export interface IApi {
/**
* Get model & texture by IDs
*
* @param mid Model ID
* @param tid Texture ID
* @returns Model JSON file URL
*/
get(mid: number, tid: number): string | Promise<string>;
/**
* Get random model info
*
* @param mid Current model ID
* @returns Model info
*/
rand(mid: number): ModelInfo | Promise<ModelInfo>;
/**
* Get next model info
*
* @param mid Current model ID
* @returns Model info
*/
switch(mid: number): ModelInfo | Promise<ModelInfo>;
/**
* Get random texture info
*
* @param mid Current model ID
* @param tid Current texture ID
* @returns Texture info
*/
randTexture(mid: number, tid: number): TextureInfo | Promise<TextureInfo>;
/**
* Get next texture info
*
* @param mid Current model ID
* @param tid Current texture ID
* @returns Texture info
*/
switchTexture(mid: number, tid: number): TextureInfo | Promise<TextureInfo>;
}