UNPKG

77.1 kBTypeScriptView Raw
1/// <reference no-default-lib="true"/>
2/// <reference path="lua.d.ts" />
3/// <reference path="macro_math.d.ts" />
4/// <reference path="generated/enums.d.ts" />
5/// <reference path="generated/None.d.ts" />
6/// <reference types="@rbxts/compiler-types" />
7
8// ROBLOX API
9/**
10 * Intersecting a type with this allows access to Roblox's `Instance.Changed` event.
11 *
12 * @example
13 * function f(p: Part) {
14 * (p as Part & ChangedSignal).Changed.Connect(changedPropertyName => {})
15 * }
16 */
17type ChangedSignal = {
18 /**
19 * If you want to detect changes of a single property only, you should use [Instance.GetPropertyChangedSignal](https://developer.roblox.com/api-reference/function/Instance/GetPropertyChangedSignal) instead!
20 *
21 * The Changed event fires right after most properties change on objects. It is possible to find the present value of a changed property by using `object[property]`. To get the value of a property before it changes, you must have stored the value of the property before it changed.
22 *
23 * If you are only interested in listening to the change of a specific property, consider using the `GetPropertyChangedSignal` method instead to get an event that only fires when a given property changes.
24 *
25 * This event does not fire for physics-related changes, like when the `CFrame`, `Velocity`, `RotVelocity`, `Position`, `Orientation` and `CFrame` properties of a `BasePart` change due to gravity. To detect changes in these properties, consider using a physics-based event like `RunService.Stepped` or `BasePart.Touched`. A while-true-do loop can also work.
26 *
27 * For "-Value" objects, this event behaves differently: it only fires when the `Value` property changes. See individual pages for `IntValue`, `StringValue`, etc for more information. To detect other changes in these objects, you must use `GetPropertyChangedSignal` instead.
28 */
29 readonly Changed: RBXScriptSignal<(changedPropertyName: string) => void>;
30};
31
32type Tweenable = number | boolean | CFrame | Rect | Color3 | UDim | UDim2 | Vector2 | Vector2int16 | Vector3;
33
34interface EmoteDictionary {
35 /** When these arrays have more than one emote id in them, it will randomly select one of the emotes to play from the list. */
36 [emoteName: string]: Array<number>;
37}
38
39type EquippedEmotes = Array<{ Name: string; Slot: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 }>;
40
41interface UserInfo {
42 Id: number;
43 Username: string;
44 DisplayName: string;
45}
46
47interface GroupInfo {
48 Name: string;
49 Id: number;
50 Owner: {
51 Name: string;
52 Id: number;
53 };
54 EmblemUrl: string;
55 Description: string;
56 Roles: Array<{
57 Name: string;
58 Rank: number;
59 }>;
60}
61
62interface GetGroupsAsyncResult {
63 Name: string;
64 Id: number;
65 EmblemUrl: string;
66 Description: string;
67 Rank: number;
68 Role: string;
69 IsPrimary: boolean;
70 IsInClan: boolean;
71}
72
73type HttpHeaders = Record<string, string> | Map<string, string>;
74interface RequestAsyncRequest {
75 Url: string;
76 Method?: "GET" | "HEAD" | "POST" | "PUT" | "DELETE" | "PATCH";
77 Body?: string;
78 Headers?: HttpHeaders;
79}
80
81interface RequestAsyncResponse {
82 Success: boolean;
83 StatusCode: number;
84 StatusMessage: string;
85 Headers: Record<string, string>;
86 Body: string;
87}
88
89interface SetInfo {
90 AssetSetId: string;
91 CategoryId: string;
92 CreatorName: string;
93 Description: string;
94 ImageAssetId: string;
95 Name: string;
96 SetType: string;
97}
98
99interface CollectionInfo {
100 AssetId: string;
101 AssetSetId: string;
102 AssetVersionId: string;
103 IsTrusted: boolean;
104 Name: string;
105 CreatorName: string;
106}
107
108interface FreeSearchResult {
109 CurrentStartIndex: string;
110 Results: Array<{
111 AssetId: string;
112 AssetVersionId: string;
113 CreatorName: string;
114 Name: string;
115 }>;
116 TotalCount: string;
117}
118
119interface LocalizationEntry {
120 Key: string;
121 Source: string;
122 Context: string;
123 Example: string;
124 Values: Map<string, string>;
125}
126
127interface LogInfo {
128 message: string;
129 messageType: Enum.MessageType;
130 timestamp: number;
131}
132
133interface ReceiptInfo {
134 /** the id of the player making the purchase */
135 PlayerId: number;
136 /** the specific place where the purchase was made */
137 PlaceIdWherePurchased: number;
138 /** a unique identifier for the purchase, should be used to prevent granting an item multiple times for one purchase */
139 PurchaseId: string;
140 /** the id of the purchased product */
141 ProductId: number;
142 /** the type of currency used (Tix, Robux) */
143 CurrencyType: Enum.CurrencyType;
144 /** the amount of currency spent on the product for this purchase */
145 CurrencySpent: number;
146}
147
148interface ProductInfo {
149 /** The name shown on the asset's page */
150 Name: string;
151 /** The description as shown on the asset's page
152 * May be `undefined` if the description is empty.
153 */
154 Description: string | undefined;
155 /** The cost of purchasing the asset using Robux */
156 PriceInRobux: number;
157 /** Timestamp of when the asset was created, e.g. `2018-08-01T17:55:11.98Z` */
158 Created: string;
159 /** Timestamp of when the asset was last updated by its creator, e.g. `2018-08-01T17:55:11.98Z` */
160 Updated: string;
161 /** Indicates whether the item is marked as 13+ in catalog */
162 ContentRatingTypeId: number;
163 /** The minimum Builder's Club subscription necessary to purchase the item */
164 MinimumMembershipLevel: number;
165 /** Describes whether the asset can be taken for free */
166 IsPublicDomain: boolean;
167 /** Describes whether the asset is a User Product, Developer Product, or Game Pass */
168 ProductType: "User Product" | "Developer Product" | "Game Pass";
169 /** A table of information describing the creator of the asset */
170 Creator: {
171 /** Either `User` or `Group` */
172 CreatorType: "User" | "Group";
173 /** The ID of the creator user or group */
174 CreatorTargetId: number;
175 /** The name/username of the creator */
176 Name: string;
177 };
178 IconImageAssetId: number;
179 TargetId: number;
180}
181
182interface BadgeInfo {
183 /** The name of the badge. */
184 Name: string;
185 /** The description of the badge. */
186 Description: string;
187 /** The asset ID of the image for this badge. */
188 IconImageId: number;
189 /** Indicates whether this badge is available to be awarded. */
190 IsEnabled: boolean;
191}
192
193interface BundleInfo {
194 /** What kind of Bundle this is */
195 BundleType: "BodyParts" | "AvatarAnimations";
196
197 /** The Description of the Bundle */
198 Description: string;
199
200 /** The Bundle Id */
201 Id: number;
202
203 /** An array of all assets contained within this bundle */
204 Items: Array<{
205 /** The Id of the individual item */
206 Id: number;
207 /** The name of the individual asset */
208 Name: string;
209 /** What type the individual asset is */
210 Type: "Asset" | "UserOutfit";
211 }>;
212
213 /** The name of the Bundle */
214 Name: string;
215}
216
217type TeleportData = string | number | boolean | Array<unknown> | Map<unknown, unknown>;
218
219type PlayerJoinInfo = {
220 /** Data passed along with the players. As this is transmitted by the client it is not secure. For this reason it should only be used for local settings and not sensitive items (such as the users’ score or in-game currency). */
221 TeleportData?: TeleportData;
222} & (
223 | {
224 SourceGameId: undefined;
225 SourcePlaceId: undefined;
226 Members: undefined;
227 }
228 | {
229 /** The DataModel.GameId of the game the Player was teleported from. Only present if the player was teleported to the current place. */
230 SourceGameId: number;
231 /** The DataModel.PlaceId of the place the Player was teleported from. Only present if the player was teleported to the current place. */
232 SourcePlaceId: number;
233 /** An array containing the UserIds teleported alongside the Player. Only present if the player was teleported in using TeleportService:TeleportPartyAsync. */
234 Members: Array<number>;
235 }
236);
237
238interface BoundActionInfo {
239 inputTypes: Array<Enum.KeyCode | Enum.PlayerActions | Enum.UserInputType | string>;
240 priorityLevel: number;
241 stackOrder: number;
242}
243
244declare const enum AssetTypeId {
245 Image = 1,
246 TeeShirt = 2,
247 Audio = 3,
248 Mesh = 4,
249 Lua = 5,
250 Hat = 8,
251 Place = 9,
252 Model = 10,
253 Shirt = 11,
254 Pants = 12,
255 Decal = 13,
256 Head = 17,
257 Face = 18,
258 Gear = 19,
259 Badge = 21,
260 Animation = 24,
261 Torso = 27,
262 RightArm = 28,
263 LeftArm = 29,
264 LeftLeg = 30,
265 RightLeg = 31,
266 Package = 32,
267 GamePass = 34,
268 Plugin = 38,
269 MeshPart = 40,
270 HairAccessory = 41,
271 FaceAccessory = 42,
272 NeckAccessory = 43,
273 ShoulderAccessory = 44,
274 FrontAccessory = 45,
275 BackAccessory = 46,
276 WaistAccessory = 47,
277 ClimbAnimation = 48,
278 DeathAnimation = 49,
279 FallAnimation = 50,
280 IdleAnimation = 51,
281 JumpAnimation = 52,
282 RunAnimation = 53,
283 SwimAnimation = 54,
284 WalkAnimation = 55,
285 PoseAnimation = 56,
286 EarAccessory = 57,
287 EyeAccessory = 58,
288}
289
290interface AssetProductInfo extends ProductInfo {
291 /** If InfoType was Asset, this is the ID of the given asset. */
292 AssetId: number;
293 /** The [type of asset](https://developer.roblox.com/articles/Asset-types) (e.g. place, model, shirt). In TypeScript, you should compare this value to a member of the `AssetTypeId` const enum. */
294 AssetTypeId: AssetTypeId;
295 /** Describes whether the asset is purchasable */
296 IsForSale: boolean;
297 /** Describes whether the asset is a "limited item" that is no longer (if ever) sold */
298 IsLimited: boolean;
299 /** Describes whether the asset is a "limited unique" ("Limited U") item that only has a fixed number sold */
300 IsLimitedUnique: boolean;
301 /** Describes whether the asset is marked as "new" in the catalog */
302 IsNew: boolean;
303 /** The remaining number of items a limited unique item may be sold */
304 Remaining: number;
305 /** The number of items the asset has been sold */
306 Sales: number;
307}
308
309interface DeveloperProductInfo extends ProductInfo {
310 /** If the InfoType was Product, this is the product's ID */
311 ProductId: number;
312}
313
314interface AgentParameters {
315 /** Humanoid radius. Used to determine the minimum separation from obstacles. */
316 AgentRadius?: number;
317 /** Humanoid height.
318 * Empty space smaller than this value, like the space under stairs, will be marked as non-traversable.
319 */
320 AgentHeight?: number;
321 /** Sets whether off-mesh links for jumping are allowed. */
322 AgentCanJump?: boolean;
323 /** Determines the spacing between intermediate waypoints in path. */
324 WaypointSpacing?: number;
325 /** Table of materials or defined PathfindingModifiers and their "cost" for traversal. Useful for making the agent prefer certain materials/regions over others. */
326 Costs?: { [K in Enum.Material["Name"]]?: number } & { [index: string]: number };
327}
328
329interface CollisionGroupInfo {
330 id: number;
331 mask: number;
332 name: string;
333}
334
335declare const enum LocationType {
336 MobileWebsite = 0,
337 MobileInGame = 1,
338 Website = 2,
339 Studio = 3,
340 InGame = 4,
341 XBoxApp = 5,
342 TeamCreate = 6,
343}
344
345interface FriendOnlineInfoBase {
346 /** The UserId of the friend. */
347 VisitorId: number;
348 /** The user name of the friend. */
349 UserName: string;
350 /** When the user was last online. */
351 LastOnline: string;
352 /** If the friend is currently online. */
353 IsOnline: boolean;
354 /** The name of the friends current location. */
355 LastLocation: string;
356}
357
358interface FriendOnlineInfoWebsite extends FriendOnlineInfoBase {
359 /** A numeric enum of the friends last location.
360 * In TS, you can check this value against the `LocationType` const enum
361 */
362 LocationType: LocationType.MobileWebsite | LocationType.Website | LocationType.XBoxApp;
363}
364
365interface FriendOnlineInfoGame extends FriendOnlineInfoBase {
366 /** A numeric enum of the friends last location.
367 * In TS, you can check this value against the `LocationType` const enum
368 */
369 LocationType: LocationType.MobileInGame | LocationType.InGame | LocationType.TeamCreate;
370 /** The placeId of the friends last location. Check the `LocationType` to determine whether this property exists. */
371 PlaceId: number;
372 /** The DataModel / JobId of the friends last location.
373 * Check the `LocationType` to determine whether this property exists.
374 */
375 GameId: string;
376}
377
378interface FriendOnlineInfoStudio extends FriendOnlineInfoBase {
379 /** A numeric enum of the friends last location.
380 * In TS, you can check this value against the `LocationType` const enum
381 */
382 LocationType: LocationType.Studio;
383 /** The placeId of the friends last location. Check the `LocationType` to determine whether this property exists. */
384 PlaceId: number;
385}
386
387type FriendOnlineInfo = FriendOnlineInfoWebsite | FriendOnlineInfoGame | FriendOnlineInfoStudio;
388
389/** A dictionary of an id and name containing information about what type an asset is */
390type AssetType =
391 | { id: AssetTypeId.Image; name: "Image" }
392 | { id: AssetTypeId.TeeShirt; name: "TeeShirt" }
393 | { id: AssetTypeId.Audio; name: "Audio" }
394 | { id: AssetTypeId.Mesh; name: "Mesh" }
395 | { id: AssetTypeId.Lua; name: "Lua" }
396 | { id: AssetTypeId.Hat; name: "Hat" }
397 | { id: AssetTypeId.Place; name: "Place" }
398 | { id: AssetTypeId.Model; name: "Model" }
399 | { id: AssetTypeId.Shirt; name: "Shirt" }
400 | { id: AssetTypeId.Pants; name: "Pants" }
401 | { id: AssetTypeId.Decal; name: "Decal" }
402 | { id: AssetTypeId.Head; name: "Head" }
403 | { id: AssetTypeId.Face; name: "Face" }
404 | { id: AssetTypeId.Gear; name: "Gear" }
405 | { id: AssetTypeId.Badge; name: "Badge" }
406 | { id: AssetTypeId.Animation; name: "Animation" }
407 | { id: AssetTypeId.Torso; name: "Torso" }
408 | { id: AssetTypeId.RightArm; name: "RightArm" }
409 | { id: AssetTypeId.LeftArm; name: "LeftArm" }
410 | { id: AssetTypeId.LeftLeg; name: "LeftLeg" }
411 | { id: AssetTypeId.RightLeg; name: "RightLeg" }
412 | { id: AssetTypeId.Package; name: "Package" }
413 | { id: AssetTypeId.GamePass; name: "GamePass" }
414 | { id: AssetTypeId.Plugin; name: "Plugin" }
415 | { id: AssetTypeId.MeshPart; name: "MeshPart" }
416 | { id: AssetTypeId.HairAccessory; name: "HairAccessory" }
417 | { id: AssetTypeId.FaceAccessory; name: "FaceAccessory" }
418 | { id: AssetTypeId.NeckAccessory; name: "NeckAccessory" }
419 | { id: AssetTypeId.ShoulderAccessory; name: "ShoulderAccessory" }
420 | { id: AssetTypeId.FrontAccessory; name: "FrontAccessory" }
421 | { id: AssetTypeId.BackAccessory; name: "BackAccessory" }
422 | { id: AssetTypeId.WaistAccessory; name: "WaistAccessory" }
423 | { id: AssetTypeId.ClimbAnimation; name: "ClimbAnimation" }
424 | { id: AssetTypeId.DeathAnimation; name: "DeathAnimation" }
425 | { id: AssetTypeId.FallAnimation; name: "FallAnimation" }
426 | { id: AssetTypeId.IdleAnimation; name: "IdleAnimation" }
427 | { id: AssetTypeId.JumpAnimation; name: "JumpAnimation" }
428 | { id: AssetTypeId.RunAnimation; name: "RunAnimation" }
429 | { id: AssetTypeId.SwimAnimation; name: "SwimAnimation" }
430 | { id: AssetTypeId.WalkAnimation; name: "WalkAnimation" }
431 | { id: AssetTypeId.PoseAnimation; name: "PoseAnimation" }
432 | { id: AssetTypeId.EarAccessory; name: "EarAccessory" }
433 | { id: AssetTypeId.EyeAccessory; name: "EyeAccessory" };
434
435/** Information about a player's avatar in dictionary form */
436interface CharacterAppearanceInfo {
437 /** Describes the BrickColor values for each limb */
438 bodyColors: {
439 /** The BrickColor value of the leftArm */
440 leftArmColorId: keyof BrickColorsByNumber;
441 /** The BrickColor value of the torso */
442 torsoColorId: keyof BrickColorsByNumber;
443 /** The BrickColor value of the rightArm */
444 rightArmColorId: keyof BrickColorsByNumber;
445 /** The BrickColor value of the head */
446 headColorId: keyof BrickColorsByNumber;
447 /** The BrickColor value of the leftLeg */
448 leftLegColorId: keyof BrickColorsByNumber;
449 /** The BrickColor value of the rightLeg */
450 rightLegColorId: keyof BrickColorsByNumber;
451 };
452
453 /** The assets currently equipped by the Player (hats, body parts, etc, excluding gear) */
454 assets: Array<{
455 /** The asset ID of the equipped asset */
456 id: number;
457
458 /** A table with `name` and `id` fields, each describing the kind of asset equipped ("Hat", "Face", etc.). In TypeScript, the `id` can be compared to a member of the `AssetTypeId` const enum. */
459 assetType: AssetType;
460
461 /** The name of the equipped asset */
462 name: string;
463 }>;
464
465 /** Describes whether default pants are applied */
466 defaultPantsApplied: boolean;
467
468 /** Describes whether default shirt are applied */
469 defaultShirtApplied: boolean;
470
471 /** What kind of avatar it is */
472 playerAvatarType: "R6" | "R15";
473
474 /** A dictionary of scaling properties */
475 scales: {
476 bodyType: number;
477 head: number;
478 height: number;
479 proportion: number;
480 depth: number;
481 width: number;
482 };
483}
484
485interface MakeSystemMessageConfig {
486 Text: string;
487 Color?: Color3;
488 Font?: Enum.Font;
489 TextSize?: number;
490}
491
492interface SendNotificationConfig {
493 Title: string;
494 Text: string;
495 Icon?: string;
496 Duration?: number;
497 Callback?: BindableFunction;
498 Button1?: string;
499 Button2?: string;
500}
501
502interface PolicyInfo {
503 /** Whether the player can interact with paid random item generators. */
504 ArePaidRandomItemsRestricted: boolean;
505 /** See [here](https://devforum.roblox.com/t/about-our-upcoming-global-compliance-system/461447) for details. */
506 IsSubjectToChinaPolicies: boolean;
507 /** Which external link references are allowed in a country/region. */
508 AllowedExternalLinkReferences: Array<string>;
509}
510
511/**
512 * RBXScriptConnection, also known as a Connection,
513 * is a special object returned by the Connect method of an Event (RBXScriptSignal).
514 * This is used primarily to disconnect a listener from an Event.
515 */
516interface RBXScriptConnection {
517 /**
518 * Describes whether or not the connection is still alive.
519 * This will become false if connection:Disconnect() is called.
520 */
521 Connected: boolean;
522 /** Disconnects the connection from the event. */
523 Disconnect(this: RBXScriptConnection): void;
524}
525
526/**
527 * RBXScriptSignal, more commonly known as an Event, is a special kind of Roblox object.
528 * It provides a way for user-defined functions, called listeners, to be called when something happens in the game.
529 * When a certain event happens, the Event is fired, calling any listeners that are connected to the Event.
530 * An Event may also pass arguments to each listener, to provide extra information about the event that occurred.
531 */
532interface RBXScriptSignal<T extends Callback = Callback> {
533 /**
534 * Establishes a function to be called whenever the event is raised.
535 * Returns a RBXScriptConnection object associated with the connection.
536 * @param callback The function to be called whenever the event is fired.
537 */
538 Connect(this: RBXScriptSignal, callback: T): RBXScriptConnection;
539
540 ConnectParallel(this: RBXScriptSignal, callback: T): RBXScriptConnection;
541
542 /**
543 * Yields the current thread until this signal is fired. Returns what was fired to the signal.
544 */
545 Wait(this: RBXScriptSignal): LuaTuple<Parameters<T>>;
546}
547
548// generated in generated/None.d.ts
549interface Instances {}
550interface CreatableInstances {}
551
552// InstanceConstructor
553interface InstanceConstructor {
554 /**
555 * Creates an new object of type val. The parent argument is optional;
556 * If it is supplied, the object will be parented to that object.
557 * Performance note: When the Parent of an object is set,
558 * Roblox begins listening to a variety of different property changes for replication,
559 * rendering and physics.
560 * Therefore, it is recommended to set the Parent property last when creating new objects.
561 * As such, you should avoid using the second argument (parent) of this function.
562 * You can read [this thread on the developer forum](https://devforum.roblox.com/t/psa-dont-use-instance-new-with-parent-argument/30296) for more information.
563 */
564 new <T extends keyof CreatableInstances>(className: T, parent?: Instance): CreatableInstances[T];
565}
566
567declare const Instance: InstanceConstructor;
568
569/**
570 * Axes is a datatype used for the ArcHandles class to control what rotation axes are currently enabled.
571 */
572interface Axes {
573 /**
574 * **DO NOT USE!**
575 *
576 * This field exists to force TypeScript to recognize this as a nominal type
577 * @hidden
578 * @deprecated
579 */
580 readonly _nominal_Axes: unique symbol;
581 /** Whether the X axis is enabled */
582 readonly X: boolean;
583 /** Whether the Y axis is enabled */
584 readonly Y: boolean;
585 /** Whether the Z axis is enabled */
586 readonly Z: boolean;
587 /** Whether the top face is included */
588 readonly Top: boolean;
589 /** Whether the bottom face is included */
590 readonly Bottom: boolean;
591 /** Whether the left face is included */
592 readonly Left: boolean;
593 /** Whether the right face is included */
594 readonly Right: boolean;
595 /** Whether the back face is included */
596 readonly Back: boolean;
597 /** Whether the front face is included */
598 readonly Front: boolean;
599}
600
601type AxesConstructor = new (...axes: Array<Enum.Axis | Enum.NormalId>) => Axes;
602declare const Axes: AxesConstructor;
603
604interface BrickColor<Number extends number = any, Name extends string = any> {
605 /**
606 * **DO NOT USE!**
607 *
608 * This field exists to force TypeScript to recognize this as a nominal type
609 * @hidden
610 * @deprecated
611 */
612 readonly _nominal_BrickColor: unique symbol;
613 /** The unique number that identifies the BrickColor */
614 readonly Number: number extends Number ? keyof BrickColorsByNumber : Number;
615 /** The name associated with the BrickColor */
616 readonly Name: string extends Name ? BrickColorsByNumber[keyof BrickColorsByNumber] : Name;
617 /** The Color3 associated with the BrickColor */
618 readonly Color: Color3;
619 /** The red component (between 0 and 1) */
620 readonly r: number;
621 /** The green component (between 0 and 1) */
622 readonly g: number;
623 /** The blue component (between 0 and 1) */
624 readonly b: number;
625}
626
627interface BrickColorsByNumber {
628 1: "White";
629 2: "Grey";
630 3: "Light yellow";
631 5: "Brick yellow";
632 6: "Light green (Mint)";
633 9: "Light reddish violet";
634 11: "Pastel Blue";
635 12: "Light orange brown";
636 18: "Nougat";
637 21: "Bright red";
638 22: "Med. reddish violet";
639 23: "Bright blue";
640 24: "Bright yellow";
641 25: "Earth orange";
642 26: "Black";
643 27: "Dark grey";
644 28: "Dark green";
645 29: "Medium green";
646 36: "Lig. Yellowich orange";
647 37: "Bright green";
648 38: "Dark orange";
649 39: "Light bluish violet";
650 40: "Transparent";
651 41: "Tr. Red";
652 42: "Tr. Lg blue";
653 43: "Tr. Blue";
654 44: "Tr. Yellow";
655 45: "Light blue";
656 47: "Tr. Flu. Reddish orange";
657 48: "Tr. Green";
658 49: "Tr. Flu. Green";
659 50: "Phosph. White";
660 100: "Light red";
661 101: "Medium red";
662 102: "Medium blue";
663 103: "Light grey";
664 104: "Bright violet";
665 105: "Br. yellowish orange";
666 106: "Bright orange";
667 107: "Bright bluish green";
668 108: "Earth yellow";
669 110: "Bright bluish violet";
670 111: "Tr. Brown";
671 112: "Medium bluish violet";
672 113: "Tr. Medi. reddish violet";
673 115: "Med. yellowish green";
674 116: "Med. bluish green";
675 118: "Light bluish green";
676 119: "Br. yellowish green";
677 120: "Lig. yellowish green";
678 121: "Med. yellowish orange";
679 123: "Br. reddish orange";
680 124: "Bright reddish violet";
681 125: "Light orange";
682 126: "Tr. Bright bluish violet";
683 127: "Gold";
684 128: "Dark nougat";
685 131: "Silver";
686 133: "Neon orange";
687 134: "Neon green";
688 135: "Sand blue";
689 136: "Sand violet";
690 137: "Medium orange";
691 138: "Sand yellow";
692 140: "Earth blue";
693 141: "Earth green";
694 143: "Tr. Flu. Blue";
695 145: "Sand blue metallic";
696 146: "Sand violet metallic";
697 147: "Sand yellow metallic";
698 148: "Dark grey metallic";
699 149: "Black metallic";
700 150: "Light grey metallic";
701 151: "Sand green";
702 153: "Sand red";
703 154: "Dark red";
704 157: "Tr. Flu. Yellow";
705 158: "Tr. Flu. Red";
706 168: "Gun metallic";
707 176: "Red flip/flop";
708 178: "Yellow flip/flop";
709 179: "Silver flip/flop";
710 180: "Curry";
711 190: "Fire Yellow";
712 191: "Flame yellowish orange";
713 192: "Reddish brown";
714 193: "Flame reddish orange";
715 194: "Medium stone grey";
716 195: "Royal blue";
717 196: "Dark Royal blue";
718 198: "Bright reddish lilac";
719 199: "Dark stone grey";
720 200: "Lemon metalic";
721 208: "Light stone grey";
722 209: "Dark Curry";
723 210: "Faded green";
724 211: "Turquoise";
725 212: "Light Royal blue";
726 213: "Medium Royal blue";
727 216: "Rust";
728 217: "Brown";
729 218: "Reddish lilac";
730 219: "Lilac";
731 220: "Light lilac";
732 221: "Bright purple";
733 222: "Light purple";
734 223: "Light pink";
735 224: "Light brick yellow";
736 225: "Warm yellowish orange";
737 226: "Cool yellow";
738 232: "Dove blue";
739 268: "Medium lilac";
740 301: "Slime green";
741 302: "Smoky grey";
742 303: "Dark blue";
743 304: "Parsley green";
744 305: "Steel blue";
745 306: "Storm blue";
746 307: "Lapis";
747 308: "Dark indigo";
748 309: "Sea green";
749 310: "Shamrock";
750 311: "Fossil";
751 312: "Mulberry";
752 313: "Forest green";
753 314: "Cadet blue";
754 315: "Electric blue";
755 316: "Eggplant";
756 317: "Moss";
757 318: "Artichoke";
758 319: "Sage green";
759 320: "Ghost grey";
760 321: "Lilac";
761 322: "Plum";
762 323: "Olivine";
763 324: "Laurel green";
764 325: "Quill grey";
765 327: "Crimson";
766 328: "Mint";
767 329: "Baby blue";
768 330: "Carnation pink";
769 331: "Persimmon";
770 332: "Maroon";
771 333: "Gold";
772 334: "Daisy orange";
773 335: "Pearl";
774 336: "Fog";
775 337: "Salmon";
776 338: "Terra Cotta";
777 339: "Cocoa";
778 340: "Wheat";
779 341: "Buttermilk";
780 342: "Mauve";
781 343: "Sunrise";
782 344: "Tawny";
783 345: "Rust";
784 346: "Cashmere";
785 347: "Khaki";
786 348: "Lily white";
787 349: "Seashell";
788 350: "Burgundy";
789 351: "Cork";
790 352: "Burlap";
791 353: "Beige";
792 354: "Oyster";
793 355: "Pine Cone";
794 356: "Fawn brown";
795 357: "Hurricane grey";
796 358: "Cloudy grey";
797 359: "Linen";
798 360: "Copper";
799 361: "Dirt brown";
800 362: "Bronze";
801 363: "Flint";
802 364: "Dark taupe";
803 365: "Burnt Sienna";
804 1001: "Institutional white";
805 1002: "Mid gray";
806 1003: "Really black";
807 1004: "Really red";
808 1005: "Deep orange";
809 1006: "Alder";
810 1007: "Dusty Rose";
811 1008: "Olive";
812 1009: "New Yeller";
813 1010: "Really blue";
814 1011: "Navy blue";
815 1012: "Deep blue";
816 1013: "Cyan";
817 1014: "CGA brown";
818 1015: "Magenta";
819 1016: "Pink";
820 1017: "Deep orange";
821 1018: "Teal";
822 1019: "Toothpaste";
823 1020: "Lime green";
824 1021: "Camo";
825 1022: "Grime";
826 1023: "Lavender";
827 1024: "Pastel light blue";
828 1025: "Pastel orange";
829 1026: "Pastel violet";
830 1027: "Pastel blue-green";
831 1028: "Pastel green";
832 1029: "Pastel yellow";
833 1030: "Pastel brown";
834 1031: "Royal purple";
835 1032: "Hot pink";
836}
837
838interface BrickColorsByPalette {
839 0: 141;
840 1: 301;
841 2: 107;
842 3: 26;
843 4: 1012;
844 5: 303;
845 6: 1011;
846 7: 304;
847 8: 28;
848 9: 1018;
849 10: 302;
850 11: 305;
851 12: 306;
852 13: 307;
853 14: 308;
854 15: 1021;
855 16: 309;
856 17: 310;
857 18: 1019;
858 19: 135;
859 20: 102;
860 21: 23;
861 22: 1010;
862 23: 312;
863 24: 313;
864 25: 37;
865 26: 1022;
866 27: 1020;
867 28: 1027;
868 29: 311;
869 30: 315;
870 31: 1023;
871 32: 1031;
872 33: 316;
873 34: 151;
874 35: 317;
875 36: 318;
876 37: 319;
877 38: 1024;
878 39: 314;
879 40: 1013;
880 41: 1006;
881 42: 321;
882 43: 322;
883 44: 104;
884 45: 1008;
885 46: 119;
886 47: 323;
887 48: 324;
888 49: 325;
889 50: 320;
890 51: 11;
891 52: 1026;
892 53: 1016;
893 54: 1032;
894 55: 1015;
895 56: 327;
896 57: 1005;
897 58: 1009;
898 59: 29;
899 60: 328;
900 61: 1028;
901 62: 208;
902 63: 45;
903 64: 329;
904 65: 330;
905 66: 331;
906 67: 1004;
907 68: 21;
908 69: 332;
909 70: 333;
910 71: 24;
911 72: 334;
912 73: 226;
913 74: 1029;
914 75: 335;
915 76: 336;
916 77: 342;
917 78: 343;
918 79: 338;
919 80: 1007;
920 81: 339;
921 82: 133;
922 83: 106;
923 84: 340;
924 85: 341;
925 86: 1001;
926 87: 1;
927 88: 9;
928 89: 1025;
929 90: 337;
930 91: 344;
931 92: 345;
932 93: 1014;
933 94: 105;
934 95: 346;
935 96: 347;
936 97: 348;
937 98: 349;
938 99: 1030;
939 100: 125;
940 101: 101;
941 102: 350;
942 103: 192;
943 104: 351;
944 105: 352;
945 106: 353;
946 107: 354;
947 108: 1002;
948 109: 5;
949 110: 18;
950 111: 217;
951 112: 355;
952 113: 356;
953 114: 153;
954 115: 357;
955 116: 358;
956 117: 359;
957 118: 360;
958 119: 38;
959 120: 361;
960 121: 362;
961 122: 199;
962 123: 194;
963 124: 363;
964 125: 364;
965 126: 365;
966 127: 1003;
967}
968
969interface BrickColorConstructor {
970 /** Returns a random BrickColor. */
971 random: () => BrickColor;
972
973 /** Returns a White BrickColor */
974 White: () => BrickColor<1, "White">;
975 /** Returns a Gray BrickColor */
976 Gray: () => BrickColor<194, "Medium stone grey">;
977 /** Returns a DarkGray BrickColor */
978 DarkGray: () => BrickColor<199, "Dark stone grey">;
979 /** Returns a Black BrickColor */
980 Black: () => BrickColor<26, "Black">;
981 /** Returns a Red BrickColor */
982 Red: () => BrickColor<21, "Bright red">;
983 /** Returns a Yellow BrickColor */
984 Yellow: () => BrickColor<24, "Bright yellow">;
985 /** Returns a Green BrickColor */
986 Green: () => BrickColor<28, "Dark green">;
987 /** Returns a Blue BrickColor */
988 Blue: () => BrickColor<23, "Bright blue">;
989
990 /** Constructs a BrickColor from its name. */
991 new <T extends BrickColorsByNumber[keyof BrickColorsByNumber]>(val: T): BrickColor<
992 { [K in keyof BrickColorsByNumber]: T extends BrickColorsByNumber[K] ? K : never }[keyof BrickColorsByNumber],
993 T
994 >;
995
996 /** Constructs a BrickColor from its numerical index. */
997 new <T extends keyof BrickColorsByNumber>(val: T): BrickColor<T, BrickColorsByNumber[T]>;
998
999 /** Constructs a BrickColor from its numerical index. */
1000 new (val: number): BrickColor;
1001
1002 /** Constructs the closest BrickColor that can be matched to the specified RGB components. */
1003 new (r: number, g: number, b: number): BrickColor;
1004
1005 /** Constructs the closest BrickColor that can be matched to the specified Color3. */
1006 new (color: Color3): BrickColor;
1007
1008 /** Constructs a BrickColor from its palette index. */
1009 palette: {
1010 <T extends keyof BrickColorsByPalette>(paletteValue: T): BrickColor<
1011 BrickColorsByPalette[T],
1012 BrickColorsByNumber[BrickColorsByPalette[T]]
1013 >;
1014 (paletteValue: number): BrickColor;
1015 };
1016}
1017
1018declare const BrickColor: BrickColorConstructor;
1019
1020// CatalogSearchParams
1021interface CatalogSearchParams {
1022 /**
1023 * **DO NOT USE!**
1024 *
1025 * This field exists to force TypeScript to recognize this as a nominal type
1026 * @hidden
1027 * @deprecated
1028 */
1029 readonly _nominal_CatalogSearchParams: unique symbol;
1030 SearchKeyword: string;
1031 CategoryFilter: Enum.CatalogCategoryFilter;
1032 SortType: Enum.CatalogSortType;
1033 BundleTypes: string;
1034 AssetTypes: string;
1035}
1036
1037interface CatalogSearchParamsConstructor {
1038 new (): CatalogSearchParams;
1039}
1040
1041declare const CatalogSearchParams: CatalogSearchParamsConstructor;
1042
1043// CFrame
1044interface CFrame {
1045 /**
1046 * **DO NOT USE!**
1047 *
1048 * This field exists to force TypeScript to recognize this as a nominal type
1049 * @hidden
1050 * @deprecated
1051 */
1052 readonly _nominal_CFrame: unique symbol;
1053 /** The 3D position of the CFrame */
1054 readonly Position: Vector3;
1055 /** A copy of the CFrame with no translation. */
1056 readonly Rotation: CFrame;
1057 /** The x-coordinate of the position */
1058 readonly X: number;
1059 /** The y-coordinate of the position */
1060 readonly Y: number;
1061 /** The z-coordinate of the position */
1062 readonly Z: number;
1063 /** The forward-direction component of the CFrame’s orientation. */
1064 readonly LookVector: Vector3;
1065 /** The right-direction component of the CFrame’s orientation. */
1066 readonly RightVector: Vector3;
1067 /** The up-direction component of the CFrame’s orientation. */
1068 readonly UpVector: Vector3;
1069 /** Equivalent to the first/top row of the rotation matrix, or `Vector3.new(r00, r10, r20)` */
1070 readonly XVector: Vector3;
1071 /** Equivalent to the second/middle row of the rotation matrix, or `Vector3.new(r01, r11, r21)` */
1072 readonly YVector: Vector3;
1073 /** Equivalent to the third/bottom row of the rotation matrix, or `Vector3.new(r02, r12, r22)` */
1074 readonly ZVector: Vector3;
1075 /** Returns the inverse of this CFrame */
1076 Inverse(this: CFrame): CFrame;
1077 /** Returns a CFrame interpolated between this CFrame and the goal by the fraction alpha */
1078 Lerp(this: CFrame, goal: CFrame, alpha: number): CFrame;
1079 /** Returns a CFrame transformed from Object to World space. Equivalent to `[CFrame * cf]` */
1080 ToWorldSpace(this: CFrame, cf: CFrame): CFrame;
1081 /** Returns a CFrame transformed from World to Object space. Equivalent to `[CFrame:inverse() * cf]` */
1082 ToObjectSpace(this: CFrame, cf: CFrame): CFrame;
1083 /** Returns a Vector3 transformed from Object to World space. Equivalent to `[CFrame * v3]` */
1084 PointToWorldSpace(this: CFrame, v3: Vector3): Vector3;
1085 /** Returns a Vector3 transformed from World to Object space. Equivalent to `[CFrame:inverse() * v3]` */
1086 PointToObjectSpace(this: CFrame, v3: Vector3): Vector3;
1087 /** Returns a Vector3 rotated from Object to World space. Equivalent to `[(CFrame - CFrame.p) *v3]` */
1088 VectorToWorldSpace(this: CFrame, v3: Vector3): Vector3;
1089 /** Returns a Vector3 rotated from World to Object space. Equivalent to `[(CFrame:inverse() - CFrame:inverse().p) * v3]` */
1090 VectorToObjectSpace(this: CFrame, v3: Vector3): Vector3;
1091 /** Returns the values: x, y, z, R00, R01, R02, R10, R11, R12, R20, R21, R22, where R00-R22 represent the 3x3 rotation matrix of the CFrame, and xyz represent the position of the CFrame. */
1092 GetComponents(
1093 this: CFrame,
1094 ): LuaTuple<[number, number, number, number, number, number, number, number, number, number, number, number]>;
1095 /** Returns approximate angles that could be used to generate CFrame, if angles were applied in Z, Y, X order */
1096 ToEulerAnglesXYZ(this: CFrame): LuaTuple<[number, number, number]>;
1097 /** Returns approximate angles that could be used to generate CFrame, if angles were applied in Z, X, Y order */
1098 ToEulerAnglesYXZ(this: CFrame): LuaTuple<[number, number, number]>;
1099 /** Returns approximate angles that could be used to generate CFrame, if angles were applied in Z, X, Y order (Equivalent to toEulerAnglesYXZ) */
1100 ToOrientation(this: CFrame): LuaTuple<[number, number, number]>;
1101 /** Returns a tuple of a Vector3 and a number which represent the rotation of the CFrame in the axis-angle representation */
1102 ToAxisAngle(this: CFrame): LuaTuple<[Vector3, number]>;
1103}
1104
1105interface CFrameConstructor {
1106 /**
1107 * An identity CFrame, one with no translation or rotation.
1108 *
1109 * This API member is a **constant**, and must be accessed through the `CFrame` global as opposed to an individual
1110 * `CFrame` object.
1111 *
1112 * ```lua
1113 * print(CFrame.identity) --> 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1
1114 * ```
1115 */
1116 readonly identity: CFrame;
1117 /** Equivalent to fromEulerAnglesXYZ */
1118 Angles: (rX: number, rY: number, rZ: number) => CFrame;
1119 /** Creates a rotated CFrame from a Unit Vector3 and a rotation in radians */
1120 fromAxisAngle: (unit: Vector3, rotation: number) => CFrame;
1121 /** Creates a rotated CFrame using angles (rx, ry, rz) in radians. Rotations are applied in Z, Y, X order. */
1122 fromEulerAnglesXYZ: (rX: number, rY: number, rZ: number) => CFrame;
1123 /** Creates a rotated CFrame using angles (rx, ry, rz) in radians. Rotations are applied in Z, X, Y order. */
1124 fromEulerAnglesYXZ: (rX: number, rY: number, rZ: number) => CFrame;
1125 /** Creates a CFrame from a translation and the columns of a rotation matrix. If vz is excluded,
1126 * the third column is calculated as `[vx:Cross(vy).Unit]`.
1127 */
1128 fromMatrix: (pos: Vector3, vX: Vector3, vY: Vector3, vZ?: Vector3) => CFrame;
1129 /** Equivalent to fromEulerAnglesYXZ */
1130 fromOrientation: (rX: number, rY: number, rZ: number) => CFrame;
1131 /**
1132 * Creates a new CFrame located at `at` and facing towards `lookAt`, optionally specifying the upward direction (by default, (0, 1, 0)).
1133 *
1134 * This function replaces the `CFrame.new(Vector3, Vector3)` constructor which accomplished a similar task. This function allows you to specify the `up` Vector, using the same default as the old constructor.
1135 */
1136 lookAt: (at: Vector3, lookAt: Vector3, up?: Vector3) => CFrame;
1137 /** Creates a CFrame from a Vector3 */
1138 new (pos: Vector3): CFrame;
1139 /** Creates a CFrame from position (x, y, z). */
1140 new (x: number, y: number, z: number): CFrame;
1141 /** Creates a blank identity CFrame. */
1142 new (): CFrame;
1143 /** Creates a CFrame from position (x, y, z) and quaternion (qX, qY, qZ, qW) */
1144 new (x: number, y: number, z: number, qX: number, qY: number, qZ: number, qW: number): CFrame;
1145 /** Creates a CFrame from position (x, y, z) with an orientation specified by the rotation matrix `[[R00 R01 R02] [R10 R11 R12] [R20 R21 R22]]` */
1146 new (
1147 x: number,
1148 y: number,
1149 z: number,
1150 R00: number,
1151 R01: number,
1152 R02: number,
1153 R10: number,
1154 R11: number,
1155 R12: number,
1156 R20: number,
1157 R21: number,
1158 R22: number,
1159 ): CFrame;
1160 /** Creates a CFrame located at pos with it’s lookVector pointing towards the lookAt position. */
1161 new (pos: Vector3, lookAt: Vector3): CFrame;
1162}
1163
1164declare const CFrame: CFrameConstructor;
1165
1166interface Color3 {
1167 /**
1168 * **DO NOT USE!**
1169 *
1170 * This field exists to force TypeScript to recognize this as a nominal type
1171 * @hidden
1172 * @deprecated
1173 */
1174 readonly _nominal_Color3: unique symbol;
1175 /** The red value of the color (between 0 and 1) */
1176 readonly R: number;
1177 /** The green value of the color (between 0 and 1) */
1178 readonly G: number;
1179 /** The blue value of the color (between 0 and 1) */
1180 readonly B: number;
1181 /** Returns a Color3 interpolated between two Color3 objects. Alpha is a number from 0 to 1. */
1182 Lerp(this: Color3, goal: Color3, alpha: number): Color3;
1183 /** Returns the [hue, saturation, and value](https://en.wikipedia.org/wiki/HSL_and_HSV) of a Color3. This function is the inverse operation of the `Color3.fromHSV` constructor. */
1184 ToHSV(): LuaTuple<[number, number, number]>;
1185 /**
1186 * Converts the color to a six-character hexadecimal string representing the color in the format RRGGBB. It is not
1187 * prefixed with an octothorpe (#), although this can be concatenated easily.
1188 *
1189 * The returned string can be provided to `Color3.fromHex` to produce the original color.
1190 * ```lua
1191 * print(Color3.new(0, 1, 0):ToHex()) --> "00FF00"
1192 * print(BrickColor.new("Really red").Color:ToHex()) --> "FF0000"
1193 * ```
1194 */
1195 ToHex(): string;
1196}
1197
1198interface Color3Constructor {
1199 /** Creates a Color3 with the given red, green, and blue. The numbers can range from 0 to 255. */
1200 fromRGB: (r?: number, g?: number, b?: number) => Color3;
1201 /** Creates a Color3 with the given hue, saturation, and value. The numbers can range from 0 to 1. */
1202 fromHSV: (hue: number, sat: number, val: number) => Color3;
1203 /** Returns the hue, saturation, and value of a Color3. */
1204 toHSV: (color: Color3) => LuaTuple<[number, number, number]>;
1205 /**
1206 * Returns a new Color3 from a six- or three-character [hexadecimal](https://en.wikipedia.org/wiki/Hexadecimal)
1207 * format. A preceding octothorpe (#) is ignored, if present. This function interprets the given string as a typical
1208 * web hex color in the format RRGGBB or RGB (shorthand for RRGGBB). For example, #FFAA00 produces an orange color,
1209 * and is the same as #FA0.
1210 *
1211 * The color returned can be converted back into hex using `Color3:toHex`, although it is not guaranteed to return
1212 * the exact same string as passed to this function.
1213 * ```lua
1214 * print(Color3.fromHex("#FF0000")) --> 1, 0, 0
1215 * ```
1216 */
1217 fromHex: (hex: string) => Color3;
1218 /** Returns a Color3 with the given red, green, and blue values. The numbers can range from 0 to 1, defaulting to 0 */
1219 new (red?: number, green?: number, blue?: number): Color3;
1220}
1221
1222declare const Color3: Color3Constructor;
1223
1224// ColorSequence
1225interface ColorSequence {
1226 /**
1227 * **DO NOT USE!**
1228 *
1229 * This field exists to force TypeScript to recognize this as a nominal type
1230 * @hidden
1231 * @deprecated
1232 */
1233 readonly _nominal_ColorSequence: unique symbol;
1234 readonly Keypoints: ReadonlyArray<ColorSequenceKeypoint>;
1235}
1236interface ColorSequenceConstructor {
1237 new (color: Color3): ColorSequence;
1238 new (c0: Color3, c1: Color3): ColorSequence;
1239 new (colors: ReadonlyArray<ColorSequenceKeypoint>): ColorSequence;
1240}
1241declare const ColorSequence: ColorSequenceConstructor;
1242
1243// ColorSequenceKeypoint
1244interface ColorSequenceKeypoint {
1245 /**
1246 * **DO NOT USE!**
1247 *
1248 * This field exists to force TypeScript to recognize this as a nominal type
1249 * @hidden
1250 * @deprecated
1251 */
1252 readonly _nominal_ColorSequenceKeypoint: unique symbol;
1253 readonly Time: number;
1254 readonly Value: Color3;
1255}
1256type ColorSequenceKeypointConstructor = new (time: number, color: Color3) => ColorSequenceKeypoint;
1257declare const ColorSequenceKeypoint: ColorSequenceKeypointConstructor;
1258
1259/**
1260 * Describes a time value, returned from many of DateTime's methods and used for some of DateTime's constructors
1261 */
1262interface TimeValueTable {
1263 /** Range: 1400-9999 */
1264 Year: number;
1265
1266 /** Range: 1-12 */
1267 Month: number;
1268
1269 /** Range: 1-31 */
1270 Day: number;
1271
1272 /** Range: 0-23 */
1273 Hour: number;
1274
1275 /** Range: 0-59 */
1276 Minute: number;
1277
1278 /**
1279 * Range: 0-60
1280 * Usually 0–59, sometimes 60 to accommodate leap seconds in certain systems.
1281 */
1282 Second: number;
1283
1284 /** Range: 0-999 */
1285 Millisecond: number;
1286}
1287
1288/**
1289 * A DateTime represents a moment in time using a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time).
1290 * It can be used to easily format dates and times in specific locales.
1291 * When converted to a string, a string conversion of the stored timestamp integer is returned.
1292 * They do not store timezone values; rather, timezones are considered when constructing and using DateTime objects.
1293 * DateTime objects are equal if and only if their `UnixTimestampMillis` properties are equal.
1294 */
1295interface DateTime {
1296 /**
1297 * **DO NOT USE!**
1298 *
1299 * This field exists to force TypeScript to recognize this as a nominal type
1300 * @hidden
1301 * @deprecated
1302 */
1303 readonly _nominal_DateTime: unique symbol;
1304
1305 /**
1306 * The number of seconds since January 1st, 1970 at 00:00 UTC (the Unix epoch).
1307 * For more information, see [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time).
1308 * Range is -17,987,443,200–253,402,300,799, approximately years 1400–9999.
1309 */
1310 readonly UnixTimestamp: number;
1311
1312 /**
1313 * The number of milliseconds since January 1st, 1970 at 00:00 UTC (the Unix epoch).
1314 * For more information, see [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time).
1315 * Range is -17,987,443,200,000 to 253,402,300,799,999, approximately years 1400–9999.
1316 */
1317 readonly UnixTimestampMillis: number;
1318
1319 /** Converts the value of this DateTime object to Universal Coordinated Time (UTC) */
1320 ToUniversalTime(): TimeValueTable;
1321
1322 /** Converts the value of this DateTime object to local time */
1323 ToLocalTime(): TimeValueTable;
1324
1325 /**
1326 * Formats a date as a [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time string.
1327 * An example ISO 8601 date-time string would be `2020-01-02T10:30:45Z`, which represents January 2nd 2020 at 10:30 AM, 45 seconds.
1328 */
1329 ToIsoDate(): string;
1330
1331 /**
1332 * Generates a string from the DateTime value interpreted as Universal Coordinated Time (UTC) and a format string.
1333 * The format string should contain tokens, which will replace to certain date/time values described by the DateTime object.
1334 * For details on all the available tokens, see [DateTime Format Strings](https://developer.roblox.com/articles/datetime-format-strings).
1335 * @param format
1336 * @param locale
1337 */
1338 FormatUniversalTime(format: string, locale: string): string;
1339
1340 /**
1341 * Generates a string from the DateTime value interpreted as local time and a format string.
1342 * The format string should contain tokens, which will replace to certain date/time values described by the DateTime object.
1343 * For details on all the available tokens, see [DateTime Format Strings](https://developer.roblox.com/articles/datetime-format-strings).
1344 * @param format
1345 * @param locale
1346 */
1347 FormatLocalTime(format: string, locale: string): string;
1348}
1349
1350interface DateTimeConstructor {
1351 /** Creates a new DateTime representing the current moment in time */
1352 now: () => DateTime;
1353
1354 /**
1355 * Creates a new DateTime object from the given [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time), or the number of seconds since January 1st, 1970 at 00:00 (UTC).
1356 * @param unixTimestamp
1357 */
1358 fromUnixTimestamp: (unixTimestamp: number) => DateTime;
1359
1360 /**
1361 * Creates a new DateTime object from the given [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time), or the number of milliseconds since January 1st, 1970 at 00:00 (UTC).
1362 * @param unixTimestampMillis
1363 */
1364 fromUnixTimestampMillis: (unixTimestampMillis: number) => DateTime;
1365
1366 /**
1367 * Creates a new DateTime using the given units from a UTC time
1368 * - Date units (year, month, day) that produce an invalid date will raise an error. For example, January 32nd or February 29th on a non-leap year.
1369 * - Time units (hour, minute, second, millisecond) that are outside their normal range are valid. For example, 90 minutes will cause the hour to roll over by 1; -10 seconds will cause the minute value to roll back by 1.
1370 * - Non-integer values are rounded down. For example, providing 2.5 hours will be equivalent to providing 2 hours, not 2 hours 30 minutes.
1371 * - Omitted values are assumed to be their lowest value in their normal range, except for year which defaults to 1970.
1372 * @param year Defaults to 1970
1373 * @param month Defaults to 1
1374 * @param day Defaults to 1
1375 * @param hour Defaults to 0
1376 * @param minute Defaults to 0
1377 * @param second Defaults to 0
1378 * @param millisecond Defaults to 0
1379 */
1380 fromUniversalTime: (
1381 year?: number,
1382 month?: number,
1383 day?: number,
1384 hour?: number,
1385 minute?: number,
1386 second?: number,
1387 millisecond?: number,
1388 ) => DateTime;
1389
1390 /**
1391 * Creates a new DateTime using the given units from a local time
1392 * - Date units (year, month, day) that produce an invalid date will raise an error. For example, January 32nd or February 29th on a non-leap year.
1393 * - Time units (hour, minute, second, millisecond) that are outside their normal range are valid. For example, 90 minutes will cause the hour to roll over by 1; -10 seconds will cause the minute value to roll back by 1.
1394 * - Non-integer values are rounded down. For example, providing 2.5 hours will be equivalent to providing 2 hours, not 2 hours 30 minutes.
1395 * - Omitted values are assumed to be their lowest value in their normal range, except for year which defaults to 1970.
1396 * @param year Defaults to 1970
1397 * @param month Defaults to 1
1398 * @param day Defaults to 1
1399 * @param hour Defaults to 0
1400 * @param minute Defaults to 0
1401 * @param second Defaults to 0
1402 * @param millisecond Defaults to 0
1403 */
1404 fromLocalTime: (
1405 year?: number,
1406 month?: number,
1407 day?: number,
1408 hour?: number,
1409 minute?: number,
1410 second?: number,
1411 millisecond?: number,
1412 ) => DateTime;
1413
1414 /**
1415 * Creates a DateTime from an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time string in UTC time.
1416 * If the string parsing fails, returns nil.
1417 * An example ISO 8601 date-time string would be `2020-01-02T10:30:45Z`, which represents January nd 2020 at 10:30 AM, 45 seconds.
1418 * @param isoDate
1419 */
1420 fromIsoDate: (isoDate: string) => DateTime | undefined;
1421}
1422
1423declare const DateTime: DateTimeConstructor;
1424
1425// DockWidgetPluginGuiInfo
1426interface DockWidgetPluginGuiInfo {
1427 /**
1428 * **DO NOT USE!**
1429 *
1430 * This field exists to force TypeScript to recognize this as a nominal type
1431 * @hidden
1432 * @deprecated
1433 */
1434 readonly _nominal_DockWidgetPluginGuiInfo: unique symbol;
1435 readonly InitialDockState: Enum.InitialDockState;
1436 readonly InitialEnabled: boolean;
1437 readonly InitialEnabledShouldOverrideRestore: boolean;
1438 readonly FloatingXSize: number;
1439 readonly FloatingYSize: number;
1440 readonly MinWidth: number;
1441 readonly MinHeight: number;
1442}
1443type DockWidgetPluginGuiInfoConstructor = new (
1444 initDockState?: Enum.InitialDockState,
1445 initEnabled?: boolean,
1446 overrideEnabledRestore?: boolean,
1447 floatXSize?: number,
1448 floatYSize?: number,
1449 minWidth?: number,
1450 minHeight?: number,
1451) => DockWidgetPluginGuiInfo;
1452declare const DockWidgetPluginGuiInfo: DockWidgetPluginGuiInfoConstructor;
1453
1454// Faces
1455interface Faces {
1456 /**
1457 * **DO NOT USE!**
1458 *
1459 * This field exists to force TypeScript to recognize this as a nominal type
1460 * @hidden
1461 * @deprecated
1462 */
1463 readonly _nominal_Faces: unique symbol;
1464 readonly Top: boolean;
1465 readonly Bottom: boolean;
1466 readonly Back: boolean;
1467 readonly Front: boolean;
1468 readonly Right: boolean;
1469 readonly Left: boolean;
1470}
1471type FacesConstructor = new (...ids: Array<Enum.NormalId>) => Faces;
1472declare const Faces: FacesConstructor;
1473
1474// FloatCurveKey
1475interface FloatCurveKey {
1476 /**
1477 * **DO NOT USE!**
1478 *
1479 * This field exists to force TypeScript to recognize this as a nominal type
1480 * @hidden
1481 * @deprecated
1482 */
1483 readonly _nominal_FloatCurveKey: unique symbol;
1484 readonly Time: number;
1485 readonly Value: number;
1486 readonly RightTangent: number;
1487 readonly LeftTangent: number;
1488}
1489type FloatCurveKeyConstructor = new (
1490 time: number,
1491 value: number,
1492 interpolation: CastsToEnum<Enum.KeyInterpolationMode>,
1493) => FloatCurveKey;
1494declare const FloatCurveKey: FloatCurveKeyConstructor;
1495
1496// Font
1497interface Font {
1498 Bold: boolean;
1499 Style: Enum.FontStyle;
1500 Family: string;
1501 Weight: Enum.FontWeight;
1502}
1503interface FontConstructor {
1504 new (family: string, weight?: Enum.FontWeight, style?: Enum.FontStyle): Font;
1505 fromEnum: (value: Enum.Font) => Font;
1506}
1507declare const Font: FontConstructor;
1508
1509// NumberRange
1510interface NumberRange {
1511 /**
1512 * **DO NOT USE!**
1513 *
1514 * This field exists to force TypeScript to recognize this as a nominal type
1515 * @hidden
1516 * @deprecated
1517 */
1518 readonly _nominal_NumberRange: unique symbol;
1519 readonly Min: number;
1520 readonly Max: number;
1521}
1522interface NumberRangeConstructor {
1523 new (value: number): NumberRange;
1524 new (minimum: number, maximum: number): NumberRange;
1525}
1526declare const NumberRange: NumberRangeConstructor;
1527
1528// NumberSequence
1529interface NumberSequence {
1530 /**
1531 * **DO NOT USE!**
1532 *
1533 * This field exists to force TypeScript to recognize this as a nominal type
1534 * @hidden
1535 * @deprecated
1536 */
1537 readonly _nominal_NumberSequence: unique symbol;
1538 /** An array containing keypoint values for the NumberSequence. */
1539 readonly Keypoints: ReadonlyArray<NumberSequenceKeypoint>;
1540}
1541interface NumberSequenceConstructor {
1542 /** Creates a sequence of two keypoints with n for each value */
1543 new (n: number): NumberSequence;
1544 /** Creates a sequence of two keypoints with n0 and n1 as the value */
1545 new (n0: number, n1: number): NumberSequence;
1546 /** Creates a sequence with a given array containing keypoint values for the NumberSequence. */
1547 new (keypoints: ReadonlyArray<NumberSequenceKeypoint>): NumberSequence;
1548}
1549declare const NumberSequence: NumberSequenceConstructor;
1550
1551// NumberSequenceKeypoint
1552interface NumberSequenceKeypoint {
1553 /**
1554 * **DO NOT USE!**
1555 *
1556 * This field exists to force TypeScript to recognize this as a nominal type
1557 * @hidden
1558 * @deprecated
1559 */
1560 readonly _nominal_NumberSequenceKeypoint: unique symbol;
1561 readonly Envelope: number;
1562 readonly Time: number;
1563 readonly Value: number;
1564}
1565interface NumberSequenceKeypointConstructor {
1566 /** Creates a keypoint with a specified time, value, and envelope if specified. */
1567 new (time: number, value: number, envelope?: number): NumberSequenceKeypoint;
1568}
1569declare const NumberSequenceKeypoint: NumberSequenceKeypointConstructor;
1570
1571// OverlapParams
1572interface OverlapParams {
1573 /**
1574 * **DO NOT USE!**
1575 *
1576 * This field exists to force TypeScript to recognize this as a nominal type
1577 * @hidden
1578 * @deprecated
1579 */
1580 readonly _nominal_OverlapParams: unique symbol;
1581 /**
1582 * An array of objects whose descendants will be used in filtering.
1583 */
1584 FilterDescendantsInstances: Array<Instance>;
1585 /**
1586 * `RaycastFilterType.Whitelist` or `RaycastFilterType.Blacklist`. Determines how the `FilterDescendantInstances` is
1587 * used. `Blacklist` will skip the `FilterDescendantInstances`, and `Whitelist` will exclusively include them.
1588 */
1589 FilterType: Enum.RaycastFilterType;
1590 /**
1591 * The maximum amount of parts to be returned by the query. The process simply early outs once this is met.
1592 * (0 is infinite)
1593 */
1594 MaxParts: number;
1595 /**
1596 * The collision group the region check is performed on. Parts set to not collide with this group will be ignored.
1597 */
1598 CollisionGroup: string;
1599}
1600type OverlapParamsConstructor = new () => OverlapParams;
1601declare const OverlapParams: OverlapParamsConstructor;
1602
1603// PathWaypoint
1604interface PathWaypoint {
1605 /**
1606 * **DO NOT USE!**
1607 *
1608 * This field exists to force TypeScript to recognize this as a nominal type
1609 * @hidden
1610 * @deprecated
1611 */
1612 readonly _nominal_PathWaypoint: unique symbol;
1613 readonly Action: Enum.PathWaypointAction;
1614 readonly Position: Vector3;
1615}
1616type PathWaypointConstructor = new (position?: Vector3, action?: Enum.PathWaypointAction) => PathWaypoint;
1617declare const PathWaypoint: PathWaypointConstructor;
1618
1619// PhysicalProperties
1620interface PhysicalProperties {
1621 /**
1622 * **DO NOT USE!**
1623 *
1624 * This field exists to force TypeScript to recognize this as a nominal type
1625 * @hidden
1626 * @deprecated
1627 */
1628 readonly _nominal_PhysicalProperties: unique symbol;
1629 readonly Density: number;
1630 readonly Friction: number;
1631 readonly Elasticity: number;
1632 readonly FrictionWeight: number;
1633 readonly ElasticityWeight: number;
1634}
1635interface PhysicalPropertiesConstructor {
1636 new (density: number, friction: number, elasticity: number): PhysicalProperties;
1637 new (
1638 density: number,
1639 friction: number,
1640 elasticity: number,
1641 frictionWeight: number,
1642 elasticityWeight: number,
1643 ): PhysicalProperties;
1644 new (material: Enum.Material): PhysicalProperties;
1645}
1646declare const PhysicalProperties: PhysicalPropertiesConstructor;
1647
1648// Random
1649interface Random {
1650 /**
1651 * **DO NOT USE!**
1652 *
1653 * This field exists to force TypeScript to recognize this as a nominal type
1654 * @hidden
1655 * @deprecated
1656 */
1657 readonly _nominal_Random: unique symbol;
1658 /**
1659 * Returns a pseudorandom integer uniformly distributed over [min, max].
1660 */
1661 NextInteger(this: Random, min: number, max: number): number;
1662 /**
1663 * Returns a pseudorandom number uniformly distributed over [0, 1).
1664 */
1665 NextNumber(this: Random): number;
1666 /**
1667 * Returns a pseudorandom number uniformly distributed over [min, max).
1668 */
1669 NextNumber(this: Random, min: number, max: number): number;
1670 /**
1671 * Returns a unit vector with a pseudorandom direction.
1672 *
1673 * Vectors returned from this function are uniformly distributed over the unit sphere.
1674 */
1675 NextUnitVector(this: Random): Vector3;
1676 /**
1677 * Returns a new Random object with the same state as the original.
1678 */
1679 Clone(this: Random): Random;
1680}
1681
1682interface RandomConstructor {
1683 new (seed: number): Random;
1684 new (): Random;
1685}
1686
1687declare const Random: RandomConstructor;
1688
1689// Ray
1690interface Ray {
1691 /**
1692 * **DO NOT USE!**
1693 *
1694 * This field exists to force TypeScript to recognize this as a nominal type
1695 * @hidden
1696 * @deprecated
1697 */
1698 readonly _nominal_Ray: unique symbol;
1699 readonly Origin: Vector3;
1700 readonly Direction: Vector3;
1701 readonly Unit: Ray;
1702 ClosestPoint(this: Ray, point: Vector3): Vector3;
1703 Distance(this: Ray, point: Vector3): number;
1704}
1705
1706type RayConstructor = new (origin?: Vector3, direction?: Vector3) => Ray;
1707
1708declare const Ray: RayConstructor;
1709
1710// RaycastParams
1711interface RaycastParams {
1712 /**
1713 * **DO NOT USE!**
1714 *
1715 * This field exists to force TypeScript to recognize this as a nominal type
1716 * @hidden
1717 * @deprecated
1718 */
1719 readonly _nominal_RaycastParams: unique symbol;
1720 /** An array of objects whose descendants will be used in filtering raycasting candidates. */
1721 FilterDescendantsInstances: Array<Instance>;
1722 /**
1723 * Determines how the `FilterDescendantsInstances` list will be used, depending on the
1724 * [RaycastFilterType](https://developer.roblox.com/api-reference/enum/RaycastFilterType) provided.
1725 *
1726 * - `Enum.RaycastFilterType.Whitelist` — Only [BaseParts](https://developer.roblox.com/api-reference/class/BasePart)
1727 * which are descendants of objects in the filter list will be considered in the raycast operation.
1728 * - `Enum.RaycastFilterType.Blacklist` — Every [BasePart](https://developer.roblox.com/api-reference/class/BasePart)
1729 * in the game will be considered except those that are descendants of objects in the filter list.
1730 */
1731 FilterType: Enum.RaycastFilterType;
1732 /**
1733 * Determines whether the water material is considered when raycasting against
1734 * [Terrain](https://developer.roblox.com/api-reference/class/Terrain).
1735 */
1736 IgnoreWater: boolean;
1737 /**
1738 * Specifies a [collision group](https://developer.roblox.com/articles/Collision-Filtering) for the raycasting
1739 * operation. Parts in collision groups that are set to **not** collide with this group will be ignored. If this
1740 * property is omitted, the raycast will assume the **Default** collision group.
1741 */
1742 CollisionGroup: string;
1743}
1744
1745type RaycastParamsConstructor = new () => RaycastParams;
1746
1747declare const RaycastParams: RaycastParamsConstructor;
1748
1749// RaycastResult
1750interface RaycastResult {
1751 readonly Instance: BasePart;
1752 readonly Material: Enum.Material;
1753 readonly Normal: Vector3;
1754 readonly Position: Vector3;
1755}
1756
1757// Rect
1758interface Rect {
1759 /**
1760 * **DO NOT USE!**
1761 *
1762 * This field exists to force TypeScript to recognize this as a nominal type
1763 * @hidden
1764 * @deprecated
1765 */
1766 readonly _nominal_Rect: unique symbol;
1767 readonly Min: Vector2;
1768 readonly Max: Vector2;
1769 readonly Width: number;
1770 readonly Height: number;
1771}
1772interface RectConstructor {
1773 new (min?: Vector2, max?: Vector2): Rect;
1774 new (minX: number, minY: number, maxX: number, maxY: number): Rect;
1775}
1776
1777declare const Rect: RectConstructor;
1778
1779// Region3
1780interface Region3 {
1781 /**
1782 * **DO NOT USE!**
1783 *
1784 * This field exists to force TypeScript to recognize this as a nominal type
1785 * @hidden
1786 * @deprecated
1787 */
1788 readonly _nominal_Region3: unique symbol;
1789 readonly CFrame: CFrame;
1790 readonly Size: Vector3;
1791 ExpandToGrid(this: Region3, resolution: number): Region3;
1792}
1793
1794type Region3Constructor = new (min?: Vector3, max?: Vector3) => Region3;
1795
1796declare const Region3: Region3Constructor;
1797
1798// Region3int16
1799interface Region3int16 {
1800 /**
1801 * **DO NOT USE!**
1802 *
1803 * This field exists to force TypeScript to recognize this as a nominal type
1804 * @hidden
1805 * @deprecated
1806 */
1807 readonly _nominal_Region3int16: unique symbol;
1808 readonly Min: Vector3int16;
1809 readonly Max: Vector3int16;
1810}
1811
1812type Region3int16Constructor = new (min?: Vector3int16, max?: Vector3int16) => Region3int16;
1813
1814declare const Region3int16: Region3int16Constructor;
1815
1816// RotationCurveKey
1817interface RotationCurveKey {
1818 /**
1819 * **DO NOT USE!**
1820 *
1821 * This field exists to force TypeScript to recognize this as a nominal type
1822 * @hidden
1823 * @deprecated
1824 */
1825 readonly _nominal_RotationCurveKey: unique symbol;
1826 readonly Time: number;
1827 readonly Value: CFrame;
1828}
1829type RotationCurveKeyConstructor = new (
1830 time: number,
1831 value: CFrame,
1832 interpolation: CastsToEnum<Enum.KeyInterpolationMode>,
1833) => RotationCurveKey;
1834declare const RotationCurveKey: RotationCurveKeyConstructor;
1835
1836// TextChatMessage
1837interface TextChatMessage {
1838 /**
1839 * **DO NOT USE!**
1840 *
1841 * This field exists to force TypeScript to recognize this as a nominal type
1842 * @hidden
1843 * @deprecated
1844 */
1845 readonly _nominal_TextChatMessage: unique symbol;
1846}
1847
1848// TweenInfo
1849interface TweenInfo {
1850 /**
1851 * **DO NOT USE!**
1852 *
1853 * This field exists to force TypeScript to recognize this as a nominal type
1854 * @hidden
1855 * @deprecated
1856 */
1857 readonly _nominal_TweenInfo: unique symbol;
1858 readonly Time: number;
1859 readonly EasingStyle: Enum.EasingStyle;
1860 readonly EasingDirection: Enum.EasingDirection;
1861 readonly RepeatCount: number;
1862 readonly Reverses: boolean;
1863 readonly DelayTime: number;
1864}
1865
1866type TweenInfoConstructor = new (
1867 time?: number,
1868 easingStyle?: Enum.EasingStyle,
1869 easingDirection?: Enum.EasingDirection,
1870 repeatCount?: number,
1871 reverses?: boolean,
1872 delayTime?: number,
1873) => TweenInfo;
1874
1875declare const TweenInfo: TweenInfoConstructor;
1876
1877// UDim
1878interface UDim {
1879 /**
1880 * **DO NOT USE!**
1881 *
1882 * This field exists to force TypeScript to recognize this as a nominal type
1883 * @hidden
1884 * @deprecated
1885 */
1886 readonly _nominal_UDim: unique symbol;
1887 readonly Scale: number;
1888 readonly Offset: number;
1889}
1890
1891type UDimConstructor = new (scale?: number, offset?: number) => UDim;
1892
1893declare const UDim: UDimConstructor;
1894
1895// UDim2
1896interface UDim2 {
1897 /**
1898 * **DO NOT USE!**
1899 *
1900 * This field exists to force TypeScript to recognize this as a nominal type
1901 * @hidden
1902 * @deprecated
1903 */
1904 readonly _nominal_UDim2: unique symbol;
1905 readonly X: UDim;
1906 readonly Y: UDim;
1907 readonly Width: UDim;
1908 readonly Height: UDim;
1909 Lerp(this: UDim2, goal: UDim2, alpha: number): UDim2;
1910}
1911
1912interface UDim2Constructor {
1913 new (xScale: number, xOffset: number, yScale: number, yOffset: number): UDim2;
1914 new (xDim: UDim, yDim: UDim): UDim2;
1915 new (): UDim2;
1916 fromOffset: (x?: number, y?: number) => UDim2;
1917 fromScale: (x?: number, y?: number) => UDim2;
1918}
1919
1920declare const UDim2: UDim2Constructor;
1921
1922// Vector2
1923interface Vector2 {
1924 /**
1925 * **DO NOT USE!**
1926 *
1927 * This field exists to force TypeScript to recognize this as a nominal type
1928 * @hidden
1929 * @deprecated
1930 */
1931 readonly _nominal_Vector2: unique symbol;
1932 /** The x-coordinate of the Vector2. */
1933 readonly X: number;
1934 /** The y-coordinate of the Vector2. */
1935 readonly Y: number;
1936 /** A normalized copy of the vector - has a magnitude of 1. */
1937 readonly Unit: Vector2;
1938 /** The length of the vector */
1939 readonly Magnitude: number;
1940 /** Returns a scalar dot product of the two vectors */
1941 Dot(this: Vector2, other: Vector2): number;
1942 /** Returns a Vector2 linearly interpolated between this Vector2 and the goal by the fraction alpha */
1943 Lerp(this: Vector2, goal: Vector2, alpha: number): Vector2;
1944 /** Returns the cross product of the two vectors */
1945 Cross(this: Vector2, other: Vector2): number;
1946 /** Returns a new Vector2 with the minimum of each component. */
1947 Min(this: Vector2, ...vectors: Array<Vector2>): Vector2;
1948 /** Returns a new Vector2 with the maximum of each component. */
1949 Max(this: Vector2, ...vectors: Array<Vector2>): Vector2;
1950}
1951
1952interface Vector2Constructor {
1953 /**
1954 * A Vector2 with a magnitude of zero.
1955 *
1956 * This API member is a **constant**, and must be accessed through the `Vector2` global as opposed to an individual
1957 * `Vector2` object.
1958 *
1959 * ```lua
1960 * print(Vector2.zero) --> 0, 0
1961 * ```
1962 */
1963 readonly zero: Vector2;
1964 /**
1965 * A Vector2 with a value of 1 on every axis.
1966 *
1967 * This API member is a **constant**, and must be accessed through the `Vector2` global as opposed to an individual
1968 * `Vector2` object.
1969 *
1970 * ```lua
1971 * print(Vector2.one) --> 1, 1
1972 * ```
1973 */
1974 readonly one: Vector2;
1975 /**
1976 * A Vector2 with a value of 1 on the X axis.
1977 *
1978 * This API member is a **constant**, and must be accessed through the `Vector2` global as opposed to an individual
1979 * `Vector2` object.
1980 *
1981 * ```lua
1982 * print(Vector2.xAxis) --> 1, 0
1983 * ```
1984 */
1985 readonly xAxis: Vector2;
1986 /**
1987 * A Vector2 with a value of 1 on the Y axis.
1988 *
1989 * This API member is a **constant**, and must be accessed through the `Vector2` global as opposed to an individual
1990 * `Vector2` object.
1991 *
1992 * ```lua
1993 * print(Vector2.yAxis) --> 0, 1
1994 * ```
1995 */
1996 readonly yAxis: Vector2;
1997 /** Returns a Vector2 from the given x and y components. */
1998 new (x?: number, y?: number): Vector2;
1999}
2000
2001declare const Vector2: Vector2Constructor;
2002
2003// Vector2int16
2004interface Vector2int16 {
2005 /**
2006 * **DO NOT USE!**
2007 *
2008 * This field exists to force TypeScript to recognize this as a nominal type
2009 * @hidden
2010 * @deprecated
2011 */
2012 readonly _nominal_Vector2int16: unique symbol;
2013 readonly X: number;
2014 readonly Y: number;
2015}
2016
2017type Vector2int16Constructor = new (x?: number, y?: number) => Vector2int16;
2018
2019declare const Vector2int16: Vector2int16Constructor;
2020
2021// Vector3
2022interface Vector3 {
2023 /**
2024 * **DO NOT USE!**
2025 *
2026 * This field exists to force TypeScript to recognize this as a nominal type
2027 * @hidden
2028 * @deprecated
2029 */
2030 readonly _nominal_Vector3: unique symbol;
2031 readonly X: number;
2032 readonly Y: number;
2033 readonly Z: number;
2034 /** A normalized copy of the vector - one which has the same direction as the original but a magnitude of 1. */
2035 readonly Unit: Vector3;
2036 /** The length of the vector */
2037 readonly Magnitude: number;
2038 /** Returns a Vector3 linearly interpolated between this Vector3 and the goal by the fraction alpha. */
2039 Lerp(this: Vector3, goal: Vector3, alpha: number): Vector3;
2040 /** Returns a scalar dot product of the two vectors. */
2041 Dot(this: Vector3, other: Vector3): number;
2042 /** Returns the cross product of the two vectors. */
2043 Cross(this: Vector3, other: Vector3): Vector3;
2044 /** Returns true if the other Vector3 falls within the epsilon radius of this Vector3. */
2045 FuzzyEq(this: Vector3, other: Vector3, epsilon?: number): boolean;
2046 /** Returns a new Vector3 with the minimum of each component. */
2047 Min(this: Vector3, ...vectors: Array<Vector3>): Vector3;
2048 /** Returns a new Vector3 with the maximum of each component. */
2049 Max(this: Vector3, ...vectors: Array<Vector3>): Vector3;
2050}
2051
2052interface Vector3Constructor {
2053 /**
2054 * A Vector3 with a magnitude of zero.
2055 *
2056 * This API member is a **constant**, and must be accessed through the `Vector3` global as opposed to an individual
2057 * `Vector3` object.
2058 *
2059 * ```lua
2060 * print(Vector3.zero) --> 0, 0, 0
2061 * ```
2062 */
2063 readonly zero: Vector3;
2064 /**
2065 * A Vector3 with a value of 1 on every axis.
2066 *
2067 * This API member is a **constant**, and must be accessed through the `Vector3` global as opposed to an individual
2068 * `Vector3` object.
2069 *
2070 * ```lua
2071 * print(Vector3.one) --> 1, 1, 1
2072 * ```
2073 */
2074 readonly one: Vector3;
2075 /**
2076 * A Vector3 with a value of 1 on the X axis.
2077 *
2078 * This API member is a **constant**, and must be accessed through the `Vector3` global as opposed to an individual
2079 * `Vector3` object.
2080 *
2081 * ```lua
2082 * print(Vector3.xAxis) --> 1, 0, 0
2083 * ```
2084 */
2085 readonly xAxis: Vector3;
2086 /**
2087 * A Vector3 with a value of 1 on the Y axis.
2088 *
2089 * This API member is a **constant**, and must be accessed through the `Vector3` global as opposed to an individual
2090 * `Vector3` object.
2091 *
2092 * ```lua
2093 * print(Vector3.yAxis) --> 0, 1, 0
2094 * ```
2095 */
2096 readonly yAxis: Vector3;
2097 /**
2098 * A Vector3 with a value of 1 on the Z axis.
2099 *
2100 * This API member is a **constant**, and must be accessed through the `Vector3` global as opposed to an individual
2101 * `Vector3` object.
2102 *
2103 * ```lua
2104 * print(Vector3.zAxis) --> 0, 0, 1
2105 * ```
2106 */
2107 readonly zAxis: Vector3;
2108 /** Constructs a new Vector3 in a particular direction. */
2109 FromNormalId: (norm: Enum.NormalId) => Vector3;
2110 /** Constructs a new Vector3 for a particular axis. */
2111 FromAxis: (axis: Enum.Axis) => Vector3;
2112 /** Constructs a new Vector3 using the given x, y, and z components. */
2113 new (x?: number, y?: number, z?: number): Vector3;
2114}
2115
2116declare const Vector3: Vector3Constructor;
2117
2118// Vector3int16
2119interface Vector3int16 {
2120 /**
2121 * **DO NOT USE!**
2122 *
2123 * This field exists to force TypeScript to recognize this as a nominal type
2124 * @hidden
2125 * @deprecated
2126 */
2127 readonly _nominal_Vector3int16: unique symbol;
2128 readonly X: number;
2129 readonly Y: number;
2130 readonly Z: number;
2131}
2132
2133type Vector3int16Constructor = new (x?: number, y?: number, z?: number) => Vector3int16;
2134
2135declare const Vector3int16: Vector3int16Constructor;
2136
2137// unusable internal studio classes
2138interface QFont {}
2139interface QDir {}
2140
2141// built-in globals
2142declare const game: DataModel;
2143declare const script: LuaSourceContainer;
2144declare const shared: object;
2145
2146type DelayedCallback =
2147 /**
2148 * @param delayedTime The amount of time in seconds which elapsed since the function invoking this callback was called
2149 * @param gameTime The total time Roblox Lua has been running
2150 */
2151 (delayedTime: number, gameTime: number) => void;
2152
2153// built-in functions
2154
2155/** Schedules a function to be executed after delayTime seconds have passed, without yielding the current thread. This function allows multiple Lua threads to be executed in parallel from the same stack. The delay will have a minimum duration of 29 milliseconds, but this minimum may be higher depending on the target framerate and various throttling conditions. If the delayTime parameter is not specified, the minimum duration will be used. */
2156declare function delay(delayTime: number, callback: DelayedCallback): void;
2157/**
2158 * Returns how much time has elapsed since the current instance of Roblox was started.
2159 * In Roblox Studio, this begins counting up from the moment Roblox Studio starts running, not just when opening a place.
2160 * @deprecated use os.clock() instead.
2161 */
2162declare function elapsedTime(): number;
2163/** Runs the supplied ModuleScript if it has not been run already, and returns what the ModuleScript returned (in both cases).
2164
2165If the ModuleScript the user wants to use has been uploaded to Roblox (with the instance’s name being ‘MainModule’), it can be loaded by using the require function on the asset ID of the ModuleScript, though only on the server. */
2166declare function require(moduleScript: ModuleScript | number): unknown;
2167/** Runs the specified callback function in a separate thread, without yielding the current thread.
2168The function will be executed the next time Roblox’s Task Scheduler runs an update cycle. This delay will take at least 29 milliseconds but can arbitrarily take longer, depending on the target framerate and various throttling conditions. */
2169declare function spawn(callback: DelayedCallback): void;
2170declare function tick(): number;
2171/** Time since the game started running. Will be 0 in Studio when not running the game. */
2172declare function time(): number;
2173declare function UserSettings(): UserSettings;
2174/** Returns the current version of Roblox as a string. The integers in the version string are separated by periods, and each integers represent the following, in order:
2175
2176Generation - The current generation of the application shell that is hosting the client.
2177Version - The current release version of Roblox.
2178Patch - The current patch number for this version of Roblox.
2179Commit - The ID of the last internal commit that was accepted into this version of the client. */
2180declare function version(): string;
2181/** Yields the current thread until the specified amount of seconds have elapsed.
2182The delay will have a minimum duration of 29 milliseconds, but this minimum may be higher depending on the target framerate and various throttling conditions. If the seconds parameter is not specified, the minimum duration will be used.
2183This function returns:
2184
2185Actual time yielded (in seconds)
2186Total time since the software was initialized (in seconds) */
2187declare function wait(seconds?: number): LuaTuple<[number, number]>;
2188/** Behaves identically to Lua’s print function, except the output is styled as a warning, with yellow text and a timestamp.
2189This function accepts any number of arguments, and will attempt to convert them into strings which will then be joined together with spaces between them. */
2190declare function warn(...params: Array<unknown>): void;
2191
2192// math functions
2193declare namespace math {
2194 /** Returns a perlin noise value between -0.5 and 0.5. If you leave arguments out, they will be interpreted as zero, so math.noise(1.158) is equivalent to math.noise(1.158, 0, 0) and math.noise(1.158, 5.723) is equivalent to math.noise(1.158, 5.723, 0).
2195 * The function uses a perlin noise algorithm to assign fixed values to coordinates. For example, math.noise(1.158, 5.723) will always return 0.48397532105446 and math.noise(1.158, 6) will always return 0.15315161645412.
2196 * If x, y and z are all integers, the return value will be 0. For fractional values of x, y and z, the return value will gradually fluctuate between -0.5 and 0.5. For coordinates that are close to each other, the return values will also be close to each other. */
2197 function noise(x?: number, y?: number, z?: number): number;
2198
2199 /** Returns a number between min and max, inclusive. */
2200 function clamp(n: number, min: number, max: number): number;
2201}
2202
2203declare namespace utf8 {
2204 /** Receives zero or more codepoints as integers, converts each one to its corresponding UTF-8 byte sequence and returns a string with the concatenation of all these sequences. */
2205 function char(...codepoints: Array<number>): string;
2206 /** Returns an iterator function that will iterate over all codepoints in string str. It raises an error if it meets any invalid byte sequence. */
2207 function codes(str: string): IterableFunction<LuaTuple<[number, number]>>;
2208 /** Returns the codepoints (as integers) from all codepoints in the provided string (str) that start between byte positions i and j (both included). The default for i is 0 and for j is i. It raises an error if it meets any invalid byte sequence. Similar to `string.byte`.*/
2209 function codepoint(str: string, i?: number, j?: number): LuaTuple<Array<number>>;
2210 /** Returns the number of UTF-8 codepoints in the string str that start between positions i and j (both inclusive). The default for i is 0 and for j is -1. If it finds any invalid byte sequence, returns a false value plus the position of the first invalid byte. */
2211 function len(s: string, i?: number, j?: number): LuaTuple<[number, undefined] | [false, number]>;
2212 /** Returns the position (in bytes) where the encoding of the n-th codepoint of s (counting from byte position i) starts. A negative n gets characters before position i. The default for i is 0 when n is non-negative and #s + 1 otherwise, so that utf8.offset(s, -n) gets the offset of the n-th character from the end of the string. If the specified character is neither in the subject nor right after its end, the function returns nil. */
2213 function offset(s: string, n: number, i?: number): number | undefined;
2214 /** Returns an iterator function that will iterate the grapheme clusters of the string. */
2215 function graphemes(s: string, i?: number, j?: number): IterableFunction<LuaTuple<[number, number]>>;
2216 /** Converts the input string to Normal Form C, which tries to convert decomposed characters into composed characters. */
2217 function nfcnormalize(str: string): string;
2218 /** Converts the input string to Normal Form D, which tries to break up composed characters into decomposed characters. */
2219 function nfdnormalize(str: string): string;
2220 /** The pattern which matches exactly one UTF-8 byte sequence, assuming that the subject is a valid UTF-8 string. */
2221 const charpattern: "[%z\x01-\x7F\xC2-\xF4][\x80-\xBF]*";
2222}
2223
2224declare namespace task {
2225 /** Queues the calling script to be run during the parallel execution phase of the frame. */
2226 function desynchronize(): void;
2227 /** Yields the calling script and queues it for serial execution following the completion of the parallel execution phase of the frame. */
2228 function synchronize(): void;
2229 /** Defers the passed thread or function to be resumed at the end of the current resumption cycle. */
2230 function defer<T extends Array<any>>(callback: (...args: T) => void, ...args: T): thread;
2231 function defer(thread: thread, ...args: Array<unknown>): thread;
2232 /** Delays the passed thread or function until the given duration has elapsed. Resumes on engine Heartbeat. */
2233 function delay<T extends Array<any>>(duration: number, callback: (...args: T) => void, ...args: T): thread;
2234 function delay(duration: number, thread: thread, ...args: Array<unknown>): thread;
2235 /** Resumes the passed thread or function instantly using the engine's scheduler. */
2236 function spawn<T extends Array<any>>(callback: (...args: T) => void, ...args: T): thread;
2237 function spawn(thread: thread, ...args: Array<unknown>): thread;
2238 /** Delay the current thread until the given duration has elasped. Resumes on engine Heartbeat. */
2239 function wait(duration?: number): number;
2240 /** Cancels a thread, preventing it from being resumed. */
2241 function cancel(thread: thread): void;
2242}
2243
2244interface GettableCores {
2245 AvatarContextMenuEnabled: boolean;
2246 PointsNotificationsActive: boolean;
2247 BadgesNotificationsActive: boolean;
2248 ChatActive: boolean;
2249 ChatWindowSize: UDim2;
2250 ChatWindowPosition: UDim2;
2251 ChatBarDisabled: boolean;
2252 GetBlockedUserIds: Array<number>;
2253 PlayerBlockedEvent: BindableEvent;
2254 PlayerUnblockedEvent: BindableEvent;
2255 PlayerMutedEvent: BindableEvent;
2256 PlayerUnmutedEvent: BindableEvent;
2257 PlayerFriendedEvent: BindableEvent;
2258 PlayerUnfriendedEvent: BindableEvent;
2259 DeveloperConsoleVisible: boolean;
2260 VRRotationIntensity: "Low" | "High" | "Smooth";
2261}
2262
2263interface SettableCores {
2264 ChatActive: boolean;
2265 PointsNotificationsActive: boolean;
2266 BadgesNotificationsActive: boolean;
2267 ResetButtonCallback: boolean | BindableEvent;
2268 ChatMakeSystemMessage: MakeSystemMessageConfig;
2269 ChatWindowSize: UDim2;
2270 ChatWindowPosition: UDim2;
2271 ChatBarDisabled: boolean;
2272 SendNotification: SendNotificationConfig;
2273 TopbarEnabled: boolean;
2274 DevConsoleVisible: boolean;
2275 PromptSendFriendRequest: Player;
2276 PromptUnfriend: Player;
2277 PromptBlockPlayer: Player;
2278 PromptUnblockPlayer: Player;
2279 AvatarContextMenuEnabled: boolean;
2280 AddAvatarContextMenuOption: Enum.AvatarContextMenuOption | [string, BindableFunction];
2281 RemoveAvatarContextMenuOption: Enum.AvatarContextMenuOption | [string, BindableFunction];
2282 CoreGuiChatConnections:
2283 | { [name: string]: BindableEvent | BindableFunction }
2284 | Map<string, BindableEvent | BindableFunction>;
2285 VREnableControllerModels: boolean;
2286 VRLaserPointerMode: "Disabled" | "Pointer" | "Navigation" | "Hidden";
2287}
2288
2289// type
2290interface CheckablePrimitives {
2291 nil: undefined;
2292 boolean: boolean;
2293 string: string;
2294 number: number;
2295 table: object;
2296 userdata: unknown;
2297 function: Callback;
2298 thread: thread;
2299 vector: Vector3;
2300}
2301
2302/**
2303 * Returns the type of its only argument, coded as a string.
2304 * Roblox datatypes will return "userdata" when passed to this function. You should use Roblox's `typeOf()` function if you want to differentiate between Roblox datatypes.
2305 */
2306declare function type(value: unknown): keyof CheckablePrimitives;
2307
2308/** The strings which can be returned by typeOf and their corresponding types */
2309interface CheckableTypes extends CheckablePrimitives {
2310 Axes: Axes;
2311 BrickColor: BrickColor;
2312 CFrame: CFrame;
2313 Color3: Color3;
2314 ColorSequence: ColorSequence;
2315 ColorSequenceKeypoint: ColorSequenceKeypoint;
2316 DateTime: DateTime;
2317 DockWidgetPluginGuiInfo: DockWidgetPluginGuiInfo;
2318 Enum: Enum;
2319 EnumItem: EnumItem;
2320 Enums: Enums;
2321 Faces: Faces;
2322 Instance: Instance;
2323 NumberRange: NumberRange;
2324 NumberSequence: NumberSequence;
2325 NumberSequenceKeypoint: NumberSequenceKeypoint;
2326 PathWaypoint: PathWaypoint;
2327 PhysicalProperties: PhysicalProperties;
2328 RBXScriptConnection: RBXScriptConnection;
2329 RBXScriptSignal: RBXScriptSignal;
2330 Random: Random;
2331 Ray: Ray;
2332 RaycastParams: RaycastParams;
2333 RaycastResult: RaycastResult;
2334 Rect: Rect;
2335 Region3: Region3;
2336 Region3int16: Region3int16;
2337 TweenInfo: TweenInfo;
2338 UDim: UDim;
2339 UDim2: UDim2;
2340 Vector2: Vector2;
2341 Vector2int16: Vector2int16;
2342 Vector3: Vector3;
2343 Vector3int16: Vector3int16;
2344}