Skip to main content

textServiceUtil

Wrapper for TextService.

Functions

filterStringForBroadcastPromise

textServiceUtil.filterStringForBroadcastPromise(
stringstring,
playerUserIdstring,
textFilterContextEnum.TextFilterContext
) → Promise<string>

Returns a promise which is resolved with the filtered string, to be displayed to all users.

filterStringForUserPromise

textServiceUtil.filterStringForUserPromise(
stringstring,
playerUserIdstring,
textFilterContextEnum.TextFilterContext
) → Promise<string>

Returns a promise which is resolved with the given string filtered in a manner appropriate for the passed user.

filterStringForUserChatPromise

textServiceUtil.filterStringForUserChatPromise(
stringstring,
playerUserIdstring,
textFilterContextEnum.TextFilterContext
) → Promise<string>

Returns a promise which is resolved with the string filtered in the least restrictive manner appropriate for the given user.

familyInfoPromise

textServiceUtil.familyInfoPromise(assetIdstring) → Promise<{FaceInfoFaceInfo}>

Wraps TextService:GetFamilyInfoAsync into a promise.

textSizeOffsetPromise

textServiceUtil.textSizeOffsetPromise(
fontSizenumber,
fontEnum.Font
) → Promise<Vector2>

Wraps TextService:GetTextSizeOffsetAsync into a promise.

textBoundsPromise

textServiceUtil.textBoundsPromise(paramsGetTextBoundsParams) → Promise<Vector2>

Wraps TextService:GetTextBoundsAsync into a promise.

filterAndTranslateStringPromise

textServiceUtil.filterAndTranslateStringPromise(
stringToFilterstring,
fromUserIdnumber,
targetLocales{},
textContextEnum.TextFilterContext
) → Promise<TextFilterTranslatedResult>
Show raw api
{
    "functions": [
        {
            "name": "filterStringForBroadcastPromise",
            "desc": "Returns a [promise](https://eryn.io/roblox-lua-promise/) which is resolved with the filtered\nstring, to be displayed to all users.",
            "params": [
                {
                    "name": "string",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "playerUserId",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "textFilterContext",
                    "desc": "",
                    "lua_type": "Enum.TextFilterContext\n"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<string>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 19,
                "path": "src/textServiceUtil/init.luau"
            }
        },
        {
            "name": "filterStringForUserPromise",
            "desc": "Returns a [promise](https://eryn.io/roblox-lua-promise/) which is resolved with the\ngiven string filtered in a manner appropriate for the passed user.",
            "params": [
                {
                    "name": "string",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "playerUserId",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "textFilterContext",
                    "desc": "",
                    "lua_type": "Enum.TextFilterContext\n"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<string>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 38,
                "path": "src/textServiceUtil/init.luau"
            }
        },
        {
            "name": "filterStringForUserChatPromise",
            "desc": "Returns a [promise](https://eryn.io/roblox-lua-promise/) which is resolved with the \nstring filtered in the **least** restrictive manner appropriate for the given user.",
            "params": [
                {
                    "name": "string",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "playerUserId",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "textFilterContext",
                    "desc": "",
                    "lua_type": "Enum.TextFilterContext\n"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<string>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 57,
                "path": "src/textServiceUtil/init.luau"
            }
        },
        {
            "name": "familyInfoPromise",
            "desc": "Wraps [TextService:GetFamilyInfoAsync](https://create.roblox.com/docs/reference/engine/classes/TextService#GetFamilyInfoAsync) into a promise.",
            "params": [
                {
                    "name": "assetId",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<{FaceInfo: FaceInfo}>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 75,
                "path": "src/textServiceUtil/init.luau"
            }
        },
        {
            "name": "textSizeOffsetPromise",
            "desc": "Wraps [TextService:GetTextSizeOffsetAsync](https://create.roblox.com/docs/reference/engine/classes/TextService#GetTextSizeOffsetAsync) into a promise.",
            "params": [
                {
                    "name": "fontSize",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "font",
                    "desc": "",
                    "lua_type": "Enum.Font"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<Vector2>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 87,
                "path": "src/textServiceUtil/init.luau"
            }
        },
        {
            "name": "textBoundsPromise",
            "desc": "Wraps [TextService:GetTextBoundsAsync](https://create.roblox.com/docs/reference/engine/classes/TextService#GetTextBoundsAsync) into a promise.",
            "params": [
                {
                    "name": "params",
                    "desc": "",
                    "lua_type": "GetTextBoundsParams"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<Vector2>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 99,
                "path": "src/textServiceUtil/init.luau"
            }
        },
        {
            "name": "filterAndTranslateStringPromise",
            "desc": "Wraps [TextService:FilterAndTranslateStringAsync](https://create.roblox.com/docs/reference/engine/classes/TextService#FilterAndTranslateStringAsync) into a promise.",
            "params": [
                {
                    "name": "stringToFilter",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "fromUserId",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "targetLocales",
                    "desc": "",
                    "lua_type": "{}"
                },
                {
                    "name": "textContext",
                    "desc": "",
                    "lua_type": "Enum.TextFilterContext\n"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<TextFilterTranslatedResult>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 111,
                "path": "src/textServiceUtil/init.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "textServiceUtil",
    "desc": " \n\nWrapper for [TextService](https://create.roblox.com/docs/reference/engine/classes/TextService).",
    "source": {
        "line": 6,
        "path": "src/textServiceUtil/init.luau"
    }
}