@xviewer.js/core 1.0.0-alpha.6 → 1.0.0-alpha.61

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 (76) hide show
  1. package/dist/main.js +4213 -12834
  2. package/dist/main.js.map +1 -1
  3. package/dist/module.js +4155 -12821
  4. package/dist/module.js.map +1 -1
  5. package/package.json +19 -21
  6. package/types/ObjectInstance.d.ts +2 -2
  7. package/types/PropertyManager.d.ts +14 -4
  8. package/types/SystemInfo.d.ts +1 -0
  9. package/types/Task.d.ts +2 -0
  10. package/types/TextureSettings.d.ts +3 -1
  11. package/types/Viewer.d.ts +51 -19
  12. package/types/asset/ResourceManager.d.ts +12 -26
  13. package/types/asset/aLoader.d.ts +9 -2
  14. package/types/base/EventEmitter.d.ts +10 -10
  15. package/types/base/getClassInstance.d.ts +1 -0
  16. package/types/base/index.d.ts +1 -0
  17. package/types/cinestation/CinestationBlendDefinition.d.ts +4 -4
  18. package/types/cinestation/CinestationBrain.d.ts +0 -2
  19. package/types/cinestation/FreelookVirtualCamera.d.ts +40 -21
  20. package/types/cinestation/VirtualCamera.d.ts +8 -8
  21. package/types/components/Animation.d.ts +26 -0
  22. package/types/components/PerformanceMonitor.d.ts +48 -0
  23. package/types/components/Reflector.d.ts +15 -0
  24. package/types/components/index.d.ts +2 -0
  25. package/types/index.d.ts +10 -2
  26. package/types/loaders/aEXRLoader.d.ts +6 -0
  27. package/types/loaders/aFBXLoader.d.ts +6 -0
  28. package/types/loaders/aGLTFLoader.d.ts +7 -0
  29. package/types/loaders/aHDRLoader.d.ts +6 -0
  30. package/types/loaders/aJSONLoader.d.ts +6 -0
  31. package/types/loaders/aTextureLoader.d.ts +6 -0
  32. package/types/{loader → loaders}/index.d.ts +3 -5
  33. package/types/materials/ReflectorMaterial.d.ts +34 -0
  34. package/types/{material → materials}/getShaderMaterial.d.ts +2 -2
  35. package/types/materials/glsl/index.d.ts +3 -0
  36. package/types/materials/index.d.ts +3 -0
  37. package/types/math/Constant.d.ts +8 -1
  38. package/types/math/Interpolation.d.ts +6 -6
  39. package/types/math/Perlin.d.ts +12 -0
  40. package/types/math/index.d.ts +5 -0
  41. package/types/passes/MipBlurPass.d.ts +27 -0
  42. package/types/passes/cubeuv/MergeBlurPass.d.ts +21 -0
  43. package/types/passes/cubeuv/MergeInfo.d.ts +9 -0
  44. package/types/passes/cubeuv/MergeReflectPass.d.ts +18 -0
  45. package/types/passes/cubeuv/utils.d.ts +16 -0
  46. package/types/passes/mipGaussianBlendWeight.d.ts +1 -0
  47. package/types/plugins/BoxProjectionPlugin.d.ts +20 -0
  48. package/types/plugins/DebugPlugin.d.ts +10 -0
  49. package/types/plugins/DropFilePlugin.d.ts +18 -0
  50. package/types/plugins/EnvironmentPlugin.d.ts +40 -0
  51. package/types/plugins/PerformanceMonitorPlugin.d.ts +48 -0
  52. package/types/plugins/index.d.ts +5 -0
  53. package/types/tween/Easing.d.ts +25 -0
  54. package/types/tween/Group.d.ts +16 -0
  55. package/types/tween/Interpolation.d.ts +19 -0
  56. package/types/tween/Now.d.ts +2 -0
  57. package/types/tween/Sequence.d.ts +7 -0
  58. package/types/tween/Tween.d.ts +96 -0
  59. package/types/tween/TweenChain.d.ts +15 -5
  60. package/types/tween/TweenManager.d.ts +0 -2
  61. package/types/tween/Version.d.ts +1 -0
  62. package/types/tween/index.d.ts +3 -1
  63. package/types/tween/mainGroup.d.ts +2 -0
  64. package/types/types.d.ts +4 -0
  65. package/types/loader/aFBXLoader.d.ts +0 -4
  66. package/types/loader/aGLTFLoader.d.ts +0 -4
  67. package/types/loader/aHDRLoader.d.ts +0 -4
  68. package/types/loader/aTextureLoader.d.ts +0 -4
  69. package/types/material/glsl/copy.glsl.d.ts +0 -1
  70. /package/types/{material → materials}/glsl/boxfilterblur.glsl.d.ts +0 -0
  71. /package/types/{material → materials}/glsl/fullscreen.glsl.d.ts +0 -0
  72. /package/types/{material → materials}/glsl/panorama.glsl.d.ts +0 -0
  73. /package/types/{primitives → primitive}/Box.d.ts +0 -0
  74. /package/types/{primitives → primitive}/Plane.d.ts +0 -0
  75. /package/types/{primitives → primitive}/Sphere.d.ts +0 -0
  76. /package/types/{primitives → primitive}/index.d.ts +0 -0
package/types/index.d.ts CHANGED
@@ -1,12 +1,20 @@
1
1
  export * from "./types";
2
2
  export * from "./base";
3
3
  export * from "./tween";
4
- export * from "./loader";
4
+ export * from "./loaders";
5
5
  export * from "./cinestation";
6
- export * from "./primitives";
6
+ export * from "./primitive";
7
+ export * from "./math";
8
+ export * from "./components";
9
+ export * from "./materials";
10
+ export * from "./plugins";
7
11
  export { Viewer } from "./Viewer";
8
12
  export { Component } from "./Component";
9
13
  export { SystemInfo } from "./SystemInfo";
10
14
  export { Plugin } from "./Plugin";
11
15
  export { ObjectInstance } from "./ObjectInstance";
12
16
  export { property, PropertyManager } from "./PropertyManager";
17
+ export { DeviceInput } from "./DeviceInput";
18
+ export { Orientation } from "./enums/Orientation";
19
+ export { aLoader, type LoadProperties } from "./asset/aLoader";
20
+ export { ResourceManager, type AssetProperties } from "./asset/ResourceManager";
@@ -0,0 +1,6 @@
1
+ import { LoadProperties, aLoader } from "../asset/aLoader";
2
+ export declare class aEXRLoader extends aLoader {
3
+ extension: string[];
4
+ load({ url, path, resourcePath, manager, texSettings, onLoad, onProgress, onError, }: LoadProperties): void;
5
+ private _loader;
6
+ }
@@ -0,0 +1,6 @@
1
+ import { LoadProperties, aLoader } from "../asset/aLoader";
2
+ export declare class aFBXLoader extends aLoader {
3
+ extension: string[];
4
+ load({ url, buffer, path, resourcePath, manager, onLoad, onProgress, onError }: LoadProperties): void;
5
+ private _loader;
6
+ }
@@ -0,0 +1,7 @@
1
+ import { LoadProperties, aLoader } from "../asset/aLoader";
2
+ export declare class aGLTFLoader extends aLoader {
3
+ extension: string[];
4
+ load({ url, buffer, path, resourcePath, dracoPath, manager, onLoad, onProgress, onError }: LoadProperties): void;
5
+ private _loader;
6
+ private _dracoLoader;
7
+ }
@@ -0,0 +1,6 @@
1
+ import { LoadProperties, aLoader } from "../asset/aLoader";
2
+ export declare class aHDRLoader extends aLoader {
3
+ extension: string[];
4
+ load({ url, path, resourcePath, manager, texSettings, onLoad, onProgress, onError, }: LoadProperties): void;
5
+ private _loader;
6
+ }
@@ -0,0 +1,6 @@
1
+ import { LoadProperties, aLoader } from "../asset/aLoader";
2
+ export declare class aJSONLoader extends aLoader {
3
+ extension: string[];
4
+ load({ url, path, resourcePath, manager, onLoad, onProgress, onError }: LoadProperties): void;
5
+ private _loader;
6
+ }
@@ -0,0 +1,6 @@
1
+ import { LoadProperties, aLoader } from "../asset/aLoader";
2
+ export declare class aTextureLoader extends aLoader {
3
+ extension: string[];
4
+ load({ url, path, resourcePath, manager, texSettings, onLoad, onProgress, onError }: LoadProperties): void;
5
+ private _loader;
6
+ }
@@ -1,8 +1,6 @@
1
- import "./aGLTFLoader";
2
- import "./aFBXLoader";
3
- import "./aHDRLoader";
4
- import "./aTextureLoader";
5
- export { aGLTFLoader } from "./aGLTFLoader";
1
+ export { aEXRLoader } from "./aEXRLoader";
6
2
  export { aFBXLoader } from "./aFBXLoader";
3
+ export { aGLTFLoader } from "./aGLTFLoader";
7
4
  export { aHDRLoader } from "./aHDRLoader";
5
+ export { aJSONLoader } from "./aJSONLoader";
8
6
  export { aTextureLoader } from "./aTextureLoader";
@@ -0,0 +1,34 @@
1
+ import { Color, IUniform, ShaderMaterial, Texture, WebGLProgramParametersWithUniforms } from "three";
2
+ export declare class ReflectorMaterial extends ShaderMaterial {
3
+ vertexShader: string;
4
+ fragmentShader: string;
5
+ defines: {
6
+ [key: string]: any;
7
+ };
8
+ uniforms: {
9
+ [uniform: string]: IUniform<any>;
10
+ };
11
+ onBeforeCompile(shader: WebGLProgramParametersWithUniforms): void;
12
+ get color(): Color;
13
+ set color(v: Color);
14
+ get alpha(): number;
15
+ set alpha(v: number);
16
+ get metalness(): number;
17
+ set metalness(v: number);
18
+ get roughness(): number;
19
+ set roughness(v: number);
20
+ get map(): Texture;
21
+ set map(v: Texture);
22
+ get roughnessMap(): Texture;
23
+ set roughnessMap(v: Texture);
24
+ get normalMap(): Texture;
25
+ set normalMap(v: Texture);
26
+ get aoMap(): Texture;
27
+ set aoMap(v: Texture);
28
+ get lightMap(): Texture;
29
+ set lightMap(v: Texture);
30
+ get lightMapIntensity(): number;
31
+ set lightMapIntensity(v: number);
32
+ get reflectIntensity(): number;
33
+ set reflectIntensity(v: number);
34
+ }
@@ -1,4 +1,4 @@
1
1
  import { Color, CubeTexture, Matrix3, Matrix4, Quaternion, ShaderMaterial, Texture, Vector2, Vector3, Vector4 } from "three";
2
- export declare function getShaderMaterial(uniforms: {
2
+ export declare function getShaderMaterial<T extends {
3
3
  [name: string]: CubeTexture | Texture | Int32Array | Float32Array | Matrix4 | Matrix3 | Quaternion | Vector4 | Vector3 | Vector2 | Color | number | boolean | Array<any> | null;
4
- }, vertexShader: string, fragmentShader: string, onInit?: (material?: ShaderMaterial) => void): typeof ShaderMaterial;
4
+ }>(uniforms: T, vertexShader: string, fragmentShader: string, onInit?: (material?: ShaderMaterial) => void): typeof ShaderMaterial & T & ShaderMaterial;
@@ -0,0 +1,3 @@
1
+ export { vert_fullscreen } from "./fullscreen.glsl";
2
+ export { frag_BoxfilterBlur } from "./boxfilterblur.glsl";
3
+ export { frag_panoramaToCubeMap, frag_cubeMapToPanorama } from "./panorama.glsl";
@@ -0,0 +1,3 @@
1
+ export * from "./glsl";
2
+ export { getShaderMaterial } from "./getShaderMaterial";
3
+ export { ReflectorMaterial } from "./ReflectorMaterial";
@@ -1,2 +1,9 @@
1
1
  import { Vector3 } from "three";
2
- export declare const Vector3_ZERO: Vector3;
2
+ export declare const Vector3_UNIT_X: Readonly<Vector3>;
3
+ export declare const Vector3_UNIT_Y: Readonly<Vector3>;
4
+ export declare const Vector3_UNIT_Z: Readonly<Vector3>;
5
+ export declare const Vector3_RIGHT: Readonly<Vector3>;
6
+ export declare const Vector3_UP: Readonly<Vector3>;
7
+ export declare const Vector3_ZERO: Readonly<Vector3>;
8
+ export declare const Vector3_ONE: Readonly<Vector3>;
9
+ export declare const Vector3_NEG_ONE: Readonly<Vector3>;
@@ -1,9 +1,9 @@
1
- import { Quaternion } from "three";
2
- export declare function VInterpTo(current: any, target: any, deltaTime: any, speed: any, out?: any): any;
3
- export declare function VInterpConstantTo(current: any, target: any, deltaTime: any, speed: any, out?: any): any;
1
+ import { Quaternion, Vector3 } from "three";
2
+ export declare function VInterpTo(current: Vector3, target: Vector3, deltaTime: number, speed: number, out?: Vector3): Vector3;
3
+ export declare function VInterpConstantTo(current: Vector3, target: Vector3, deltaTime: number, speed: number, out?: Vector3): Vector3;
4
4
  export declare function Quat_Equals(a: Quaternion, b: Quaternion, epsilon?: number): boolean;
5
5
  export declare function Quat_AngularDistance(a: Quaternion, b: Quaternion): number;
6
6
  export declare function QInterpTo(current: Quaternion, target: Quaternion, deltaTime: number, speed: number): Quaternion;
7
- export declare function QInterpConstantTo(current: any, target: any, deltaTime: any, speed: any, out?: any): any;
8
- export declare function FInterpTo(current: any, target: any, deltaTime: any, speed: any): any;
9
- export declare function FInterpConstantTo(current: any, target: any, deltaTime: any, speed: any): any;
7
+ export declare function QInterpConstantTo(current: Quaternion, target: Quaternion, deltaTime: number, speed: number, out?: Quaternion): Quaternion;
8
+ export declare function FInterpTo(current: number, target: number, deltaTime: number, speed: number): number;
9
+ export declare function FInterpConstantTo(current: number, target: number, deltaTime: number, speed: number): number;
@@ -0,0 +1,12 @@
1
+ export declare class Perlin {
2
+ static Noise(x: number): number;
3
+ static Noise(x: number, y: number): number;
4
+ static Noise(x: number, y: number, z: number): number;
5
+ static Fbm(octave: number, x: number): number;
6
+ static Fbm(octave: number, x: number, y: number): number;
7
+ static Fbm(octave: number, x: number, y: number, z: number): number;
8
+ private static _Fade;
9
+ private static _Lerp;
10
+ private static _Grad;
11
+ private static _Permutation;
12
+ }
@@ -0,0 +1,5 @@
1
+ export * from "./Damp";
2
+ export * from "./Constant";
3
+ export * from "./Interpolation";
4
+ export { AnimationCurve } from "./AnimationCurve";
5
+ export { Perlin } from "./Perlin";
@@ -0,0 +1,27 @@
1
+ import { CubeTexture, Texture, WebGLCubeRenderTarget } from "three";
2
+ import { Viewer } from "../Viewer";
3
+ export declare class MipBlurPass {
4
+ private _viewer;
5
+ private _mipmapRenderTargets;
6
+ private _cubeRenderTarget;
7
+ private _blurMaterial;
8
+ private _blurIntensity;
9
+ private _sigma;
10
+ private _minLod;
11
+ private _maxLod;
12
+ private _onChanged?;
13
+ private _uniforms;
14
+ get exposure(): number;
15
+ set exposure(v: number);
16
+ get blurIntensity(): number;
17
+ set blurIntensity(v: number);
18
+ getBlurTexture(): CubeTexture;
19
+ constructor(props: {
20
+ viewer: Viewer;
21
+ cubeRenderTarget: WebGLCubeRenderTarget;
22
+ onChanged?: (tex: Texture) => void;
23
+ });
24
+ dispose(): void;
25
+ update(): void;
26
+ private _blur;
27
+ }
@@ -0,0 +1,21 @@
1
+ import { CubeTexture, Texture, WebGLRenderTarget } from "three";
2
+ import { Viewer } from "../../Viewer";
3
+ import { MergeInfo } from "./MergeInfo";
4
+ export declare class MergeMipBlurPass {
5
+ private _pmremGenerator;
6
+ private _sigma;
7
+ private _blurMinLod;
8
+ private _blurMaxLod;
9
+ private _blurIntensity;
10
+ private _envMapTarget;
11
+ private _reflectMap;
12
+ get envMapTarget(): WebGLRenderTarget<Texture>;
13
+ constructor({ viewer, reflectMap, }: {
14
+ viewer: Viewer;
15
+ reflectMap: CubeTexture;
16
+ });
17
+ dispose(): void;
18
+ mergeMipBlur(info: MergeInfo): void;
19
+ private _setBlurIntensity;
20
+ private _getPMREMExtension;
21
+ }
@@ -0,0 +1,9 @@
1
+ import { WebGLRenderTarget } from "three";
2
+ export interface MergeInfo {
3
+ quality: number;
4
+ envMapTarget: WebGLRenderTarget;
5
+ envMapIntensity: number;
6
+ blurIntensity: number;
7
+ lodMax: number;
8
+ exposure: number;
9
+ }
@@ -0,0 +1,18 @@
1
+ import { CubeTexture, Texture, WebGLRenderTarget } from "three";
2
+ import { Viewer } from "../../Viewer";
3
+ import { MergeInfo } from "./MergeInfo";
4
+ export declare class MergeRefectPass {
5
+ private _pmremGenerator;
6
+ private _reflectMap;
7
+ private _envMapTarget;
8
+ private _sourceTarget;
9
+ get envMapTarget(): WebGLRenderTarget<Texture>;
10
+ constructor({ envMap, reflectMap, viewer, }: {
11
+ envMap?: Texture;
12
+ reflectMap: CubeTexture;
13
+ viewer: Viewer;
14
+ });
15
+ dispose(): void;
16
+ mergeReflect(info: MergeInfo): void;
17
+ private _getPMREMExtension;
18
+ }
@@ -0,0 +1,16 @@
1
+ import { OrthographicCamera, ShaderMaterial, Vector3, WebGLRenderTarget } from "three";
2
+ export declare const LOD_MIN = 4;
3
+ export declare const _flatCamera: OrthographicCamera;
4
+ export declare const _axisDirections: Vector3[];
5
+ export declare const _Quality: {
6
+ LOW: number;
7
+ MEDIUM: number;
8
+ HIGH: number;
9
+ ULTRA: number;
10
+ };
11
+ export declare function _setViewport(target: WebGLRenderTarget, x: number, y: number, width: number, height: number): void;
12
+ export declare function _getCommonVertexShader(): string;
13
+ export declare function _getClearMaterial(): ShaderMaterial;
14
+ export declare function _getCubeMapMaterial(): ShaderMaterial;
15
+ export declare function _getMipCopyMaterial(lodMax: number, width: number, height: number): ShaderMaterial;
16
+ export declare function _getMipBlurMaterial(lodMax: number, width: number, height: number): ShaderMaterial;
@@ -0,0 +1 @@
1
+ export declare function mipGaussianBlendWeight(sigma: number, lod: number): number;
@@ -0,0 +1,20 @@
1
+ import { Vector3, Vector4, WebGLProgramParametersWithUniforms } from "three";
2
+ import { Plugin } from "../Plugin";
3
+ export declare class BoxProjectionPlugin extends Plugin {
4
+ private _center;
5
+ private _boxMin;
6
+ private _boxMax;
7
+ private _helper;
8
+ private _debug;
9
+ get debug(): boolean;
10
+ set debug(v: boolean);
11
+ get center(): Vector4;
12
+ set center(v: Vector4);
13
+ get boxMin(): Vector3;
14
+ set boxMin(v: Vector3);
15
+ get boxMax(): Vector3;
16
+ set boxMax(v: Vector3);
17
+ constructor();
18
+ onUpdate(dt: number): void;
19
+ useBoxProjection(shader: WebGLProgramParametersWithUniforms): void;
20
+ }
@@ -0,0 +1,10 @@
1
+ import { Object3D, Scene } from "three";
2
+ import { Plugin } from "../Plugin";
3
+ import { Viewer } from "../Viewer";
4
+ export declare class DebugPlugin extends Plugin {
5
+ static Instance(viewer: Viewer): DebugPlugin;
6
+ scene: Scene;
7
+ add(node: Object3D): Object3D<import("three").Object3DEventMap>;
8
+ remove(node: Object3D): Object3D<import("three").Object3DEventMap>;
9
+ onRender(dt: number): void;
10
+ }
@@ -0,0 +1,18 @@
1
+ import { Plugin } from "../Plugin";
2
+ export declare class DropFilePlugin extends Plugin {
3
+ private _onLoad;
4
+ private _onError;
5
+ private _extensions;
6
+ constructor({ onLoad, onError, extension, }?: {
7
+ onLoad?: Function;
8
+ onError?: Function;
9
+ extension?: string | string[];
10
+ });
11
+ install(): void;
12
+ uninstall(): void;
13
+ private _onDrogOver;
14
+ private _onDrop;
15
+ private _loadItemList;
16
+ private _loadFiles;
17
+ private _loadFile;
18
+ }
@@ -0,0 +1,40 @@
1
+ import { Object3D, Scene, Texture, TextureDataType, Vector3 } from "three";
2
+ import { Plugin } from "../Plugin";
3
+ export declare class EnvironmentPlugin extends Plugin {
4
+ static readonly Quality: {
5
+ LOW: number;
6
+ MEDIUM: number;
7
+ HIGH: number;
8
+ ULTRA: number;
9
+ };
10
+ private _scene;
11
+ private _cubeCamera;
12
+ private _reflectPass;
13
+ private _mipBlurPass;
14
+ private _mergeInfo;
15
+ private _debug;
16
+ private _debugNode;
17
+ private _elapsed;
18
+ get debug(): boolean;
19
+ set debug(v: boolean);
20
+ quality: number;
21
+ envMapIntensity: number;
22
+ reflectExposure: number;
23
+ reflectBlurIntensity: number;
24
+ interval: number;
25
+ manual: boolean;
26
+ constructor({ envMap, scene, near, far, layer, resolution, floatType, position, }?: {
27
+ envMap?: Texture;
28
+ scene?: Scene | Object3D;
29
+ performance?: number;
30
+ resolution?: number;
31
+ layer?: number;
32
+ near?: number;
33
+ far?: number;
34
+ floatType?: boolean | TextureDataType;
35
+ position?: Vector3;
36
+ });
37
+ onRender(dt: number): void;
38
+ manualFrame(): void;
39
+ private _renderFrame;
40
+ }
@@ -0,0 +1,48 @@
1
+ import { Plugin } from "../Plugin";
2
+ type PerformanceMonitorProps = {
3
+ /** How much time in milliseconds to collect an average fps, 250 */
4
+ ms?: number;
5
+ /** How many interations of averages to collect, 10 */
6
+ iterations?: number;
7
+ /** The percentage of iterations that are matched against the lower and upper bounds, 0.75 */
8
+ threshold?: number;
9
+ /** A function that receive the max device refreshrate to determine lower and upper bounds which create a margin where neither incline nor decline should happen, (refreshrate) => (refreshrate > 90 ? [50, 90] : [50, 60]) */
10
+ bounds?: (refreshrate: number) => [lower: number, upper: number];
11
+ /** How many times it can inline or decline before onFallback is called, Infinity */
12
+ flipflops?: number;
13
+ /** The factor increases and decreases between 0-1, this prop sets the starting value, 0.5 */
14
+ factor?: number;
15
+ /** The step that gets added or subtracted to or from the factor on each incline/decline, 0.1 */
16
+ step?: number;
17
+ /** When performance is higher than the upper bound (good!) */
18
+ onIncline?: (monitor: PerformanceMonitorPlugin) => void;
19
+ /** When performance is lower than the upper bound (bad!) */
20
+ onDecline?: (monitor: PerformanceMonitorPlugin) => void;
21
+ /** Incline and decline will change the factor, this will trigger when that happened */
22
+ onChange?: (monitor: PerformanceMonitorPlugin) => void;
23
+ /** Called after when the number of flipflops is reached, it indicates instability, use the function to set a fixed baseline */
24
+ onFallback?: (monitor: PerformanceMonitorPlugin) => void;
25
+ };
26
+ type PerformanceMonitorSubscriber = {
27
+ onIncline?: (monitor: PerformanceMonitorPlugin) => void;
28
+ /** When performance is lower than the upper bound (bad!) */
29
+ onDecline?: (monitor: PerformanceMonitorPlugin) => void;
30
+ /** Incline and decline will change the factor, this will trigger when that happened */
31
+ onChange?: (monitor: PerformanceMonitorPlugin) => void;
32
+ /** Called after when the number of flipflops is reached, it indicates instability, use the function to set a fixed baseline */
33
+ onFallback?: (monitor: PerformanceMonitorPlugin) => void;
34
+ };
35
+ export declare class PerformanceMonitorPlugin extends Plugin {
36
+ fps: number;
37
+ index: number;
38
+ factor: number;
39
+ flipped: number;
40
+ refreshrate: number;
41
+ fallback: boolean;
42
+ frames: any[];
43
+ averages: any[];
44
+ subscriptions: Map<any, any>;
45
+ subscribe(subscriber: PerformanceMonitorSubscriber): void;
46
+ constructor({ iterations, ms, threshold, step, factor: _factor, flipflops, bounds, onIncline, onDecline, onChange, onFallback, }: PerformanceMonitorProps);
47
+ }
48
+ export {};
@@ -0,0 +1,5 @@
1
+ export { DebugPlugin } from "./DebugPlugin";
2
+ export { EnvironmentPlugin } from "./EnvironmentPlugin";
3
+ export { BoxProjectionPlugin } from "./BoxProjectionPlugin";
4
+ export { PerformanceMonitorPlugin } from "./PerformanceMonitorPlugin";
5
+ export { DropFilePlugin } from "./DropFilePlugin";
@@ -0,0 +1,25 @@
1
+ export type EasingFunction = (amount: number) => number;
2
+ export type EasingFunctionGroup = {
3
+ In: EasingFunction;
4
+ Out: EasingFunction;
5
+ InOut: EasingFunction;
6
+ };
7
+ /**
8
+ * The Ease class provides a collection of easing functions for use with tween.js.
9
+ */
10
+ export declare const Easing: Readonly<{
11
+ Linear: Readonly<EasingFunctionGroup & {
12
+ None: EasingFunction;
13
+ }>;
14
+ Quadratic: Readonly<EasingFunctionGroup>;
15
+ Cubic: Readonly<EasingFunctionGroup>;
16
+ Quartic: Readonly<EasingFunctionGroup>;
17
+ Quintic: Readonly<EasingFunctionGroup>;
18
+ Sinusoidal: Readonly<EasingFunctionGroup>;
19
+ Exponential: Readonly<EasingFunctionGroup>;
20
+ Circular: Readonly<EasingFunctionGroup>;
21
+ Elastic: Readonly<EasingFunctionGroup>;
22
+ Back: Readonly<EasingFunctionGroup>;
23
+ Bounce: Readonly<EasingFunctionGroup>;
24
+ generatePow(power?: number): EasingFunctionGroup;
25
+ }>;
@@ -0,0 +1,16 @@
1
+ import type { Tween, UnknownProps } from './Tween';
2
+ /**
3
+ * Controlling groups of tweens
4
+ *
5
+ * Using the TWEEN singleton to manage your tweens can cause issues in large apps with many components.
6
+ * In these cases, you may want to create your own smaller groups of tween
7
+ */
8
+ export declare class Group {
9
+ private _tweens;
10
+ private _tweensAddedDuringUpdate;
11
+ getAll(): Array<Tween<UnknownProps>>;
12
+ removeAll(): void;
13
+ add(tween: Tween<UnknownProps>): void;
14
+ remove(tween: Tween<UnknownProps>): void;
15
+ update(time?: number, preserve?: boolean): boolean;
16
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ *
3
+ */
4
+ export type InterpolationFunction = (v: number[], k: number) => number;
5
+ /**
6
+ *
7
+ */
8
+ declare const Interpolation: {
9
+ Linear: (v: number[], k: number) => number;
10
+ Bezier: (v: number[], k: number) => number;
11
+ CatmullRom: (v: number[], k: number) => number;
12
+ Utils: {
13
+ Linear: (p0: number, p1: number, t: number) => number;
14
+ Bernstein: (n: number, i: number) => number;
15
+ Factorial: (n: number) => number;
16
+ CatmullRom: (p0: number, p1: number, p2: number, p3: number, t: number) => number;
17
+ };
18
+ };
19
+ export { Interpolation };
@@ -0,0 +1,2 @@
1
+ declare const now: () => number;
2
+ export { now };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Utils
3
+ */
4
+ export declare class Sequence {
5
+ private static _nextId;
6
+ static nextId(): number;
7
+ }
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Tween.js - Licensed under the MIT license
3
+ * https://github.com/tweenjs/tween.js
4
+ * ----------------------------------------------
5
+ *
6
+ * See https://github.com/tweenjs/tween.js/graphs/contributors for the full list of contributors.
7
+ * Thank you all, you're awesome!
8
+ */
9
+ import type { EasingFunction } from './Easing';
10
+ import type { InterpolationFunction } from './Interpolation';
11
+ import type { Group } from './Group';
12
+ export declare class Tween<T extends UnknownProps> {
13
+ private _object;
14
+ private _group;
15
+ private _isPaused;
16
+ private _pauseStart;
17
+ private _valuesStart;
18
+ private _valuesEnd;
19
+ private _valuesStartRepeat;
20
+ private _duration;
21
+ private _isDynamic;
22
+ private _initialRepeat;
23
+ private _repeat;
24
+ private _repeatDelayTime?;
25
+ private _yoyo;
26
+ private _isPlaying;
27
+ private _reversed;
28
+ private _delayTime;
29
+ private _startTime;
30
+ private _easingFunction;
31
+ private _interpolationFunction;
32
+ private _chainedTweens;
33
+ private _onStartCallback?;
34
+ private _onStartCallbackFired;
35
+ private _onEveryStartCallback?;
36
+ private _onEveryStartCallbackFired;
37
+ private _onUpdateCallback?;
38
+ private _onRepeatCallback?;
39
+ private _onCompleteCallback?;
40
+ private _onStopCallback?;
41
+ private _onFinishCallback?;
42
+ private _id;
43
+ private _isChainStopped;
44
+ private _propertiesAreSetUp;
45
+ private _headTween;
46
+ private _tailTween;
47
+ private _headTweenStartFired;
48
+ constructor(_object: T, _group?: Group | false);
49
+ getId(): number;
50
+ isPlaying(): boolean;
51
+ isPaused(): boolean;
52
+ getDuration(): number;
53
+ from(properties: UnknownProps): this;
54
+ to(target: UnknownProps, duration?: number): this;
55
+ duration(duration?: number): this;
56
+ dynamic(dynamic?: boolean): this;
57
+ start(time?: number, overrideStartingValues?: boolean): this;
58
+ startFromCurrentValues(time?: number): this;
59
+ private _setupProperties;
60
+ stop(): this;
61
+ end(): this;
62
+ pause(time?: number): this;
63
+ resume(time?: number): this;
64
+ stopChainedTweens(): this;
65
+ group(group?: Group): this;
66
+ call(callback: (object: T) => void): this;
67
+ delay(amount?: number): this;
68
+ union(headTween: Tween<T>, tailTween: Tween<T>): this;
69
+ repeat(times?: number): this;
70
+ repeatDelay(amount?: number): this;
71
+ yoyo(yoyo?: boolean): this;
72
+ easing(easingFunction?: EasingFunction): this;
73
+ interpolation(interpolationFunction?: InterpolationFunction): this;
74
+ chain(...tweens: Array<Tween<any>>): this;
75
+ unchain(...tweens: Array<Tween<any>>): this;
76
+ onStart(callback?: (object: T) => void): this;
77
+ onEveryStart(callback?: (object: T) => void): this;
78
+ onUpdate(callback?: (object: T, elapsed: number) => void): this;
79
+ onRepeat(callback?: (object: T) => void): this;
80
+ onComplete(callback?: (object: T) => void): this;
81
+ onStop(callback?: (object: T) => void): this;
82
+ private _goToEnd;
83
+ /**
84
+ * @returns true if the tween is still playing after the update, false
85
+ * otherwise (calling update on a paused tween still returns true because
86
+ * it is still playing, just paused).
87
+ */
88
+ update(time?: number, autoStart?: boolean): boolean;
89
+ private _calculateElapsedPortion;
90
+ private _calculateCompletionStatus;
91
+ private _processRepetition;
92
+ private _updateProperties;
93
+ private _handleRelativeValue;
94
+ private _swapEndStartRepeatValues;
95
+ }
96
+ export type UnknownProps = Record<string, any>;
@@ -1,15 +1,25 @@
1
- import { Group, Tween } from "./tween";
1
+ import { Tween } from "./Tween";
2
+ import { Group } from "./Group";
2
3
  export declare class TweenChain {
3
4
  private _object;
5
+ private _group;
4
6
  private _tween;
5
7
  private _chainedTween;
6
8
  constructor(object: Object, group?: Group);
7
9
  start(): this;
8
10
  stop(): this;
9
- repeat(times: any): this;
11
+ repeat(times: number): this;
10
12
  union(): this;
11
- call(callback: any): this;
12
- delay(amount: any): this;
13
- to(properties: any, duration: any, props: any): this;
13
+ call(callback: (object: Object) => void): this;
14
+ delay(amount: number): this;
15
+ to(properties: Record<string, any>, duration?: number, props?: {
16
+ from?: Record<string, any>;
17
+ easing?: (amount: number) => number;
18
+ onStart?: (object: Object) => void;
19
+ onStop?: (object: Object) => void;
20
+ onComplete?: (object: Object) => void;
21
+ onUpdate?: (object: Object, elapsed: number) => void;
22
+ onRepeat?: (object: Object) => void;
23
+ }): this;
14
24
  _chainTween(): Tween<Object>;
15
25
  }