@eves26phylum/types 1.0.2

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/global.d.ts +1016 -0
  2. package/package.json +16 -0
package/global.d.ts ADDED
@@ -0,0 +1,1016 @@
1
+ /// <reference types="@rbxts/types" />
2
+ /// <reference types="@rbxts/compiler-types" />
3
+ // Note: this is unfinished because i haven't taken the time to make every single thing work. This will be improved on when I find bugs because the LLM cannot access the full context of the game's environment because I didn't give it the stuff in _G
4
+
5
+ type CamelToSnake<S extends string> = S extends `${infer T}${infer U}`
6
+ ? `${T extends Capitalize<T> ? "_" : ""}${Lowercase<T>}${CamelToSnake<U>}`
7
+ : S;
8
+ type SnakifyString<S extends string> = CamelToSnake<S> extends `_${infer T}` ? T : CamelToSnake<S>;
9
+
10
+ type SnakifyKeys<T> = {
11
+ [K in keyof T]: T[K];
12
+ };
13
+
14
+ type SnakeRaycastParams = SnakifyKeys<RaycastParams>;
15
+ type SnakeRaycastResult = SnakifyKeys<RaycastResult>;
16
+
17
+ /**
18
+ * Filters out any property whose VALUE type is `symbol` (including `unique symbol`).
19
+ *
20
+ * @rbxts/types uses nominal brand properties of the form
21
+ * `readonly _nominal_Instance: unique symbol` on every class in the Roblox
22
+ * hierarchy. roblox-ts inspects these brands to decide whether to emit
23
+ * `self:method()` (Roblox instance) or `self.method()` (plain object).
24
+ *
25
+ * By stripping all symbol-valued properties before intersecting with
26
+ * InstanceProperties<T>, WrappedInstance becomes a plain anonymous object type
27
+ * that roblox-ts cannot identify as a Roblox class, so dot-call emission
28
+ * applies to every callable member — for any T, including the default T=Instance.
29
+ */
30
+ type StripRobloxBrands<T> = { [K in keyof T as T[K] extends symbol ? never : K]: T[K] }
31
+
32
+ // ================================================================
33
+ // Deadline Modding – TypeScript Ambient Declarations
34
+ // Source: https://recoil-group.github.io/deadline-modding/making-mods/scripting/api/
35
+ //
36
+ // Drop this file anywhere in your project and add it to your
37
+ // tsconfig.json "include" array for full autocomplete coverage.
38
+ //
39
+ // Roblox engine primitives (Vector3, CFrame, Color3…) are declared
40
+ // below as minimal stubs. If you're using roblox-ts, delete the
41
+ // entire "ROBLOX ENGINE PRIMITIVES" section and import from
42
+ // @rbxts/types instead.
43
+ //
44
+ // Availability tags used throughout:
45
+ // [SHARED] – available in both server and client scripts
46
+ // [SERVER] – server scripts only
47
+ // [CLIENT] – client scripts only
48
+ // ================================================================
49
+
50
+
51
+ // ================================================================
52
+ // ROBLOX ENGINE PRIMITIVES
53
+ // ================================================================
54
+
55
+ // ================================================================
56
+ // CORE INFRASTRUCTURE
57
+ // ================================================================
58
+
59
+
60
+
61
+ // ================================================================
62
+ // GAME CLASSES [SHARED]
63
+ // ================================================================
64
+
65
+ interface TimerInstance {
66
+ /** Returns true once the configured interval has elapsed since the last reset(). */
67
+ // docs: timer:expired() — colon, keep as method
68
+ expired(): boolean;
69
+ /** Restarts the countdown from zero. */
70
+ // docs: timer:reset() — colon, keep as method
71
+ reset(): void;
72
+ }
73
+
74
+ /**
75
+ * Fires an expiry flag once per configured interval.
76
+ * Intended for use inside time.renderstep callbacks.
77
+ * @example
78
+ * const t = Timer.new(5);
79
+ * time.renderstep("my_label", (dt) => {
80
+ * if (t.expired()) { t.reset(); print("5s passed"); }
81
+ * });
82
+ */
83
+ declare const Timer: {
84
+ new(interval: number): TimerInstance;
85
+ };
86
+
87
+ interface SpringInstance {
88
+ /** Applies an instantaneous velocity impulse to the spring. */
89
+ // docs: spring:shove() — colon, keep as method
90
+ shove(vector: Vector3): void;
91
+ /** Advances the spring simulation by deltaTime seconds. */
92
+ // docs: spring:update() — colon, keep as method
93
+ update(deltaTime: number): void;
94
+ }
95
+
96
+ /**
97
+ * Critically-damped spring, useful for smooth value / camera interpolation.
98
+ * @param mass Default 1
99
+ * @param force Default 50
100
+ * @param damping Default 4
101
+ * @param speed Default 4
102
+ */
103
+ declare const Spring: {
104
+ new(mass?: number, force?: number, damping?: number, speed?: number): SpringInstance;
105
+ };
106
+
107
+ interface SignalInstance<T extends (...args: any[]) => void = (...args: any[]) => void> extends RBXScriptSignal {
108
+ // docs: signal:Fire() — colon, keep as method
109
+ Fire(...args: Parameters<T>): void;
110
+ }
111
+
112
+ /** Creates a new manually-controlled Signal. */
113
+ declare const Signal: {
114
+ new<T extends (...args: any[]) => void = (...args: any[]) => void>(): SignalInstance<T>;
115
+ };
116
+
117
+
118
+ // ================================================================
119
+ // INSTANCE SYSTEM [SHARED]
120
+ // ================================================================
121
+
122
+ /**
123
+ * A sandboxed proxy wrapping a Roblox engine instance.
124
+ *
125
+ * All callable members use dot notation in the Deadline modding API
126
+ * (e.g. `instance.play()`, `instance.get_tags()`), so every method
127
+ * is declared as a property function so roblox-ts emits `self.method()`
128
+ * rather than `self:method()`.
129
+ *
130
+ * The intersection with StripRobloxBrands<InstanceProperties<T>> provides
131
+ * full property autocomplete and type safety for direct property assignments
132
+ * (e.g. `instance.Size = new Vector3(...)`) while stripping the @rbxts/types
133
+ * nominal brand properties (readonly _nominal_*: unique symbol) that would
134
+ * otherwise cause roblox-ts to identify this type as a Roblox Instance and
135
+ * force colon-call emission.
136
+ *
137
+ * Properties may be **set** freely (e.g. `instance.Volume = 0.5`,
138
+ * `instance.Parent = get_map_root()`). Reading back Roblox-native
139
+ * properties like `.Parent` is **not** supported by the proxy — only
140
+ * the explicitly typed members below return meaningful values.
141
+ */
142
+ type WrappedInstance<T extends Instance = Instance> = {
143
+ /** Set the Roblox Parent. Reading it back is not supported. */
144
+ Parent: WrappedInstance<Instance>;
145
+ /** Set the Roblox Name. Reading it back is not supported. */
146
+ Name: string;
147
+
148
+ // ── Sound (valid on Sound instances only) ────────────────────
149
+ // docs: sound.play(), sound.stop(), sound.create() — dot notation
150
+ play: () => void;
151
+ stop: () => void;
152
+ /** Creates a new standalone Sound instance. Valid on Sound instances only. */
153
+
154
+ // ── Lifecycle ────────────────────────────────────────────────
155
+ // docs: sound.clone(), clone.destroy() — dot notation
156
+ clone: () => WrappedInstance<Instance>;
157
+ destroy: () => void;
158
+
159
+ // ── CollectionService tags ───────────────────────────────────
160
+ // docs: sound.get_tags(), sound.add_tag(), sound.remove_tag() — dot notation
161
+ get_tags: () => string[];
162
+ add_tag: (tag: string) => void;
163
+ remove_tag: (tag: string) => void;
164
+
165
+ // ── Attributes ───────────────────────────────────────────────
166
+ // docs: sound.set_attribute(), sound.get_attribute() — dot notation
167
+ set_attribute: (name: string, value: unknown) => void;
168
+ get_attribute: (name: string) => unknown;
169
+
170
+ // ── Model (valid on Model instances only) ────────────────────
171
+ // docs: model.pivot_to(), model.get_pivot() — dot notation
172
+ pivot_to: (cframe: CFrame) => void;
173
+ get_pivot: () => CFrame;
174
+
175
+ // ── Physics (valid on BasePart / physics-enabled instances) ──
176
+ // docs: instance.apply_impulse(), instance.apply_impulse_at_position(), etc. — dot notation
177
+ apply_impulse: (impulse: Vector3) => void;
178
+ apply_impulse_at_position: (impulse: Vector3, position: Vector3) => void;
179
+ apply_angular_impulse_at_position: (angular: Vector3, position: Vector3) => void;
180
+ set_network_owner: (owner: string | undefined) => void;
181
+
182
+ // ── Hierarchy / util ─────────────────────────────────────────
183
+ // docs: dot notation throughout instance examples
184
+ is_in_workspace: () => boolean;
185
+ find_first_child: (childName: string, recursive?: boolean) => WrappedInstance | undefined;
186
+ is_a: <C extends keyof Instances>(childName: C) => this is WrappedInstance<Instances[C]>;
187
+ is_descendant_of: (instance: WrappedInstance) => boolean;
188
+
189
+ } & StripRobloxBrands<InstanceProperties<T>>
190
+
191
+ /**
192
+ * Result of tags.get_tagged / tags.get_all_tagged.
193
+ *
194
+ * BasePart instances carry full spatial data. Non-part instances
195
+ * (sounds, scripts, etc.) only provide `name`.
196
+ */
197
+ interface TaggedInstanceResult extends WrappedInstance {
198
+ name: string;
199
+ /** Defined for BasePart-derived instances only. */
200
+ cframe?: CFrame;
201
+ /** Defined for BasePart-derived instances only. */
202
+ position?: Vector3;
203
+ /** Euler orientation in degrees. Defined for BasePart-derived instances only. */
204
+ orientation?: Vector3;
205
+ /** Bounding box size. Defined for BasePart-derived instances only. */
206
+ size?: Vector3;
207
+ }
208
+
209
+ /** Returns the root Model of the currently active map. Useful for parenting instances. */
210
+ declare function get_map_root(): WrappedInstance;
211
+
212
+ /** Returns the Characters folder. Useful for parenting character-attached visuals. */
213
+ declare function get_chars_root(): WrappedInstance;
214
+
215
+
216
+ // ================================================================
217
+ // RAYCASTING [SHARED]
218
+ // ================================================================
219
+
220
+ interface RaycastParams {
221
+ // docs: raycast_params.filter_descendants_instances(), raycast_params.filter_type() — dot notation
222
+ /** Adds instances and all their descendants to the filter list. */
223
+ filter_descendants_instances: (instances: WrappedInstance[]) => void;
224
+ /** Sets the filter behaviour (Enum.RaycastFilterType.Exclude or Include). */
225
+ filter_type: (filterType: EnumItem) => void;
226
+ }
227
+
228
+ interface RaycastResult {
229
+ /** The WrappedInstance that was struck. */
230
+ instance: WrappedInstance;
231
+ position: Vector3;
232
+ normal: Vector3;
233
+ distance: number;
234
+ material: unknown;
235
+ }
236
+
237
+
238
+ // ================================================================
239
+ // SHARED GAME DATA TYPES
240
+ // ================================================================
241
+
242
+ type WeaponSlot = "primary" | "secondary" | "throwable1" | "throwable2";
243
+ type GunSlot = "primary" | "secondary";
244
+ type UtilitySlot = "throwable1" | "throwable2";
245
+ type PlayerTeam = "defender" | "attacker";
246
+ type KillerType = "burning" | "drowning" | "firearm" | "grenade" | "map_reset" | "other" | "reset";
247
+
248
+ interface KillerData {
249
+ type: KillerType;
250
+ /** Present when the kill was attributed to another player. */
251
+ attacker?: string;
252
+ }
253
+
254
+ /**
255
+ * Returned by weapons.get_setup_from_code.
256
+ * A `status` of `"_"` means the setup is valid and safe to use.
257
+ */
258
+ interface WeaponSetupResult {
259
+ /** `"_"` = valid. Any other value is a descriptive error string. */
260
+ status: string;
261
+ data: {
262
+ /** Raw JSON attachment setup string. Pass directly into player.set_weapon. */
263
+ data: string;
264
+ };
265
+ }
266
+
267
+ interface SetupStatusRailFailure {
268
+ [key: string]: unknown;
269
+ }
270
+
271
+ interface SetupStatusResult {
272
+ /** Per-slot state map of non-rail failures. */
273
+ state: Record<string, unknown>;
274
+ rail_state: {
275
+ failures: SetupStatusRailFailure[];
276
+ };
277
+ }
278
+
279
+ interface LoadoutWeaponData {
280
+ weapon: string;
281
+ /** Raw JSON setup string. */
282
+ data: string;
283
+ }
284
+
285
+ interface CharacterWeaponClientData {
286
+ name: string;
287
+ /** Raw JSON setup string. */
288
+ setup: string;
289
+ laser_enabled: boolean;
290
+ }
291
+
292
+ interface ThrowableWeaponData {
293
+ name: string;
294
+ type: "throwable"
295
+ }
296
+ interface CharacterWeaponData {
297
+ /** Raw ammo table — modifying this directly produces unpredictable results. */
298
+ ammo: unknown;
299
+ client_data: CharacterWeaponClientData;
300
+ }
301
+
302
+ interface MapConfig {
303
+ [key: string]: unknown;
304
+ }
305
+
306
+ interface SettingsLayoutEntry {
307
+ setting: string;
308
+ type: string;
309
+ }
310
+
311
+
312
+ // ================================================================
313
+ // SHARED GLOBALS [SHARED]
314
+ // ================================================================
315
+
316
+ /**
317
+ * Timescale-aware wrappers around RenderStepped / Heartbeat.
318
+ * All delta_time values passed to callbacks are pre-multiplied by the
319
+ * current game speed returned by time.get_speed().
320
+ */
321
+ declare namespace time {
322
+ /**
323
+ * Registers a per-frame callback (RenderStepped equivalent).
324
+ * @param label Unique identifier for this listener.
325
+ * @returns A RBXScriptConnection — call Disconnect() to unsubscribe.
326
+ */
327
+ function renderstep(label: string, callback: (deltaTime: number) => void): RBXScriptConnection;
328
+ /**
329
+ * Registers a per-physics-step callback (Heartbeat equivalent).
330
+ * @param label Unique identifier for this listener.
331
+ * @returns A RBXScriptConnection — call Disconnect() to unsubscribe.
332
+ */
333
+ function heartbeat(label: string, callback: (deltaTime: number) => void): RBXScriptConnection;
334
+ /** Fires when the local timescale changes (e.g. end-of-match slow motion). */
335
+ const local_timescale_changed: RBXScriptSignal;
336
+ /** Overrides the client-local timescale multiplier. */
337
+ function set_local_timescale(scale: number): void;
338
+ /** Returns the current combined game speed multiplier. */
339
+ function get_speed(): number;
340
+ /** task.delay equivalent whose timer is affected by game speed. */
341
+ function delay(seconds: number, callback: () => void): void;
342
+ /** task.wait equivalent whose duration is affected by game speed. */
343
+ function wait(seconds: number): void;
344
+ }
345
+
346
+ /** CollectionService tag queries scoped to workspace instances. */
347
+ declare namespace tags {
348
+ /** Returns every CollectionService tag in use anywhere in the game. */
349
+ function get_tags(): string[];
350
+ /** Returns all tagged instances inside workspace (the active map). */
351
+ function get_tagged(tag: string): TaggedInstanceResult[];
352
+ /**
353
+ * Returns all tagged instances regardless of parent hierarchy.
354
+ * Useful when working with maps loaded as models before swapping them in.
355
+ */
356
+ function get_all_tagged(tag: string): TaggedInstanceResult[];
357
+ }
358
+
359
+ /** Spatial queries. */
360
+ declare namespace query {
361
+ /** Creates a new empty RaycastParams configuration object. */
362
+ function create_raycast_params(): SnakeRaycastParams;
363
+ /**
364
+ * Casts a ray from `origin` in `direction`.
365
+ * @returns The first hit result, or undefined if nothing was struck.
366
+ */
367
+ function raycast(
368
+ origin: Vector3,
369
+ direction: Vector3,
370
+ params?: SnakeRaycastParams
371
+ ): SnakeRaycastResult | undefined;
372
+ }
373
+
374
+ /**
375
+ * Game-wide settings table. Over 100 configurable keys exist — iterate
376
+ * `sharedvars_descriptions` at runtime to see all of them.
377
+ *
378
+ * Note: the underlying value is a Lua metatable; direct iteration
379
+ * (for…in) does not work. Use `sharedvars_descriptions` to enumerate keys.
380
+ * Writes only take effect when executed on the server.
381
+ */
382
+ declare const sharedvars: {
383
+ /** Toggles chat tips for all players. [SERVER] */
384
+ chat_tips_enabled: boolean;
385
+ /** Adds an offset in hours to the in-game clock. */
386
+ sv_time_offset: number;
387
+ /** When false, players are blocked from spawning. [SERVER] */
388
+ sv_spawning_enabled: boolean;
389
+ /** When false, weapon stat clamping is disabled for all players. */
390
+ plr_weapon_clamp_stats_values: boolean;
391
+ [key: string]: unknown;
392
+ };
393
+
394
+ /** Human-readable description strings for every sharedvars key. */
395
+ declare const sharedvars_descriptions: Record<string, string>;
396
+
397
+ /**
398
+ * Persistent cross-script key-value storage for the current session.
399
+ * Values survive script reloads but are not persisted across server restarts.
400
+ */
401
+ declare const Shared: Record<string, unknown>;
402
+
403
+ declare function print(...args: unknown[]): void;
404
+ /** Clears all output in the in-game developer console. */
405
+ declare function clear_console(): void;
406
+
407
+
408
+ // ================================================================
409
+ // SERVER GLOBALS [SERVER]
410
+ // ================================================================
411
+
412
+ /**
413
+ * Sets the base URL prepended to all subsequent require() calls.
414
+ * @example set_require_domain("https://raw.githubusercontent.com/user/repo/master/")
415
+ */
416
+ declare function set_require_domain(url: string): void;
417
+
418
+ /**
419
+ * Fetches and executes a Lua script at `path` relative to the require domain.
420
+ * @example require("luau/server/gamemode_setup.lua")
421
+ */
422
+ declare function require(path: string): unknown;
423
+
424
+ /** Active map management. [SERVER] */
425
+ declare namespace map {
426
+ /** Swaps the active map immediately, killing all players. */
427
+ function set_map(name: string): void;
428
+ /** Applies a lighting preset without changing the map. See config.lighting_presets. */
429
+ function set_preset(name: string): void;
430
+ /**
431
+ * Presents a player vote drawn from config.maps.MAP_CONFIGURATION.
432
+ * Resolves with the winning map key once the vote concludes.
433
+ */
434
+ function run_vote(): string;
435
+ /** Applies a full MapConfig entry (map geometry, gamemode, and time simultaneously). */
436
+ function set_map_from_config(mapConfig: MapConfig): void;
437
+ /**
438
+ * Sets the in-game time of day. Value range 0–24; sv_time_offset is applied on top.
439
+ * @param hour e.g. 10 = 10 AM
440
+ */
441
+ function set_time(hour: number): void;
442
+ /** Returns a record of all registered map names and their configuration objects. */
443
+ function get_maps(): Record<string, MapConfig>;
444
+ }
445
+
446
+ /** Gamemode management. [SERVER] */
447
+ declare namespace gamemode {
448
+ function set_gamemode(name: string): void;
449
+ /** Switches gamemode without triggering a map reload. */
450
+ function force_set_gamemode(name: string): void;
451
+ /** Enumeration of all registered gamemode names. */
452
+ const available_gamemodes: Record<string, unknown>;
453
+ /**
454
+ * Fires when the current round ends.
455
+ * @param avoidResettingMap When true the map is not reloaded at round end.
456
+ */
457
+ const finished: RBXScriptSignal<(avoidResettingMap: boolean) => void>;
458
+ /** Fires when a new round begins. */
459
+ const started: RBXScriptSignal;
460
+ }
461
+
462
+ /** Chat messages and HUD notifications. [SERVER] */
463
+ declare namespace chat {
464
+ /**
465
+ * Fires when any player sends a chat message.
466
+ * Split `content` on spaces to parse slash-commands.
467
+ */
468
+ const player_chatted: RBXScriptSignal<(sender: string, channel: string, content: string) => void>;
469
+ /**
470
+ * Broadcasts a coloured announcement to the chat box for all players.
471
+ * @param color Optional Color3; defaults to white.
472
+ */
473
+ function send_announcement(message: string, color?: Color3): void;
474
+ /** Sets the greeting message shown to players on join. */
475
+ function set_join_message(message: string): void;
476
+ /**
477
+ * Sets the text displayed in the spawn-disabled prompt.
478
+ * Only shown when sharedvars.sv_spawning_enabled is false.
479
+ */
480
+ function set_spawning_disabled_reason(reason: string): void;
481
+ /** Displays a brief HUD notification to all players. */
482
+ function send_ingame_notification(message: string): void;
483
+ }
484
+
485
+ /** Server-side audio utilities. [SERVER] */
486
+ declare namespace sound {
487
+ /** Plays a server-wide guitar riff. A critical gameplay feature. */
488
+ function play_sick_riff(): void;
489
+ function create(): WrappedInstance<Sound>;
490
+ }
491
+
492
+ /** Player collection queries. [SERVER] */
493
+ declare namespace players {
494
+ /** Returns every connected player (including bots). */
495
+ function get_all(): Player[];
496
+ /** Returns only players who are currently alive in the world. */
497
+ function get_alive(): Player[];
498
+ /** Looks up a player by display name. Returns undefined if not found. */
499
+ function get(name: string): Player | undefined;
500
+ /** Looks up a player by Roblox UserId. Returns undefined if not found. */
501
+ function get_by_userid(id: number): Player | undefined;
502
+ /** Removes all ragdoll models currently present in the world. */
503
+ function reset_ragdolls(): void;
504
+ }
505
+
506
+ /**
507
+ * Per-player API. Instances are obtained through players.get / players.get_all
508
+ * and the on_player_* event callbacks.
509
+ *
510
+ * All members use dot notation in the Deadline modding API
511
+ * (e.g. `player.kill()`, `player.get_team()`), so every callable
512
+ * is declared as a property function so roblox-ts emits `self.method()`
513
+ * rather than `self:method()`.
514
+ */
515
+ interface Player {
516
+ /** Display name / Roblox username. */
517
+ readonly name: string;
518
+ /** Roblox UserId — persistent across sessions. */
519
+ readonly id: number;
520
+ /** Server-session-unique numeric ID — changes each time the server restarts. */
521
+ readonly player_id: number;
522
+
523
+ // ── Lifecycle ───────────────────────────────────────────────
524
+ // docs: player.is_alive(), player.kill(), player.explode(), etc. — dot notation
525
+ is_alive: () => boolean;
526
+ kill: () => void;
527
+ explode: () => void;
528
+ kick: () => void;
529
+ ban_from_server: () => void;
530
+ /** Spawns the player if they are not already in the world. */
531
+ spawn: () => void;
532
+ /** Force-respawns the player even if they are currently alive. */
533
+ respawn: () => void;
534
+
535
+ // ── Team ────────────────────────────────────────────────────
536
+ // docs: player.set_team(), player.get_team() — dot notation
537
+ set_team: (team: PlayerTeam) => void;
538
+ get_team: () => PlayerTeam;
539
+
540
+ // ── Classification ──────────────────────────────────────────
541
+ // docs: player.is_bot() — dot notation
542
+ is_bot: () => boolean;
543
+
544
+ // ── Position & Camera ───────────────────────────────────────
545
+ // docs: player.set_position(), player.get_position(), player.set_camera_mode() — dot notation
546
+ set_position: (position: Vector3) => void;
547
+ /** Returns null when the player is dead and has no character. */
548
+ get_position: () => Vector3 | undefined;
549
+ set_camera_mode: (mode: string) => void;
550
+ /**
551
+ * Activates a registered custom camera controller for this player.
552
+ * @see register_camera_mode
553
+ */
554
+ set_custom_camera_mode: (mode: string) => void;
555
+
556
+ // ── Movement & Stats ────────────────────────────────────────
557
+ // docs: player.set_animation_speed(), player.set_speed(), etc. — dot notation
558
+ set_animation_speed: (speed: number) => void;
559
+ get_animation_speed: () => number;
560
+ set_speed: (speed: number) => void;
561
+ set_jump_multiplier: (multiplier: number) => void;
562
+ set_health: (health: number) => void;
563
+ get_health: () => number;
564
+ deal_damage: (amount: number) => void;
565
+ /** Sets the health value applied on the next spawn — not immediate. */
566
+ set_initial_health: (health: number) => void;
567
+
568
+ // ── Appearance ──────────────────────────────────────────────
569
+ // docs: player.set_model() — dot notation
570
+ set_model: (model: string) => void;
571
+
572
+ // ── Weapons ─────────────────────────────────────────────────
573
+ // docs: player.refill_ammo(), player.get_active_slot(), etc. — dot notation
574
+ refill_ammo: () => void;
575
+ get_active_slot: () => WeaponSlot;
576
+ /**
577
+ * Forces the player to equip the weapon in the given slot.
578
+ * @param immediate When true the switch happens instantly with no animation.
579
+ */
580
+ equip_weapon: (slot: WeaponSlot, immediate?: boolean) => void;
581
+ /**
582
+ * Assigns a weapon and its attachment setup to a slot.
583
+ * Pass `"nothing"` as the weapon name to clear the slot.
584
+ * Pass `"[]"` as data when you have no attachment setup.
585
+ */
586
+ set_weapon: (slot: WeaponSlot, weapon: string, data?: string) => void;
587
+ /**
588
+ * Returns weapon data from the player's saved loadout.
589
+ * @param loadoutIndex Zero-based index (0 = first loadout, 1 = second, …).
590
+ */
591
+ get_weapon_from_loadout: (loadoutIndex: number, slot: WeaponSlot) => LoadoutWeaponData | undefined;
592
+ /** Returns live weapon data from the character currently present in the world. */
593
+ // get_weapon_data_from_character: (slot: WeaponSlot) => CharacterWeaponData | undefined;
594
+ // get_weapon_data_from_character: (slot: UtilitySlot) => ThrowableWeaponData | undefined;
595
+ get_weapon_data_from_character: <T extends WeaponSlot>(slot: T) => (T extends GunSlot ? CharacterWeaponData : ThrowableWeaponData) | undefined;
596
+ // ── Profile & Leaderboard ───────────────────────────────────
597
+ // docs: player.get_profile_stats(), player.get_leaderboard_stats() — dot notation
598
+ get_profile_stats: () => unknown;
599
+ get_leaderboard_stats: () => unknown;
600
+
601
+ // ── Networking ──────────────────────────────────────────────
602
+ // docs: players.get("me").fire_client(123) — dot notation
603
+ /** Sends a remote event payload to this specific player's client. */
604
+ fire_client: (...args: unknown[]) => void;
605
+ }
606
+
607
+ /** Weapon attachment setup code utilities. [SERVER] */
608
+ declare namespace weapons {
609
+ /**
610
+ * Decodes a share-code string into setup data ready for player.set_weapon.
611
+ * Always check `result.status === "_"` before using the returned data.
612
+ */
613
+ function get_setup_from_code(code: string): WeaponSetupResult;
614
+ /**
615
+ * Validates decoded setup data against the current weapon registry.
616
+ * Returns a plain error string for certain failure classes, or a structured
617
+ * SetupStatusResult when attachment / rail slot failures are present.
618
+ */
619
+ function get_setup_status(data: unknown): string | SetupStatusResult;
620
+ }
621
+
622
+ /** World-object spawning utilities. [SERVER] */
623
+ declare namespace spawning {
624
+ /** Creates an M67-equivalent explosion at the given world-space position. */
625
+ function explosion(position: Vector3): void;
626
+ /**
627
+ * Spawns a bot player. Bots are treated as regular players in all APIs.
628
+ * @returns The bot's assigned display name.
629
+ */
630
+ function bot(): string;
631
+ /** i'd start watching out if i were you */
632
+ function monster(): string;
633
+ }
634
+
635
+ /**
636
+ * Central game configuration tables.
637
+ * Most entries are available on both server and client; client-only
638
+ * additions (gunshots, game_sounds, keybinds, settings_layout) are
639
+ * read/write only from client scripts.
640
+ */
641
+ declare namespace config {
642
+ /**
643
+ * Map configuration table.
644
+ * `MAP_CONFIGURATION` is the named table consumed by map.run_vote.
645
+ * `STUDIO_CONFIGURATION` is a factory for local Studio testing.
646
+ */
647
+ const maps: Record<string, MapConfig> & {
648
+ MAP_CONFIGURATION: Record<string, MapConfig>;
649
+ STUDIO_CONFIGURATION: () => MapConfig;
650
+ };
651
+ /** Lighting presets usable with map.set_preset(name). */
652
+ const lighting_presets: Record<string, unknown>;
653
+ /** Sound presets usable as a map's sound_preset property. */
654
+ const sound_presets: Record<string, unknown>;
655
+ /** Names of every weapon registered in the game. */
656
+ const weapon_names: string[];
657
+
658
+ // ── Client-only ─────────────────────────────────────────────
659
+ /**
660
+ * Map of weapon name → gunshot sound asset ID string.
661
+ * Assign a new asset ID to override a weapon's gunshot sound. [CLIENT]
662
+ */
663
+ const gunshots: Record<string, string>;
664
+ /**
665
+ * Nested map of game sound groups and their asset IDs.
666
+ * Entries can be replaced to override built-in game sounds. [CLIENT]
667
+ */
668
+ const game_sounds: Record<string, Record<string, unknown>>;
669
+ /** Map of action name → keybind configuration for all registered actions. [CLIENT] */
670
+ const keybinds: Record<string, unknown>;
671
+ /**
672
+ * Settings panel layout descriptor. Push SettingsLayoutEntry objects into
673
+ * `controls` to add custom entries to the controls settings page. [CLIENT]
674
+ */
675
+ const settings_layout: {
676
+ controls: SettingsLayoutEntry[];
677
+ };
678
+ }
679
+
680
+ interface GameDataNamespace {
681
+ readonly lighting: { value: unknown };
682
+ readonly map_properties: { value: { lighting_preset: string } };
683
+ readonly map_config: { value: Record<string, unknown> };
684
+ [key: string]: { value: unknown };
685
+ }
686
+
687
+ /**
688
+ * Live game state: active map, gamemode, lighting preset, and more.
689
+ * Iterate over the object to discover all available keys at runtime. [SERVER]
690
+ */
691
+ declare const game_data: GameDataNamespace;
692
+
693
+ /**
694
+ * Loads an encoded modfile data string into the game at runtime.
695
+ * Fires on_modfile_loaded upon completion. [SERVER]
696
+ */
697
+ declare function load_modfile(data: string): void;
698
+
699
+ /** Fires whenever any modfile (including other mods) finishes loading. [SERVER] */
700
+ declare const on_modfile_loaded: RBXScriptSignal;
701
+
702
+ // ── Networking ────────────────────────────────────────────────────
703
+
704
+ /** Fires on the server when any client calls fire_server(). [SERVER] */
705
+ declare const on_client_event: RBXScriptSignal<(player: string, args: unknown[]) => void>;
706
+
707
+ /** Sends a remote event payload from this client to the server. [CLIENT] */
708
+ declare function fire_server(...args: unknown[]): void;
709
+
710
+ /** Fires on the client when the server calls player.fire_client(). [CLIENT] */
711
+ declare const on_server_event: RBXScriptSignal<(args: unknown[]) => void>;
712
+
713
+ // ── Player lifecycle events ───────────────────────────────────────
714
+
715
+ /** Fires when any player's character enters the world. [SERVER] */
716
+ declare const on_player_spawned: RBXScriptSignal<(name: string) => void>;
717
+
718
+ /** Fires when any player connects to the server. [SERVER] */
719
+ declare const on_player_joined: RBXScriptSignal<(name: string) => void>;
720
+
721
+ /** Fires when any player disconnects from the server. [SERVER] */
722
+ declare const on_player_left: RBXScriptSignal<(name: string) => void>;
723
+
724
+ /**
725
+ * Fires when any player dies.
726
+ * `statsCounted` indicates whether this death was recorded in the
727
+ * player's persistent profile stats. [SERVER]
728
+ */
729
+ declare const on_player_died: RBXScriptSignal<(
730
+ name: string,
731
+ position: Vector3,
732
+ killerData: KillerData,
733
+ statsCounted: boolean
734
+ ) => void>;
735
+
736
+ // ── Interactables ─────────────────────────────────────────────────
737
+
738
+ /**
739
+ * Implement this interface to define the behaviour of a custom interactable.
740
+ * The `interact` method is called whenever a player uses the interactable.
741
+ */
742
+ interface InteractableHandler {
743
+ interact(player: Player): void;
744
+ }
745
+
746
+ /**
747
+ * Constructor-style class whose `new` factory produces an InteractableHandler.
748
+ * Pass your class directly to register_interactable.
749
+ */
750
+ interface InteractableHandlerClass {
751
+ new(instance: WrappedInstance): InteractableHandler;
752
+ }
753
+
754
+ /**
755
+ * Registers a custom interactable handler class for a given type string.
756
+ *
757
+ * Built-in types: `"ammo_refill"`, `"capture_refill"`, `"door"`.
758
+ *
759
+ * Custom types require a Model in the map with:
760
+ * - An Attachment instance named `display_point`
761
+ * - An attribute `interactable_type` whose string value matches `type`
762
+ *
763
+ * The map must be reloaded before newly registered interactables take effect. [SERVER]
764
+ */
765
+ declare function register_interactable(type: string, handler: InteractableHandlerClass): void;
766
+
767
+
768
+ // ================================================================
769
+ // CLIENT GLOBALS [CLIENT]
770
+ // ================================================================
771
+
772
+ /** The local player's display name. [CLIENT] */
773
+ declare const local_player: string;
774
+
775
+ /** Local character state and spawn/death lifecycle events. [CLIENT] */
776
+ declare namespace framework {
777
+ namespace character {
778
+ function is_alive(): boolean;
779
+ function get_position(): Vector3;
780
+ /** Returns the current camera CFrame, including ADS and lean offsets. */
781
+ function get_camera_cframe(): CFrame;
782
+ /** Programmatically enables or disables night-vision rendering. */
783
+ function set_nv_enabled(enabled: boolean): void;
784
+ /** True when night-vision is active for any reason, including NV scopes. */
785
+ function is_nv_enabled(): boolean;
786
+ /** True only when NV head-gear (goggles etc.) specifically is enabled. */
787
+ function is_nv_head_gear_enabled(): boolean;
788
+ }
789
+ /** Fires when the local player's character spawns into the world. */
790
+ const on_spawned: RBXScriptSignal;
791
+ /** Fires when the local player's character dies. */
792
+ const on_died: RBXScriptSignal;
793
+ }
794
+
795
+ /** Low-level mouse and keyboard input abstraction layer. [CLIENT] */
796
+ declare namespace input {
797
+ /** Equivalent to UserInputService:GetMouseDelta(). */
798
+ function get_mouse_delta(): Vector2;
799
+ /** Returns the player's configured mouse sensitivity scalar. */
800
+ function get_mouse_sensitivity(): number;
801
+ /** Returns Mouse.Origin as a CFrame. */
802
+ function get_mouse_origin(): CFrame;
803
+ /** Equivalent to UserInputService:GetMouseLocation(). */
804
+ function get_mouse_position(): Vector2;
805
+ /** Suppresses a default game action by its registered name (e.g. "crouch"). */
806
+ function disable_default_action(action: string): void;
807
+ /** Re-enables a previously disabled default game action. */
808
+ function enable_default_action(action: string): void;
809
+ }
810
+
811
+ /**
812
+ * The two input phase constants used with bind_user_setting and bind_key.
813
+ * Use InputType.Began for key-down and InputType.Ended for key-up.
814
+ */
815
+ declare const InputType: {
816
+ readonly Began: "Began";
817
+ readonly Ended: "Ended";
818
+ };
819
+
820
+ type InputTypeValue = "Began" | "Ended";
821
+
822
+ interface InputGroupDefault {
823
+ // docs: group:disconnect_all_binds() — colon, keep as method
824
+ disconnect_all_binds(): void;
825
+ }
826
+ interface InputGroupInstance extends InputGroupDefault {
827
+ // docs: input_group:bind_key(...) — colon, keep as method
828
+ bind_key(
829
+ callback: () => void,
830
+ type: InputTypeValue,
831
+ ignoreGameProcessed: boolean,
832
+ keyCode: EnumItem
833
+ ): void;
834
+ }
835
+ interface ClientInputGroupInstance extends InputGroupDefault {
836
+ // docs: client_input_group:bind_user_setting(...) — colon, keep as method
837
+ bind_user_setting(callback: () => void, type: InputTypeValue, action: string): void;
838
+ }
839
+
840
+ /**
841
+ * Creates an input group with fixed KeyCode bindings.
842
+ * Prefer ClientInputGroup when bindings should respect the player's settings. [CLIENT]
843
+ */
844
+ declare const InputGroup: {
845
+ new(): InputGroupInstance;
846
+ };
847
+
848
+ /**
849
+ * Creates an input group whose action bindings respect the player's
850
+ * configured keybinds from config.keybinds. [CLIENT]
851
+ */
852
+ declare const ClientInputGroup: {
853
+ new(): ClientInputGroupInstance;
854
+ };
855
+
856
+ // ── Custom Camera Mode ────────────────────────────────────────────
857
+
858
+ /**
859
+ * Framework-injected state populated before each call to update().
860
+ * Read `input` to get movement intent; write to `camera_cframe` to
861
+ * communicate the desired camera position back to the framework.
862
+ */
863
+ type CameraControllerMovementInputType = {
864
+ movementX: number,
865
+ movementY: number,
866
+ movementZ: number
867
+ }
868
+ interface CameraControllerFrameState {
869
+ input: CameraControllerMovementInputType
870
+ camera_cframe: CFrame
871
+ cam_position?: CFrame
872
+ rot_x?: number
873
+ rot_y?: number
874
+ min_roll?: number
875
+ max_roll?: number
876
+ }
877
+
878
+ /**
879
+ * Implement this interface to create a fully custom camera controller.
880
+ * @example
881
+ * class MyFreecam implements CameraController {
882
+ * input!: CameraControllerFrameState["input"];
883
+ * camera_cframe!: CFrame;
884
+ * constructor(public getHeadCFrame: () => CFrame) {
885
+ * this.camera_cframe = new CFrame();
886
+ * }
887
+ * update(dt: number) {
888
+ * // move camera based on this.input, write result to this.camera_cframe
889
+ * }
890
+ * }
891
+ * register_camera_mode("MyFreecam", MyFreecam);
892
+ * players.get("me")?.set_custom_camera_mode("CustomFreecam");
893
+ */
894
+ interface CameraController extends CameraControllerFrameState {
895
+ update(deltaTime: number): void;
896
+ }
897
+
898
+ interface CameraControllerClass {
899
+ new(getHeadCFrame: () => CFrame): CameraController;
900
+ }
901
+
902
+ /**
903
+ * Registers a constructor class as a named camera mode.
904
+ * Activate it per-player with player.set_custom_camera_mode(name).
905
+ * Pass `"Default"` as the name to fully replace the built-in camera. [CLIENT]
906
+ */
907
+ declare function register_camera_mode(name: string, controller: CameraControllerClass): void;
908
+
909
+ // ── Iris Immediate-Mode UI ────────────────────────────────────────
910
+
911
+ /**
912
+ * Handle returned by any Iris widget-creating call.
913
+ * Poll the event methods inside your iris.Connect callback to react to input.
914
+ *
915
+ * All members use dot notation in the docs:
916
+ * `if (iris.Button({"Click me"}).clicked()) { ... }`
917
+ * so every callable is a property function.
918
+ */
919
+ interface IrisWidget {
920
+ // docs: widget.clicked(), widget.hovered(), etc. — dot notation
921
+ /** True on the frame the widget was clicked. */
922
+ clicked: () => boolean;
923
+ /** True while the pointer is over the widget. */
924
+ hovered: () => boolean;
925
+ /** True while the widget is being held / interacted with. */
926
+ active: () => boolean;
927
+ /** True for toggle-style widgets (Checkbox etc.) when currently checked. */
928
+ checked: () => boolean;
929
+ /** True on the frame the widget's value changed. */
930
+ changed: () => boolean;
931
+ [key: string]: unknown;
932
+ }
933
+
934
+ /**
935
+ * Iris immediate-mode UI library.
936
+ * Full docs: https://sirmallard.github.io/Iris/
937
+ *
938
+ * The callback registered with iris.Connect() runs every frame (colon — inherited
939
+ * from RBXScriptSignal). All widget-creating calls use dot notation in the docs
940
+ * (e.g. `iris.Window(...)`, `iris.Button(...)`), so those are property functions.
941
+ *
942
+ * Every opened container (Window, Tree, CollapsingHeader) requires a
943
+ * matching iris.End() call. [CLIENT]
944
+ *
945
+ * @example
946
+ * iris.Connect(() => {
947
+ * iris.Window(["My Mod"]);
948
+ * iris.Text(["Hello world"]);
949
+ * if (iris.Button(["Do thing"]).clicked()) { doThing(); }
950
+ * iris.End();
951
+ * });
952
+ */
953
+ type IrisID = string;
954
+ type IrisState<T> = {
955
+ ID: IrisID,
956
+ value: T,
957
+ get(): T,
958
+ set(newValue: T): T,
959
+ onChange(callback: (newValue: T) => () => void): void,
960
+ ConnectedWidgets: Record<IrisID, IrisWidget>,
961
+ ConnectedFunctions: ((newValue: T) => () => void)[]
962
+ }
963
+ type IrisWindowWidgetState = {
964
+ size?: IrisState<Vector2>,
965
+ position?: IrisState<Vector2>,
966
+ isUncollapsed?: IrisState<boolean>,
967
+ isOpened?: IrisState<boolean>,
968
+ scrollDistance?: IrisState<number>
969
+ }
970
+ interface IrisInstance {
971
+ // docs: iris.Window(), iris.Text(), iris.Button(), iris.End() etc. — dot notation
972
+
973
+ // ── Containers ───────────────────────────────────────────────
974
+ Window: (args: [title: string, ...rest: unknown[]], state: IrisWindowWidgetState) => IrisWidget;
975
+ Tree: (args?: [label: string, ...rest: unknown[]]) => IrisWidget;
976
+ CollapsingHeader: (args?: [label: string, ...rest: unknown[]]) => IrisWidget;
977
+ /** Closes the most recently opened container. */
978
+ End: () => void;
979
+
980
+ // ── Display ──────────────────────────────────────────────────
981
+ Text: (args: [text: string, ...rest: unknown[]]) => IrisWidget;
982
+ Separator: () => void;
983
+ SameLine: () => void;
984
+
985
+ // ── Inputs ───────────────────────────────────────────────────
986
+ Button: (args: [label: string, ...rest: unknown[]]) => IrisWidget;
987
+ Checkbox: (args?: unknown[]) => IrisWidget;
988
+ InputText: (args: [label: string, ...rest: unknown[]]) => IrisWidget;
989
+ InputNum: (args?: unknown[]) => IrisWidget;
990
+ InputVector2: (args?: unknown[]) => IrisWidget;
991
+ InputVector3: (args?: unknown[]) => IrisWidget;
992
+ InputColor3: (args?: unknown[]) => IrisWidget;
993
+ InputColor4: (args?: unknown[]) => IrisWidget;
994
+ SliderNum: (args?: unknown[]) => IrisWidget;
995
+ DragNum: (args?: unknown[]) => IrisWidget;
996
+ State: <T>(value: T) => IrisState<T>;
997
+ /** Call to disconnect it */
998
+ Connect(callback: () => void): () => void
999
+ /** Catch-all for any Iris widget not listed above. */
1000
+ [key: string]: unknown;
1001
+ }
1002
+
1003
+ declare const iris: IrisInstance;
1004
+
1005
+
1006
+
1007
+ // my stuff
1008
+ declare function is_studio(): boolean
1009
+ declare function is_private_server(): boolean
1010
+ declare function clear_console(): void
1011
+ // Note: info
1012
+ declare function fire_server(...args: RobloxSerializableInstance[]): void
1013
+ // Note: output_trace
1014
+ declare function create_instance<T extends keyof CreatableInstances>(className: T): WrappedInstance<CreatableInstances[T]>
1015
+ declare function info(...args: any[]): void
1016
+ declare function skip_tutorial(): void
package/package.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "@eves26phylum/types",
3
+ "version": "1.0.2",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
7
+ "description": "Deadline's Types",
8
+ "license": "Apache-2.0",
9
+ "author": "eves26phylum",
10
+ "type": "commonjs",
11
+ "scripts": {
12
+ "test": "echo \"Error: no test specified\" && exit 1"
13
+ },
14
+ "main": "global.d.ts",
15
+ "types": "global.d.ts"
16
+ }