@next2d/media 1.18.11 → 2.0.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.
Files changed (110) hide show
  1. package/README.md +2 -2
  2. package/package.json +13 -26
  3. package/src/MediaUtil.d.ts +104 -0
  4. package/src/MediaUtil.js +203 -0
  5. package/src/Sound/service/SoundDecodeService.d.ts +10 -0
  6. package/src/Sound/service/SoundDecodeService.js +30 -0
  7. package/src/Sound/service/SoundEndedEventService.d.ts +11 -0
  8. package/src/Sound/service/SoundEndedEventService.js +21 -0
  9. package/src/Sound/service/SoundLoadStartEventService.d.ts +12 -0
  10. package/src/Sound/service/SoundLoadStartEventService.js +19 -0
  11. package/src/Sound/service/SoundProgressEventService.d.ts +12 -0
  12. package/src/Sound/service/SoundProgressEventService.js +16 -0
  13. package/src/Sound/usecase/SoundBuildFromCharacterUseCase.d.ts +13 -0
  14. package/src/Sound/usecase/SoundBuildFromCharacterUseCase.js +23 -0
  15. package/src/Sound/usecase/SoundLoadEndEventUseCase.d.ts +12 -0
  16. package/src/Sound/usecase/SoundLoadEndEventUseCase.js +35 -0
  17. package/src/Sound/usecase/SoundLoadUseCase.d.ts +13 -0
  18. package/src/Sound/usecase/SoundLoadUseCase.js +38 -0
  19. package/src/Sound.d.ts +136 -0
  20. package/src/Sound.js +247 -0
  21. package/src/SoundMixer/service/SoundMixerStopAllService.d.ts +9 -0
  22. package/src/SoundMixer/service/SoundMixerStopAllService.js +32 -0
  23. package/src/SoundMixer/service/SoundMixerUpdateVolumeService.d.ts +9 -0
  24. package/src/SoundMixer/service/SoundMixerUpdateVolumeService.js +29 -0
  25. package/src/SoundMixer.d.ts +28 -0
  26. package/src/SoundMixer.js +37 -0
  27. package/src/SoundTransform.d.ts +35 -0
  28. package/src/SoundTransform.js +48 -0
  29. package/src/Video/service/VideoApplyChangesService.d.ts +11 -0
  30. package/src/Video/service/VideoApplyChangesService.js +16 -0
  31. package/src/Video/service/VideoCreateElementService.d.ts +9 -0
  32. package/src/Video/service/VideoCreateElementService.js +16 -0
  33. package/src/Video/service/VideoEndedEventService.d.ts +11 -0
  34. package/src/Video/service/VideoEndedEventService.js +22 -0
  35. package/src/Video/service/VideoLoadedmetadataEventService.d.ts +12 -0
  36. package/src/Video/service/VideoLoadedmetadataEventService.js +21 -0
  37. package/src/Video/service/VideoProgressEventService.d.ts +11 -0
  38. package/src/Video/service/VideoProgressEventService.js +15 -0
  39. package/src/Video/usecase/VideoBuildFromCharacterUseCase.d.ts +13 -0
  40. package/src/Video/usecase/VideoBuildFromCharacterUseCase.js +22 -0
  41. package/src/Video/usecase/VideoCanplaythroughEventUseCase.d.ts +11 -0
  42. package/src/Video/usecase/VideoCanplaythroughEventUseCase.js +26 -0
  43. package/src/Video/usecase/VideoPlayEventUseCase.d.ts +11 -0
  44. package/src/Video/usecase/VideoPlayEventUseCase.js +31 -0
  45. package/src/Video/usecase/VideoRegisterEventUseCase.d.ts +12 -0
  46. package/src/Video/usecase/VideoRegisterEventUseCase.js +29 -0
  47. package/src/Video.d.ts +245 -0
  48. package/src/Video.js +428 -0
  49. package/{dist → src}/index.d.ts +1 -0
  50. package/{dist → src}/index.js +1 -0
  51. package/src/interface/IAjaxEvent.d.ts +5 -0
  52. package/src/interface/IAjaxEvent.js +1 -0
  53. package/src/interface/IAjaxOption.d.ts +13 -0
  54. package/src/interface/IAjaxOption.js +1 -0
  55. package/src/interface/IBlendMode.d.ts +1 -0
  56. package/src/interface/IBlendMode.js +1 -0
  57. package/src/interface/IBounds.d.ts +6 -0
  58. package/src/interface/IBounds.js +1 -0
  59. package/src/interface/ICharacter.d.ts +5 -0
  60. package/src/interface/ICharacter.js +1 -0
  61. package/src/interface/IDictionaryTag.d.ts +8 -0
  62. package/src/interface/IDictionaryTag.js +1 -0
  63. package/src/interface/IFilterArray.d.ts +2 -0
  64. package/src/interface/IFilterArray.js +1 -0
  65. package/src/interface/IGrid.d.ts +6 -0
  66. package/src/interface/IGrid.js +1 -0
  67. package/src/interface/ILoopConfig.d.ts +8 -0
  68. package/src/interface/ILoopConfig.js +1 -0
  69. package/src/interface/ILoopType.d.ts +1 -0
  70. package/src/interface/ILoopType.js +1 -0
  71. package/src/interface/IMovieClipActionObject.d.ts +5 -0
  72. package/src/interface/IMovieClipActionObject.js +1 -0
  73. package/src/interface/IMovieClipCharacter.d.ts +17 -0
  74. package/src/interface/IMovieClipCharacter.js +1 -0
  75. package/src/interface/IMovieClipLabelObject.d.ts +4 -0
  76. package/src/interface/IMovieClipLabelObject.js +1 -0
  77. package/src/interface/IMovieClipSoundObject.d.ts +5 -0
  78. package/src/interface/IMovieClipSoundObject.js +1 -0
  79. package/src/interface/IPlaceObject.d.ts +14 -0
  80. package/src/interface/IPlaceObject.js +1 -0
  81. package/src/interface/IShapeCharacter.d.ts +14 -0
  82. package/src/interface/IShapeCharacter.js +1 -0
  83. package/src/interface/ISoundCharacter.d.ts +4 -0
  84. package/src/interface/ISoundCharacter.js +1 -0
  85. package/src/interface/ISoundTag.d.ts +6 -0
  86. package/src/interface/ISoundTag.js +1 -0
  87. package/src/interface/ISurfaceFilter.d.ts +6 -0
  88. package/src/interface/ISurfaceFilter.js +1 -0
  89. package/src/interface/ITextFieldCharacter.d.ts +26 -0
  90. package/src/interface/ITextFieldCharacter.js +1 -0
  91. package/src/interface/ITextFieldType.d.ts +1 -0
  92. package/src/interface/ITextFieldType.js +1 -0
  93. package/src/interface/ITextFormatAlign.d.ts +1 -0
  94. package/src/interface/ITextFormatAlign.js +1 -0
  95. package/src/interface/IURLLoaderDataFormat.d.ts +1 -0
  96. package/src/interface/IURLLoaderDataFormat.js +1 -0
  97. package/src/interface/IURLRequestHeader.d.ts +4 -0
  98. package/src/interface/IURLRequestHeader.js +1 -0
  99. package/src/interface/IURLRequestMethod.d.ts +1 -0
  100. package/src/interface/IURLRequestMethod.js +1 -0
  101. package/src/interface/IVideoCharacter.d.ts +11 -0
  102. package/src/interface/IVideoCharacter.js +1 -0
  103. package/dist/Sound.d.ts +0 -206
  104. package/dist/Sound.js +0 -501
  105. package/dist/SoundMixer.d.ts +0 -68
  106. package/dist/SoundMixer.js +0 -114
  107. package/dist/SoundTransform.d.ts +0 -80
  108. package/dist/SoundTransform.js +0 -111
  109. package/dist/Video.d.ts +0 -328
  110. package/dist/Video.js +0 -897
package/src/Video.js ADDED
@@ -0,0 +1,428 @@
1
+ import { SoundMixer } from "./SoundMixer";
2
+ import { DisplayObject } from "@next2d/display";
3
+ import { VideoEvent } from "@next2d/events";
4
+ import { execute as videoCreateElementService } from "./Video/service/VideoCreateElementService";
5
+ import { execute as videoRegisterEventUseCase } from "./Video/usecase/VideoRegisterEventUseCase";
6
+ import { execute as videoPlayEventUseCase } from "./Video/usecase/VideoPlayEventUseCase";
7
+ import { execute as videoBuildFromCharacterUseCase } from "./Video/usecase/VideoBuildFromCharacterUseCase";
8
+ import { $clamp, $getPlayingVideos } from "./MediaUtil";
9
+ /**
10
+ * @description サーバーまたはローカルに保存された録画済みビデオファイルを再生する Video オブジェクトです。
11
+ * ビデオストリームを再生するには、attachNetStream() を使用して、ビデオを Video オブジェクトに関連付けます。
12
+ * 次に、addChild() を使用して、Video オブジェクトを表示リストに追加します。
13
+ * A Video object that plays a recorded video file stored on a server or locally.
14
+ * To play a video stream, use attachNetStream() to attach the video to the Video object.
15
+ * Then, add the Video object to the display list using addChild().
16
+ *
17
+ * @class
18
+ * @memberOf next2d.media
19
+ * @extends DisplayObject
20
+ */
21
+ export class Video extends DisplayObject {
22
+ /**
23
+ * @param {number} [width = 0]
24
+ * @param {number} [height = 0]
25
+ *
26
+ * @constructor
27
+ * @public
28
+ */
29
+ constructor(width = 0, height = 0) {
30
+ super();
31
+ /**
32
+ * @description キーフレーム総数
33
+ * Total number of keyframes
34
+ *
35
+ * @type {number}
36
+ * @default 0
37
+ * @public
38
+ */
39
+ Object.defineProperty(this, "duration", {
40
+ enumerable: true,
41
+ configurable: true,
42
+ writable: true,
43
+ value: void 0
44
+ });
45
+ /**
46
+ * @description ビデオを拡大 / 縮小する際にスムージング(補間)するかどうかを指定します。
47
+ * Specifies whether the video should be smoothed (interpolated)
48
+ * when it is scaled.
49
+ *
50
+ * @type {boolean}
51
+ * @default true
52
+ * @public
53
+ */
54
+ Object.defineProperty(this, "smoothing", {
55
+ enumerable: true,
56
+ configurable: true,
57
+ writable: true,
58
+ value: void 0
59
+ });
60
+ /**
61
+ * @description ビデオをループ生成するかどうかを指定します。
62
+ * Specifies whether to generate a video loop.
63
+ *
64
+ * @type {boolean}
65
+ * @default false
66
+ * @public
67
+ */
68
+ Object.defineProperty(this, "loop", {
69
+ enumerable: true,
70
+ configurable: true,
71
+ writable: true,
72
+ value: void 0
73
+ });
74
+ /**
75
+ * @description ビデオの自動再生の設定。
76
+ * Setting up automatic video playback.
77
+ *
78
+ * @type {boolean}
79
+ * @default true
80
+ * @public
81
+ */
82
+ Object.defineProperty(this, "autoPlay", {
83
+ enumerable: true,
84
+ configurable: true,
85
+ writable: true,
86
+ value: void 0
87
+ });
88
+ /**
89
+ * @description 現在のキーフレーム
90
+ * Current keyframe
91
+ *
92
+ *
93
+ * @member {number}
94
+ * @public
95
+ */
96
+ Object.defineProperty(this, "currentTime", {
97
+ enumerable: true,
98
+ configurable: true,
99
+ writable: true,
100
+ value: void 0
101
+ });
102
+ /**
103
+ * @description ビデオの幅をピクセル単位で指定する整数です。
104
+ * An integer specifying the width of the video, in pixels.
105
+ *
106
+ * @member {number}
107
+ * @default 0
108
+ * @public
109
+ */
110
+ Object.defineProperty(this, "videoWidth", {
111
+ enumerable: true,
112
+ configurable: true,
113
+ writable: true,
114
+ value: void 0
115
+ });
116
+ /**
117
+ * @description ビデオの高さをピクセル単位で指定する整数です。
118
+ * An integer specifying the height of the video, in pixels.
119
+ *
120
+ * @member {number}
121
+ * @default 0
122
+ * @public
123
+ */
124
+ Object.defineProperty(this, "videoHeight", {
125
+ enumerable: true,
126
+ configurable: true,
127
+ writable: true,
128
+ value: void 0
129
+ });
130
+ /**
131
+ * @description ビデオが読み込まれているかどうかを返します。
132
+ * Returns whether the video has been loaded.
133
+ *
134
+ * @type {boolean}
135
+ * @default false
136
+ * @public
137
+ */
138
+ Object.defineProperty(this, "loaded", {
139
+ enumerable: true,
140
+ configurable: true,
141
+ writable: true,
142
+ value: void 0
143
+ });
144
+ /**
145
+ * @description ビデオが終了したかどうかを返します。
146
+ * Returns whether the video has ended.
147
+ *
148
+ * @type {boolean}
149
+ * @default false
150
+ * @public
151
+ */
152
+ Object.defineProperty(this, "ended", {
153
+ enumerable: true,
154
+ configurable: true,
155
+ writable: true,
156
+ value: void 0
157
+ });
158
+ /**
159
+ * @description Videoの機能を所持しているかを返却
160
+ * Returns whether the display object has Video functionality.
161
+ *
162
+ * @type {boolean}
163
+ * @readonly
164
+ * @public
165
+ */
166
+ Object.defineProperty(this, "isVideo", {
167
+ enumerable: true,
168
+ configurable: true,
169
+ writable: true,
170
+ value: void 0
171
+ });
172
+ /**
173
+ * @type {HTMLVideoElement}
174
+ * @default null
175
+ * @public
176
+ */
177
+ Object.defineProperty(this, "$videoElement", {
178
+ enumerable: true,
179
+ configurable: true,
180
+ writable: true,
181
+ value: void 0
182
+ });
183
+ /**
184
+ * @type {OffscreenCanvas}
185
+ * @default null
186
+ * @public
187
+ */
188
+ Object.defineProperty(this, "$offscreenCanvas", {
189
+ enumerable: true,
190
+ configurable: true,
191
+ writable: true,
192
+ value: void 0
193
+ });
194
+ /**
195
+ * @type {OffscreenCanvasRenderingContext2D}
196
+ * @default null
197
+ * @public
198
+ */
199
+ Object.defineProperty(this, "$context", {
200
+ enumerable: true,
201
+ configurable: true,
202
+ writable: true,
203
+ value: void 0
204
+ });
205
+ /**
206
+ * @type {boolean}
207
+ * @default true
208
+ * @public
209
+ */
210
+ Object.defineProperty(this, "paused", {
211
+ enumerable: true,
212
+ configurable: true,
213
+ writable: true,
214
+ value: void 0
215
+ });
216
+ /**
217
+ * @type {number}
218
+ * @default -1
219
+ * @private
220
+ */
221
+ Object.defineProperty(this, "_$timerId", {
222
+ enumerable: true,
223
+ configurable: true,
224
+ writable: true,
225
+ value: void 0
226
+ });
227
+ /**
228
+ * @type {number}
229
+ * @default 1
230
+ * @private
231
+ */
232
+ Object.defineProperty(this, "_$volume", {
233
+ enumerable: true,
234
+ configurable: true,
235
+ writable: true,
236
+ value: void 0
237
+ });
238
+ /**
239
+ * @type {string}
240
+ * @default ""
241
+ * @private
242
+ */
243
+ Object.defineProperty(this, "_$src", {
244
+ enumerable: true,
245
+ configurable: true,
246
+ writable: true,
247
+ value: void 0
248
+ });
249
+ this.videoWidth = width;
250
+ this.videoHeight = height;
251
+ // public params
252
+ this.isVideo = true;
253
+ this.duration = 0;
254
+ this.smoothing = true;
255
+ this.loop = false;
256
+ this.loaded = false;
257
+ this.ended = false;
258
+ this.paused = true;
259
+ this.autoPlay = true;
260
+ this.currentTime = 0;
261
+ // private params
262
+ this._$src = "";
263
+ this._$timerId = -1;
264
+ this._$volume = 1;
265
+ // element
266
+ this.$videoElement = null;
267
+ this.$offscreenCanvas = null;
268
+ this.$context = null;
269
+ }
270
+ /**
271
+ * @description 指定されたクラスの空間名を返します。
272
+ * Returns the space name of the specified class.
273
+ *
274
+ * @return {string}
275
+ * @const
276
+ * @static
277
+ */
278
+ static get namespace() {
279
+ return "next2d.media.Video";
280
+ }
281
+ /**
282
+ * @description 指定されたオブジェクトの空間名を返します。
283
+ * Returns the space name of the specified object.
284
+ *
285
+ * @return {string}
286
+ * @const
287
+ * @public
288
+ */
289
+ get namespace() {
290
+ return "next2d.media.Video";
291
+ }
292
+ /**
293
+ * @description ビデオコンテンツへの URL を指定します。
294
+ * Specifies the URL of the video content.
295
+ *
296
+ * @member {string}
297
+ * @default ""
298
+ * @public
299
+ */
300
+ get src() {
301
+ return this._$src;
302
+ }
303
+ set src(src) {
304
+ if (this._$src === src) {
305
+ return;
306
+ }
307
+ // reset
308
+ this.loaded = false;
309
+ this.currentTime = 0;
310
+ this.$videoElement = null;
311
+ this.$offscreenCanvas = null;
312
+ this.$context = null;
313
+ this.$videoElement = videoCreateElementService();
314
+ videoRegisterEventUseCase(this.$videoElement, this);
315
+ this._$src = this.$videoElement.src = src;
316
+ this.$videoElement.load();
317
+ }
318
+ /**
319
+ * @description ビデオがミュートされているかどうかを返します。
320
+ * Returns whether the video is muted.
321
+ *
322
+ * @member {boolean}
323
+ * @default false
324
+ * @public
325
+ */
326
+ get muted() {
327
+ return this.$videoElement ? this.$videoElement.muted : false;
328
+ }
329
+ set muted(muted) {
330
+ if (!this.$videoElement) {
331
+ return;
332
+ }
333
+ this.$videoElement.muted = muted;
334
+ }
335
+ /**
336
+ * @description ボリュームです。範囲は 0(無音)~ 1(フルボリューム)です。
337
+ * The volume, ranging from 0 (silent) to 1 (full volume).
338
+ *
339
+ * @member {number}
340
+ * @default 1
341
+ * @public
342
+ */
343
+ get volume() {
344
+ return this._$volume;
345
+ }
346
+ set volume(volume) {
347
+ this._$volume = $clamp(Math.min(SoundMixer.volume, volume), 0, 1, 1);
348
+ if (this.$videoElement) {
349
+ this.$videoElement.volume = this._$volume;
350
+ }
351
+ }
352
+ /**
353
+ * @description ビデオの再生を一時停止します。
354
+ * Pauses the video playback.
355
+ *
356
+ * @return {void}
357
+ * @method
358
+ * @public
359
+ */
360
+ pause() {
361
+ if (!this.$videoElement || this.paused) {
362
+ return;
363
+ }
364
+ this.paused = true;
365
+ this.$videoElement.pause();
366
+ cancelAnimationFrame(this._$timerId);
367
+ if (this.willTrigger(VideoEvent.PAUSE)) {
368
+ this.dispatchEvent(new VideoEvent(VideoEvent.PAUSE));
369
+ }
370
+ const playingVideos = $getPlayingVideos();
371
+ const index = playingVideos.indexOf(this);
372
+ if (index > -1) {
373
+ playingVideos.splice(index, 1);
374
+ }
375
+ }
376
+ /**
377
+ * @description ビデオファイルを再生します。
378
+ * Plays the video file.
379
+ *
380
+ * @returns {void}
381
+ * @method
382
+ * @public
383
+ */
384
+ async play() {
385
+ if (!this.$videoElement || !this.paused) {
386
+ return;
387
+ }
388
+ this.paused = false;
389
+ this.ended = false;
390
+ this.$videoElement.volume = this._$volume;
391
+ await this.$videoElement.play();
392
+ this._$timerId = videoPlayEventUseCase(this);
393
+ }
394
+ /**
395
+ * @description 指定された位置に最も近いキーフレームをシークします。
396
+ * Seeks the keyframe closest to the specified location.
397
+ *
398
+ * @param {number} offset
399
+ * @return {void}
400
+ * @method
401
+ * @public
402
+ */
403
+ seek(offset) {
404
+ if (!this.$videoElement) {
405
+ return;
406
+ }
407
+ this.currentTime = this.$videoElement.currentTime = Math.min(this.duration, offset);
408
+ if (this.willTrigger(VideoEvent.SEEK)) {
409
+ this.dispatchEvent(new VideoEvent(VideoEvent.SEEK));
410
+ }
411
+ }
412
+ /**
413
+ * @description character 情報を元に DisplayObject を構築
414
+ * Build DisplayObject based on character
415
+ *
416
+ * @param {ICharacter} character
417
+ * @param {LoaderInfo} [loader_info=null]
418
+ * @return {void}
419
+ * @method
420
+ * @protected
421
+ */
422
+ $sync(character, loader_info = null) {
423
+ if (loader_info) {
424
+ super.$syncLoaderInfo(loader_info);
425
+ }
426
+ videoBuildFromCharacterUseCase(this, character);
427
+ }
428
+ }
@@ -2,3 +2,4 @@ export * from "./Sound";
2
2
  export * from "./SoundMixer";
3
3
  export * from "./SoundTransform";
4
4
  export * from "./Video";
5
+ export { $bootAudioContext, $getAudioContext, $getMutedVideos } from "./MediaUtil";
@@ -2,3 +2,4 @@ export * from "./Sound";
2
2
  export * from "./SoundMixer";
3
3
  export * from "./SoundTransform";
4
4
  export * from "./Video";
5
+ export { $bootAudioContext, $getAudioContext, $getMutedVideos } from "./MediaUtil";
@@ -0,0 +1,5 @@
1
+ export interface IAjaxEvent {
2
+ loadstart?: Function;
3
+ progress?: Function;
4
+ loadend?: Function;
5
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ import type { IURLRequestMethod } from "./IURLRequestMethod";
2
+ import type { IURLLoaderDataFormat } from "./IURLLoaderDataFormat";
3
+ import type { IAjaxEvent } from "./IAjaxEvent";
4
+ import type { IURLRequestHeader } from "./IURLRequestHeader";
5
+ export interface IAjaxOption {
6
+ url: string;
7
+ format: IURLLoaderDataFormat;
8
+ method: IURLRequestMethod;
9
+ withCredentials: boolean;
10
+ headers: IURLRequestHeader[];
11
+ data?: any;
12
+ event?: IAjaxEvent;
13
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export type IBlendMode = "copy" | "add" | "alpha" | "darken" | "difference" | "erase" | "hardlight" | "invert" | "layer" | "lighten" | "multiply" | "normal" | "overlay" | "screen" | "subtract";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ export interface IBounds {
2
+ xMin: number;
3
+ xMax: number;
4
+ yMin: number;
5
+ yMax: number;
6
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { IMovieClipCharacter } from "./IMovieClipCharacter";
2
+ import type { IVideoCharacter } from "./IVideoCharacter";
3
+ import type { IShapeCharacter } from "./IShapeCharacter";
4
+ import type { ITextFieldCharacter } from "./ITextFieldCharacter";
5
+ export type ICharacter = IMovieClipCharacter | IVideoCharacter | IShapeCharacter | ITextFieldCharacter;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ export interface IDictionaryTag {
2
+ characterId: number;
3
+ name: string;
4
+ startFrame: number;
5
+ endFrame: number;
6
+ depth: number;
7
+ clipDepth: number;
8
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { BlurFilter, BevelFilter, ColorMatrixFilter, ConvolutionFilter, DisplacementMapFilter, DropShadowFilter, GlowFilter, GradientBevelFilter, GradientGlowFilter } from "@next2d/filters";
2
+ export type IFilterArray = Array<BlurFilter | BevelFilter | ColorMatrixFilter | ConvolutionFilter | DisplacementMapFilter | DropShadowFilter | GlowFilter | GradientBevelFilter | GradientGlowFilter>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ export interface IGrid {
2
+ x: number;
3
+ y: number;
4
+ w: number;
5
+ h: number;
6
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { ILoopType } from "./ILoopType";
2
+ export interface ILoopConfig {
3
+ type: ILoopType;
4
+ frame: number;
5
+ start: number;
6
+ end: number;
7
+ tweenFrame?: number;
8
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export type ILoopType = 0 | 1 | 2 | 3 | 4;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ export interface IMovieClipActionObject {
2
+ frame: number;
3
+ action: string;
4
+ script?: Function;
5
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,17 @@
1
+ import type { IMovieClipSoundObject } from "./IMovieClipSoundObject";
2
+ import type { IMovieClipActionObject } from "./IMovieClipActionObject";
3
+ import type { IMovieClipLabelObject } from "./IMovieClipLabelObject";
4
+ import type { IPlaceObject } from "./IPlaceObject";
5
+ import type { IDictionaryTag } from "./IDictionaryTag";
6
+ export interface IMovieClipCharacter {
7
+ symbol?: string;
8
+ extends: string;
9
+ totalFrame: number;
10
+ controller: Array<Array<number>>;
11
+ dictionary: IDictionaryTag[];
12
+ placeMap: Array<Array<number>>;
13
+ placeObjects: IPlaceObject[];
14
+ labels?: IMovieClipLabelObject[];
15
+ actions?: IMovieClipActionObject[];
16
+ sounds?: IMovieClipSoundObject[];
17
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export interface IMovieClipLabelObject {
2
+ name: string;
3
+ frame: number;
4
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { ISoundTag } from "./ISoundTag";
2
+ export interface IMovieClipSoundObject {
3
+ frame: number;
4
+ sound: ISoundTag[];
5
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,14 @@
1
+ import type { ILoopConfig } from "./ILoopConfig";
2
+ import type { ISurfaceFilter } from "./ISurfaceFilter";
3
+ import type { IFilterArray } from "./IFilterArray";
4
+ import type { IBlendMode } from "./IBlendMode";
5
+ export interface IPlaceObject {
6
+ matrix?: number[];
7
+ typedMatrix?: Float32Array;
8
+ colorTransform?: number[];
9
+ typedColorTransform?: Float32Array;
10
+ blendMode?: IBlendMode;
11
+ surfaceFilterList?: ISurfaceFilter[];
12
+ filters?: IFilterArray;
13
+ loop?: ILoopConfig;
14
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,14 @@
1
+ import type { IGrid } from "./IGrid";
2
+ import type { IBounds } from "./IBounds";
3
+ export interface IShapeCharacter {
4
+ symbol?: string;
5
+ extends: string;
6
+ bounds: IBounds;
7
+ bitmapId: number;
8
+ inBitmap?: boolean;
9
+ grid?: IGrid | null;
10
+ recodes?: any[] | null;
11
+ buffer?: number[] | null;
12
+ imageBuffer?: Uint8Array;
13
+ recodeBuffer?: Float32Array;
14
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export interface ISoundCharacter {
2
+ buffer: number[] | null;
3
+ audioBuffer: AudioBuffer | null;
4
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ export interface ISoundTag {
2
+ characterId: number;
3
+ volume: number;
4
+ autoPlay: boolean;
5
+ loopCount: number;
6
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ type ClassName = "BevelFilter" | "BlurFilter" | "ColorMatrixFilter" | "ConvolutionFilter" | "DisplacementMapFilter" | "DropShadowFilter" | "GlowFilter" | "GradientBevelFilter" | "GradientGlowFilter";
2
+ export interface ISurfaceFilter {
3
+ class: ClassName;
4
+ params: any[];
5
+ }
6
+ export {};
@@ -0,0 +1 @@
1
+ export {};