Show raw api
{
"functions": [
{
"name": "isPromise",
"desc": "Determines whether a value is a promise or not.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
}
],
"function_type": "static",
"source": {
"line": 27,
"path": "src/promise/src/Shared/Promise.lua"
}
},
{
"name": "new",
"desc": "Constructs a new promise.\n\n::warning\nDo not yield within this func callback, as it will yield on the\nmain thread. This is a performance optimization.\n::",
"params": [
{
"name": "func",
"desc": "",
"lua_type": "(resolve: (...) -> (), reject: (...) -> ()) -> ()?"
}
],
"returns": [
{
"desc": "",
"lua_type": "Promise<T>"
}
],
"function_type": "static",
"source": {
"line": 42,
"path": "src/promise/src/Shared/Promise.lua"
}
},
{
"name": "spawn",
"desc": "Initializes a new promise with the given function in a spawn wrapper.",
"params": [
{
"name": "func",
"desc": "",
"lua_type": "(resolve: (...) -> (), reject: (...) -> ()) -> ()?"
}
],
"returns": [
{
"desc": "",
"lua_type": "Promise<T>"
}
],
"function_type": "static",
"source": {
"line": 62,
"path": "src/promise/src/Shared/Promise.lua"
}
},
{
"name": "delay",
"desc": "Initializes a new promise with the given function in a delay wrapper.",
"params": [
{
"name": "seconds",
"desc": "",
"lua_type": "number"
},
{
"name": "func",
"desc": "",
"lua_type": "(resolve: (...) -> (), reject: (...) -> ()) -> ()?"
}
],
"returns": [
{
"desc": "",
"lua_type": "Promise<T>"
}
],
"function_type": "static",
"source": {
"line": 77,
"path": "src/promise/src/Shared/Promise.lua"
}
},
{
"name": "defer",
"desc": "Initializes a new promise with the given function in a deferred wrapper.",
"params": [
{
"name": "func",
"desc": "",
"lua_type": "(resolve: (...) -> (), reject: (...) -> ()) -> ()?"
}
],
"returns": [
{
"desc": "",
"lua_type": "Promise<T>"
}
],
"function_type": "static",
"source": {
"line": 94,
"path": "src/promise/src/Shared/Promise.lua"
}
},
{
"name": "resolved",
"desc": "Returns a resolved promise with the following values",
"params": [
{
"name": "...",
"desc": "",
"lua_type": "Values to resolve to"
}
],
"returns": [
{
"desc": "",
"lua_type": "Promise<T>"
}
],
"function_type": "static",
"source": {
"line": 109,
"path": "src/promise/src/Shared/Promise.lua"
}
},
{
"name": "rejected",
"desc": "Returns a rejected promise with the following values",
"params": [
{
"name": "...",
"desc": "",
"lua_type": "Values to reject to"
}
],
"returns": [
{
"desc": "",
"lua_type": "Promise<T>"
}
],
"function_type": "static",
"source": {
"line": 134,
"path": "src/promise/src/Shared/Promise.lua"
}
},
{
"name": "IsPending",
"desc": "Returns whether or not the promise is pending",
"params": [],
"returns": [
{
"desc": "True if pending, false otherwise",
"lua_type": "bool"
}
],
"function_type": "method",
"source": {
"line": 151,
"path": "src/promise/src/Shared/Promise.lua"
}
},
{
"name": "IsFulfilled",
"desc": "Returns whether or not the promise is fulfilled",
"params": [],
"returns": [
{
"desc": "True if fulfilled",
"lua_type": "bool"
}
],
"function_type": "method",
"source": {
"line": 160,
"path": "src/promise/src/Shared/Promise.lua"
}
},
{
"name": "IsRejected",
"desc": "Returns whether or not the promise is rejected",
"params": [],
"returns": [
{
"desc": "True if rejected",
"lua_type": "bool"
}
],
"function_type": "method",
"source": {
"line": 169,
"path": "src/promise/src/Shared/Promise.lua"
}
},
{
"name": "Wait",
"desc": "Yields until the promise is complete, and errors if an error\nexists, otherwise returns the fulfilled results.",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "T"
}
],
"function_type": "method",
"yields": true,
"source": {
"line": 180,
"path": "src/promise/src/Shared/Promise.lua"
}
},
{
"name": "Yield",
"desc": "Yields until the promise is complete, then returns a boolean indicating\nthe result, followed by the values from the promise.",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "boolean, T"
}
],
"function_type": "method",
"yields": true,
"source": {
"line": 212,
"path": "src/promise/src/Shared/Promise.lua"
}
},
{
"name": "Resolve",
"desc": "Promise resolution procedure, resolves the given values",
"params": [
{
"name": "...",
"desc": "",
"lua_type": "T"
}
],
"returns": [],
"function_type": "method",
"source": {
"line": 244,
"path": "src/promise/src/Shared/Promise.lua"
}
},
{
"name": "Reject",
"desc": "Rejects the promise with the values given",
"params": [
{
"name": "...",
"desc": "Params to reject with",
"lua_type": "T"
}
],
"returns": [],
"function_type": "method",
"source": {
"line": 322,
"path": "src/promise/src/Shared/Promise.lua"
}
},
{
"name": "Then",
"desc": "Handlers if/when promise is fulfilled/rejected. It takes up to two arguments, callback functions\nfor the success and failure cases of the Promise. May return the same promise if certain behavior\nis met.\n\n:::info\nWe do not comply with 2.2.4 (onFulfilled or onRejected must not be called until the execution context stack\ncontains only platform code). This means promises may stack overflow, however, it also makes promises a lot cheaper\n:::\n\nIf/when promise is rejected, all respective onRejected callbacks must execute in the order of their\noriginating calls to then.\n\nIf/when promise is fulfilled, all respective onFulfilled callbacks must execute in the order of their\noriginating calls to then.",
"params": [
{
"name": "onFulfilled",
"desc": "Called if/when fulfilled with parameters",
"lua_type": "function"
},
{
"name": "onRejected",
"desc": "Called if/when rejected with parameters",
"lua_type": "function"
}
],
"returns": [
{
"desc": "",
"lua_type": "Promise<T>"
}
],
"function_type": "method",
"source": {
"line": 392,
"path": "src/promise/src/Shared/Promise.lua"
}
},
{
"name": "Tap",
"desc": "Like then, but the value passed down the chain is the resolved value of the promise, not\nthe value returned from onFulfilled or onRejected\n\nWill still yield for the result if a promise is returned, but will discard the result.",
"params": [
{
"name": "onFulfilled",
"desc": "",
"lua_type": "function"
},
{
"name": "onRejected",
"desc": "",
"lua_type": "function"
}
],
"returns": [
{
"desc": "Returns self",
"lua_type": "Promise<T>"
}
],
"function_type": "method",
"source": {
"line": 416,
"path": "src/promise/src/Shared/Promise.lua"
}
},
{
"name": "Finally",
"desc": "Executes upon pending stop",
"params": [
{
"name": "func",
"desc": "",
"lua_type": "function"
}
],
"returns": [
{
"desc": "",
"lua_type": "Promise<T>"
}
],
"function_type": "method",
"source": {
"line": 448,
"path": "src/promise/src/Shared/Promise.lua"
}
},
{
"name": "Catch",
"desc": "Catch errors from the promise",
"params": [
{
"name": "onRejected",
"desc": "",
"lua_type": "function"
}
],
"returns": [
{
"desc": "",
"lua_type": "Promise<T>"
}
],
"function_type": "method",
"source": {
"line": 458,
"path": "src/promise/src/Shared/Promise.lua"
}
},
{
"name": "Destroy",
"desc": "Rejects the current promise. Utility left for Maid task",
"params": [],
"returns": [],
"function_type": "method",
"source": {
"line": 466,
"path": "src/promise/src/Shared/Promise.lua"
}
},
{
"name": "GetResults",
"desc": "Returns the results from the promise.\n\n:::warning\nThis API surface will error if the promise is still pending.\n:::",
"params": [],
"returns": [
{
"desc": "true if resolved, false otherwise.",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "any"
}
],
"function_type": "method",
"source": {
"line": 480,
"path": "src/promise/src/Shared/Promise.lua"
}
},
{
"name": "_executeThen",
"desc": "",
"params": [
{
"name": "onFulfilled",
"desc": "",
"lua_type": "function?"
},
{
"name": "onRejected",
"desc": "",
"lua_type": "function?"
},
{
"name": "promise2",
"desc": "May be nil. If it is, then we have the option to return self",
"lua_type": "Promise<T>?"
}
],
"returns": [
{
"desc": "",
"lua_type": "Promise"
}
],
"function_type": "method",
"private": true,
"source": {
"line": 506,
"path": "src/promise/src/Shared/Promise.lua"
}
}
],
"properties": [],
"types": [],
"name": "Promise",
"desc": "Promises, but without error handling as this screws with stack traces, using Roblox signals\n\nSee: https://promisesaplus.com/",
"source": {
"line": 8,
"path": "src/promise/src/Shared/Promise.lua"
}
}