@polarfront-lab/ionian 1.0.0 → 1.0.1

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 (2) hide show
  1. package/dist/index.d.ts +99 -4
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -4,18 +4,75 @@ import * as THREE from 'three';
4
4
  * Represents an entry for an asset, pairing an ID with the asset itself.
5
5
  * @template T The type of the asset.
6
6
  */
7
- declare type AssetEntry<T> = {
7
+ export declare type AssetEntry<T> = {
8
8
  id: string;
9
9
  item: T;
10
10
  };
11
11
 
12
+ /**
13
+ * Represents a collection of assets, organized by asset ID and further
14
+ * categorized by numerical keys (e.g., texture size).
15
+ * @template T The type of the asset.
16
+ */
17
+ export declare type Assets<T> = Map<string, Map<number, T>>;
18
+
19
+ export declare type Callback = () => void;
20
+
21
+ export declare type DataTextureEntry = {
22
+ textureSize: number;
23
+ dataTexture: THREE.DataTexture;
24
+ };
25
+
26
+ declare type DataTextureEvents = {
27
+ meshRegistered: {
28
+ id: string;
29
+ };
30
+ };
31
+
12
32
  /**
13
33
  * Represents an easing function.
14
34
  */
15
- declare interface EasingFunction {
35
+ export declare interface EasingFunction {
16
36
  (n: number): number;
17
37
  }
18
38
 
39
+ export declare type Events = GlobalEvents & SimulationEvents & DataTextureEvents & MatcapEvents & TransitionEvents;
40
+
41
+ declare type GlobalEvents = {
42
+ serviceStateUpdated: {
43
+ type: ServiceType;
44
+ state: ServiceState;
45
+ };
46
+ interactionPositionUpdated: {
47
+ position: THREE.Vector4Like;
48
+ };
49
+ invalidRequest: {
50
+ message: string;
51
+ };
52
+ };
53
+
54
+ declare type MatcapEvents = {
55
+ matcapRegistered: {
56
+ id: string;
57
+ };
58
+ matcapReplaced: {
59
+ id: string;
60
+ };
61
+ };
62
+
63
+ /**
64
+ * Represents the data of a mesh, including its position, normal, and scale.
65
+ */
66
+ export declare type MeshData = {
67
+ position: ArrayLike<number>;
68
+ normal?: ArrayLike<number>;
69
+ scale: {
70
+ x: number;
71
+ y: number;
72
+ z: number;
73
+ };
74
+ };
75
+
19
76
  /**
20
77
  * The main class for the particle engine.
21
78
  */
@@ -81,8 +138,46 @@ declare type ParticlesEngineParameters = {
81
138
  camera?: THREE.Camera;
82
139
  };
83
140
 
84
- declare type ServiceState = 'created' | 'initializing' | 'ready' | 'disposed' | 'error' | 'loading';
141
+ export declare type ServiceState = 'created' | 'initializing' | 'ready' | 'disposed' | 'error' | 'loading';
142
+
143
+ export declare type ServiceType = 'data-texture' | 'matcap' | 'instanced-mesh' | 'simulation';
144
+
145
+ declare type SimulationEvents = {};
146
+
147
+ export declare type TransitionCallback = (progress: number) => void;
148
+
149
+ export declare interface TransitionDetail {
150
+ duration: number;
151
+ easing: EasingFunction;
152
+ }
153
+
154
+ declare type TransitionEvents = {
155
+ /** transition started */
156
+ transitionStarted: {
157
+ type: TransitionType;
158
+ };
159
+ /** transition progressed */
160
+ transitionProgressed: {
161
+ type: TransitionType;
162
+ progress: number;
163
+ };
164
+ /** transition finished */
165
+ transitionFinished: {
166
+ type: TransitionType;
167
+ };
168
+ /** transition cancelled */
169
+ transitionCancelled: {
170
+ type: TransitionType;
171
+ };
172
+ };
173
+
174
+ export declare type TransitionOptions = {
175
+ onTransitionBegin?: Callback;
176
+ onTransitionProgress?: TransitionCallback;
177
+ onTransitionFinished?: Callback;
178
+ onTransitionCancelled?: Callback;
179
+ };
85
180
 
86
- declare type ServiceType = 'data-texture' | 'matcap' | 'instanced-mesh' | 'simulation';
181
+ export declare type TransitionType = 'data-texture' | 'matcap';
87
182
 
88
183
  export { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polarfront-lab/ionian",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "ThreeJS Collection Set",
5
5
  "main": "./dist/index.umd.js",
6
6
  "module": "./dist/index.es.js",