UNPKG

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