Skip to main content

MacroFieldType

A data structure to define the different types of macro fields.

Properties

Name

MacroFieldType.Name: string

The string that should be referenced inside a MacroDefinition for a MacroField's MacroFieldType

Socket comes with the following types:

"string"|"number"|"boolean"|"Color3"|"Vector3"

There is currently no support for adding new types (unless you fork the repo and develop your own)

Icon

MacroFieldType.Icon: string

A small string/emoji

Functions

Validate

MacroFieldType.Validate(valuestring) → any | nil

Takes an input value, and returns a type-safe version. Can return nil if there is nothing we can do with it.

ToString

MacroFieldType.ToString(valueany) → string

Takes a type-safe value, and returns it as a string that can be put into the field TextBox on the UI.

Show raw api
{
    "functions": [
        {
            "name": "Validate",
            "desc": "Takes an input value, and returns a type-safe version. Can return nil if there is nothing we can do with it.",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "any|nil"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 90,
                "path": "docs_api/sub_definitions.lua"
            }
        },
        {
            "name": "ToString",
            "desc": "Takes a type-safe value, and returns it as a string that can be put into the field `TextBox` on the UI.",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 99,
                "path": "docs_api/sub_definitions.lua"
            }
        }
    ],
    "properties": [
        {
            "name": "Name",
            "desc": "The string that should be referenced inside a `MacroDefinition` for a `MacroField's` `MacroFieldType`\n\nSocket comes with the following types:\n```\n\"string\"|\"number\"|\"boolean\"|\"Color3\"|\"Vector3\"\n```\n\nThere is currently no support for adding new types (unless you fork the repo and develop your own)",
            "lua_type": "string",
            "source": {
                "line": 74,
                "path": "docs_api/sub_definitions.lua"
            }
        },
        {
            "name": "Icon",
            "desc": "A small string/emoji",
            "lua_type": "string",
            "source": {
                "line": 81,
                "path": "docs_api/sub_definitions.lua"
            }
        }
    ],
    "types": [],
    "name": "MacroFieldType",
    "desc": "A data structure to define the different types of macro fields.",
    "source": {
        "line": 60,
        "path": "docs_api/sub_definitions.lua"
    }
}