rbxts-chrono 2.0.0-experimental.4 → 2.0.0-experimental.6
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/package.json +1 -1
- package/src/index.d.ts +65 -56
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -106,7 +106,7 @@ type EntityEventName =
|
|
|
106
106
|
| "ModelChanged"
|
|
107
107
|
| "LockChanged";
|
|
108
108
|
|
|
109
|
-
// Entity interface
|
|
109
|
+
// Entity interface (data only - methods are static on EntityConstructor)
|
|
110
110
|
interface Entity {
|
|
111
111
|
/** Unique identifier for this entity */
|
|
112
112
|
readonly id: number;
|
|
@@ -131,102 +131,111 @@ interface Entity {
|
|
|
131
131
|
|
|
132
132
|
/** The most recent CFrame value */
|
|
133
133
|
readonly latestCFrame: CFrame | undefined;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
interface EntityConstructor {
|
|
137
|
+
new (
|
|
138
|
+
entityConfig?: string,
|
|
139
|
+
model?: Model | BasePart | string,
|
|
140
|
+
modelReplicationMode?: ModelReplicationMode,
|
|
141
|
+
initCFrame?: CFrame,
|
|
142
|
+
): Entity;
|
|
134
143
|
|
|
135
|
-
/** Sets or changes the model for
|
|
136
|
-
SetModel(
|
|
144
|
+
/** Sets or changes the model for an entity */
|
|
145
|
+
SetModel: (
|
|
146
|
+
entity: Entity,
|
|
137
147
|
model?: Model | BasePart | string,
|
|
138
148
|
modelReplicationMode?: ModelReplicationMode,
|
|
139
149
|
noDestroy?: boolean,
|
|
140
|
-
)
|
|
150
|
+
) => void;
|
|
141
151
|
|
|
142
152
|
/** Sets the entity configuration type */
|
|
143
|
-
SetConfig(entityConfig: string)
|
|
153
|
+
SetConfig: (entity: Entity, entityConfig: string) => void;
|
|
144
154
|
|
|
145
155
|
/** Sets the broad phase collision bounds */
|
|
146
|
-
SetBroadPhase(broadPhase?: Vector3)
|
|
156
|
+
SetBroadPhase: (entity: Entity, broadPhase?: Vector3) => void;
|
|
147
157
|
|
|
148
|
-
/** Gets custom data associated with
|
|
149
|
-
GetData<T = unknown>(
|
|
158
|
+
/** Gets custom data associated with an entity */
|
|
159
|
+
GetData: <T = unknown>(entity: Entity) => T;
|
|
150
160
|
|
|
151
|
-
/** Gets the model associated with
|
|
152
|
-
GetModel(
|
|
161
|
+
/** Gets the model associated with an entity */
|
|
162
|
+
GetModel: (entity: Entity) => Model | BasePart | undefined;
|
|
153
163
|
|
|
154
|
-
/** Sets custom data for
|
|
155
|
-
SetData(data: unknown)
|
|
164
|
+
/** Sets custom data for an entity */
|
|
165
|
+
SetData: (entity: Entity, data: unknown) => void;
|
|
156
166
|
|
|
157
167
|
/** Clears the mount relationship */
|
|
158
|
-
ClearMount(
|
|
168
|
+
ClearMount: (entity: Entity) => void;
|
|
159
169
|
|
|
160
|
-
/** Mounts
|
|
161
|
-
SetMount(parent?: Entity, offset?: CFrame)
|
|
170
|
+
/** Mounts an entity to a parent entity with optional offset */
|
|
171
|
+
SetMount: (entity: Entity, parent?: Entity, offset?: CFrame) => void;
|
|
162
172
|
|
|
163
173
|
/** Sets the network owner (player who controls this entity) */
|
|
164
|
-
SetNetworkOwner(player?: Player)
|
|
174
|
+
SetNetworkOwner: (entity: Entity, player?: Player) => void;
|
|
165
175
|
|
|
166
176
|
/** Clears the entity's snapshot buffer */
|
|
167
|
-
Clear(
|
|
177
|
+
Clear: (entity: Entity) => void;
|
|
168
178
|
|
|
169
|
-
/** Pauses replication for
|
|
170
|
-
PauseReplication(
|
|
179
|
+
/** Pauses replication for an entity */
|
|
180
|
+
PauseReplication: (entity: Entity) => void;
|
|
171
181
|
|
|
172
|
-
/** Resumes replication for
|
|
173
|
-
ResumeReplication(
|
|
182
|
+
/** Resumes replication for an entity */
|
|
183
|
+
ResumeReplication: (entity: Entity) => void;
|
|
174
184
|
|
|
175
185
|
/** Pushes a new CFrame snapshot at the given time */
|
|
176
|
-
Push(time: number, value: CFrame)
|
|
186
|
+
Push: (entity: Entity, time: number, value: CFrame) => boolean;
|
|
177
187
|
|
|
178
188
|
/** Gets the interpolated CFrame at a specific time */
|
|
179
|
-
GetAt(time: number)
|
|
189
|
+
GetAt: (entity: Entity, time: number) => CFrame | undefined;
|
|
180
190
|
|
|
181
191
|
/** Gets the target render time for interpolation */
|
|
182
|
-
GetTargetRenderTime(
|
|
192
|
+
GetTargetRenderTime: (entity: Entity) => number;
|
|
183
193
|
|
|
184
194
|
/** Sets whether position updates automatically */
|
|
185
|
-
SetAutoUpdatePos(autoUpdate: boolean)
|
|
195
|
+
SetAutoUpdatePos: (entity: Entity, autoUpdate: boolean) => void;
|
|
186
196
|
|
|
187
197
|
/** Gets the current CFrame */
|
|
188
|
-
GetCFrame(
|
|
198
|
+
GetCFrame: (entity: Entity) => CFrame | undefined;
|
|
189
199
|
|
|
190
200
|
/** Sets the current CFrame */
|
|
191
|
-
SetCFrame(cframe: CFrame)
|
|
201
|
+
SetCFrame: (entity: Entity, cframe: CFrame) => void;
|
|
192
202
|
|
|
193
203
|
/** Gets the primary part of the model */
|
|
194
|
-
GetPrimaryPart(
|
|
204
|
+
GetPrimaryPart: (entity: Entity) => BasePart | undefined;
|
|
195
205
|
|
|
196
206
|
/** Locks native server CFrame replication */
|
|
197
|
-
LockNativeServerCFrameReplication(
|
|
207
|
+
LockNativeServerCFrameReplication: (entity: Entity) => void;
|
|
198
208
|
|
|
199
209
|
/** Unlocks native server CFrame replication */
|
|
200
|
-
UnlockNativeServerCFrameReplication(
|
|
210
|
+
UnlockNativeServerCFrameReplication: (entity: Entity) => void;
|
|
201
211
|
|
|
202
|
-
/** Destroys
|
|
203
|
-
Destroy(
|
|
212
|
+
/** Destroys an entity */
|
|
213
|
+
Destroy: (entity: Entity) => void;
|
|
204
214
|
|
|
205
215
|
/** Gets an event by name */
|
|
206
|
-
GetEvent(name: "Destroying")
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
): Entity;
|
|
216
|
+
GetEvent: ((entity: Entity, name: "Destroying") => ChronoEvent<(entity: Entity) => void>) &
|
|
217
|
+
((
|
|
218
|
+
entity: Entity,
|
|
219
|
+
name: "NetworkOwnerChanged",
|
|
220
|
+
) => ChronoEvent<(entity: Entity, newOwner: Player | undefined, prevOwner: Player | undefined) => void>) &
|
|
221
|
+
((
|
|
222
|
+
entity: Entity,
|
|
223
|
+
name: "PushedSnapShot",
|
|
224
|
+
) => ChronoEvent<(entity: Entity, time: number, value: CFrame, isNewest: boolean) => void>) &
|
|
225
|
+
((
|
|
226
|
+
entity: Entity,
|
|
227
|
+
name: "TickChanged",
|
|
228
|
+
) => ChronoEvent<(entity: Entity, newTickType: "NONE" | "HALF" | "NORMAL") => void>) &
|
|
229
|
+
((entity: Entity, name: "DataChanged") => ChronoEvent<(entity: Entity, data: unknown) => void>) &
|
|
230
|
+
((entity: Entity, name: "Ticked") => ChronoEvent<(entity: Entity, dt: number) => void>) &
|
|
231
|
+
((
|
|
232
|
+
entity: Entity,
|
|
233
|
+
name: "ModelChanged",
|
|
234
|
+
) => ChronoEvent<
|
|
235
|
+
(entity: Entity, newModel: Model | BasePart | undefined, oldModel: Model | BasePart | undefined) => void
|
|
236
|
+
>) &
|
|
237
|
+
((entity: Entity, name: "LockChanged") => ChronoEvent<(entity: Entity, isLocked: boolean) => void>) &
|
|
238
|
+
((entity: Entity, name: EntityEventName) => ChronoEvent);
|
|
230
239
|
}
|
|
231
240
|
|
|
232
241
|
// Replication rule types
|