@rbxts/types
- Version 1.0.810
- Published
- 3.48 MB
- No dependencies
- MIT license
Install
npm i @rbxts/types
yarn add @rbxts/types
pnpm add @rbxts/types
Overview
TypeScript typings for the Roblox platform. Partially handwritten and partially automatically generated.
Index
Variables
- Axes
- BrickColor
- CatalogSearchParams
- CFrame
- Color3
- ColorSequence
- ColorSequenceKeypoint
- DateTime
- DockWidgetPluginGuiInfo
- Faces
- FloatCurveKey
- Font
- game
- Instance
- NumberRange
- NumberSequence
- NumberSequenceKeypoint
- OverlapParams
- Path2DControlPoint
- PathWaypoint
- PhysicalProperties
- Random
- Ray
- RaycastParams
- Rect
- Region3
- Region3int16
- RotationCurveKey
- script
- shared
- SharedTable
- SharedTableNominal
- TweenInfo
- UDim
- UDim2
- Vector2
- Vector2int16
- Vector3
- Vector3int16
Functions
Namespaces
Variables
variable Axes
const Axes: AxesConstructor;
variable BrickColor
const BrickColor: BrickColorConstructor;
variable CatalogSearchParams
const CatalogSearchParams: CatalogSearchParamsConstructor;
variable CFrame
const CFrame: CFrameConstructor;
variable Color3
const Color3: Color3Constructor;
variable ColorSequence
const ColorSequence: ColorSequenceConstructor;
variable ColorSequenceKeypoint
const ColorSequenceKeypoint: ColorSequenceKeypointConstructor;
variable DateTime
const DateTime: DateTimeConstructor;
variable DockWidgetPluginGuiInfo
const DockWidgetPluginGuiInfo: DockWidgetPluginGuiInfoConstructor;
variable Faces
const Faces: FacesConstructor;
variable FloatCurveKey
const FloatCurveKey: FloatCurveKeyConstructor;
variable Font
const Font: FontConstructor;
variable game
const game: DataModel;
variable Instance
const Instance: InstanceConstructor;
variable NumberRange
const NumberRange: NumberRangeConstructor;
variable NumberSequence
const NumberSequence: NumberSequenceConstructor;
variable NumberSequenceKeypoint
const NumberSequenceKeypoint: NumberSequenceKeypointConstructor;
variable OverlapParams
const OverlapParams: OverlapParamsConstructor;
variable Path2DControlPoint
const Path2DControlPoint: Path2DControlPointConstructor;
variable PathWaypoint
const PathWaypoint: PathWaypointConstructor;
variable PhysicalProperties
const PhysicalProperties: PhysicalPropertiesConstructor;
variable Random
const Random: RandomConstructor;
variable Ray
const Ray: RayConstructor;
variable RaycastParams
const RaycastParams: RaycastParamsConstructor;
variable Rect
const Rect: RectConstructor;
variable Region3
const Region3: Region3Constructor;
variable Region3int16
const Region3int16: Region3int16Constructor;
variable RotationCurveKey
const RotationCurveKey: RotationCurveKeyConstructor;
variable script
const script: LuaSourceContainer;
variable shared
const shared: {};
variable SharedTable
const SharedTable: SharedTableConstructor;
variable SharedTableNominal
const SharedTableNominal: {};
variable TweenInfo
const TweenInfo: TweenInfoConstructor;
variable UDim
const UDim: UDimConstructor;
variable UDim2
const UDim2: UDim2Constructor;
variable Vector2
const Vector2: Vector2Constructor;
variable Vector2int16
const Vector2int16: Vector2int16Constructor;
variable Vector3
const Vector3: Vector3Constructor;
variable Vector3int16
const Vector3int16: Vector3int16Constructor;
Functions
function delay
delay: (delayTime: number, callback: DelayedCallback) => void;
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.
function elapsedTime
elapsedTime: () => number;
Returns how much time has elapsed since the current instance of Roblox was started. In Roblox Studio, this begins counting up from the moment Roblox Studio starts running, not just when opening a place.
Deprecated
use os.clock() instead.
function gcinfo
gcinfo: () => number;
Returns the total memory heap size in kilobytes. The number reflects the current heap consumption from the operating system perspective, which fluctuates over time as garbage collector frees objects.
function require
require: (moduleScript: ModuleScript | number) => unknown;
Runs the supplied ModuleScript if it has not been run already, and returns what the ModuleScript returned (in both cases).
If 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.
function spawn
spawn: (callback: DelayedCallback) => void;
Runs the specified callback function in a separate thread, without yielding the current thread. The 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.
function tick
tick: () => number;
function time
time: () => number;
Time since the game started running. Will be 0 in Studio when not running the game.
function type
type: (value: unknown) => keyof CheckablePrimitives;
Returns the type of its only argument, coded as a string. 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.
function UserSettings
UserSettings: () => UserSettings;
function version
version: () => string;
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:
Generation - The current generation of the application shell that is hosting the client. Version - The current release version of Roblox. Patch - The current patch number for this version of Roblox. Commit - The ID of the last internal commit that was accepted into this version of the client.
function wait
wait: (seconds?: number) => LuaTuple<[number, number]>;
Yields the current thread until the specified amount of seconds have elapsed. 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 seconds parameter is not specified, the minimum duration will be used. This function returns:
Actual time yielded (in seconds) Total time since the software was initialized (in seconds)
function warn
warn: (...params: Array<unknown>) => void;
Behaves identically to Lua’s print function, except the output is styled as a warning, with yellow text and a timestamp. This function accepts any number of arguments, and will attempt to convert them into strings which will then be joined together with spaces between them.
Namespaces
namespace buffer
namespace buffer {}
function copy
copy: ( target: buffer, targetOffset: number, source: buffer, sourceOffset?: number, count?: number) => void;
Copies bytes between buffers.
function create
create: (size: number) => buffer;
Creates a buffer.
function fill
fill: (b: buffer, offset: number, value: number, count?: number) => void;
Sets a region of the buffer memory to some 8-bit unsigned integer value.
function fromstring
fromstring: (str: string) => buffer;
Creates a buffer from a string.
function len
len: (b: buffer) => number;
Returns the size of the buffer in bytes.
function readf32
readf32: (b: buffer, offset: number) => number;
Reads a 32-bit floating-point value from the buffer.
function readf64
readf64: (b: buffer, offset: number) => number;
Reads a 64-bit floating-point value from the buffer.
function readi16
readi16: (b: buffer, offset: number) => number;
Reads a 16-bit signed integer from the buffer.
function readi32
readi32: (b: buffer, offset: number) => number;
Reads a 32-bit signed integer from the buffer.
function readi8
readi8: (b: buffer, offset: number) => number;
Reads an 8-bit signed integer from the buffer.
function readstring
readstring: (b: buffer, offset: number, count: number) => string;
Reads a string from the buffer.
function readu16
readu16: (b: buffer, offset: number) => number;
Reads a 16-bit unsigned integer from the buffer.
function readu32
readu32: (b: buffer, offset: number) => number;
Reads a 32-bit unsigned integer from the buffer.
function readu8
readu8: (b: buffer, offset: number) => number;
Reads an 8-bit unsigned integer from the buffer.
function tostring
tostring: (b: buffer) => string;
Converts a buffer to a string.
function writef32
writef32: (b: buffer, offset: number, value: number) => void;
Writes a 32-bit floating-point value to the buffer.
function writef64
writef64: (b: buffer, offset: number, value: number) => void;
Writes a 64-bit floating-point value to the buffer.
function writei16
writei16: (b: buffer, offset: number, value: number) => void;
Writes a 16-bit signed integer to the buffer.
function writei32
writei32: (b: buffer, offset: number, value: number) => void;
Writes a 32-bit signed integer to the buffer.
function writei8
writei8: (b: buffer, offset: number, value: number) => void;
Writes an 8-bit signed integer to the buffer.
function writestring
writestring: (b: buffer, offset: number, value: string, count?: number) => void;
Writes a string to the buffer.
function writeu16
writeu16: (b: buffer, offset: number, value: number) => void;
Writes a 16-bit unsigned integer to the buffer.
function writeu32
writeu32: (b: buffer, offset: number, value: number) => void;
Writes a 32-bit unsigned integer to the buffer.
function writeu8
writeu8: (b: buffer, offset: number, value: number) => void;
Writes an 8-bit unsigned integer to the buffer.
namespace math
namespace math {}
function clamp
clamp: (n: number, min: number, max: number) => number;
Returns a number between min and max, inclusive.
function noise
noise: (x: number, y?: number, z?: number) => number;
Returns a perlin noise value. The returned value is most often between the range [-1, 1].
The returned value is sometimes will be outside of the range [-1,1], so if the interval is critical to you, you should use
math.clamp(noise, -1, 1)
on the output.The function uses a perlin noise algorithm to assign fixed values to coordinates. For example,
math.noise(1.158, 5.723)
will always return0.48397532105446
andmath.noise(1.158, 6)
will always return0.15315161645412
.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.
namespace task
namespace task {}
function cancel
cancel: (thread: thread) => void;
Cancels a thread, preventing it from being resumed.
function defer
defer: { <T extends Array<any>>(callback: (...args: T) => void, ...args: T): thread; (thread: thread, ...args: Array<unknown>): thread;};
Defers the passed thread or function to be resumed at the end of the current resumption cycle.
function delay
delay: { <T extends Array<any>>( duration: number, callback: (...args: T) => void, ...args: T ): thread; (duration: number, thread: thread, ...args: Array<unknown>): thread;};
Delays the passed thread or function until the given duration has elapsed. Resumes on engine Heartbeat.
function desynchronize
desynchronize: () => void;
Queues the calling script to be run during the parallel execution phase of the frame.
function spawn
spawn: { <T extends Array<any>>(callback: (...args: T) => void, ...args: T): thread; (thread: thread, ...args: Array<unknown>): thread;};
Resumes the passed thread or function instantly using the engine's scheduler.
function synchronize
synchronize: () => void;
Yields the calling script and queues it for serial execution following the completion of the parallel execution phase of the frame.
function wait
wait: (duration?: number) => number;
Delay the current thread until the given duration has elasped. Resumes on engine Heartbeat.
namespace utf8
namespace utf8 {}
variable charpattern
const charpattern: string;
The pattern which matches exactly one UTF-8 byte sequence, assuming that the subject is a valid UTF-8 string.
function char
char: (...codepoints: Array<number>) => string;
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.
function codepoint
codepoint: (str: string, i?: number, j?: number) => LuaTuple<Array<number>>;
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
.
function codes
codes: (str: string) => IterableFunction<LuaTuple<[number, number]>>;
Returns an iterator function that will iterate over all codepoints in string str. It raises an error if it meets any invalid byte sequence.
function graphemes
graphemes: ( s: string, i?: number, j?: number) => IterableFunction<LuaTuple<[number, number]>>;
Returns an iterator function that will iterate the grapheme clusters of the string.
function len
len: ( s: string, i?: number, j?: number) => LuaTuple<[number, undefined] | [false, number]>;
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.
function nfcnormalize
nfcnormalize: (str: string) => string;
Converts the input string to Normal Form C, which tries to convert decomposed characters into composed characters.
function nfdnormalize
nfdnormalize: (str: string) => string;
Converts the input string to Normal Form D, which tries to break up composed characters into decomposed characters.
function offset
offset: (s: string, n: number, i?: number) => number | undefined;
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.
Package Files (1)
Dependencies (0)
No dependencies.
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@rbxts/types
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@rbxts/types)
- HTML<a href="https://www.jsdocs.io/package/@rbxts/types"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 6460 ms. - Missing or incorrect documentation? Open an issue for this package.