Show raw api
{
"functions": [
{
"name": "new",
"desc": "Constructs a new setting definition which defines the name and the defaultValue",
"params": [
{
"name": "settingName",
"desc": "",
"lua_type": "string"
},
{
"name": "defaultValue",
"desc": "",
"lua_type": "T"
}
],
"returns": [
{
"desc": "",
"lua_type": "SettingDefinition<T>"
}
],
"function_type": "static",
"source": {
"line": 43,
"path": "src/settings/src/Shared/Setting/SettingDefinition.lua"
}
},
{
"name": "Init",
"desc": "Initializes the setting definition from a service bag.",
"params": [
{
"name": "serviceBag",
"desc": "",
"lua_type": "ServiceBag"
}
],
"returns": [],
"function_type": "method",
"source": {
"line": 62,
"path": "src/settings/src/Shared/Setting/SettingDefinition.lua"
}
},
{
"name": "Get",
"desc": "Gets the value for the given player",
"params": [
{
"name": "player",
"desc": "",
"lua_type": "Player"
}
],
"returns": [
{
"desc": "",
"lua_type": "T"
}
],
"function_type": "method",
"source": {
"line": 79,
"path": "src/settings/src/Shared/Setting/SettingDefinition.lua"
}
},
{
"name": "Set",
"desc": "Sets the value",
"params": [
{
"name": "player",
"desc": "",
"lua_type": "Player"
},
{
"name": "value",
"desc": "",
"lua_type": "T"
}
],
"returns": [],
"function_type": "method",
"source": {
"line": 92,
"path": "src/settings/src/Shared/Setting/SettingDefinition.lua"
}
},
{
"name": "Promise",
"desc": "Promise gets the value",
"params": [
{
"name": "player",
"desc": "",
"lua_type": "Player"
}
],
"returns": [
{
"desc": "",
"lua_type": "Promise<T>"
}
],
"function_type": "method",
"source": {
"line": 105,
"path": "src/settings/src/Shared/Setting/SettingDefinition.lua"
}
},
{
"name": "PromiseSet",
"desc": "Promise gets the value",
"params": [
{
"name": "player",
"desc": "",
"lua_type": "Player"
},
{
"name": "value",
"desc": "",
"lua_type": "T"
}
],
"returns": [
{
"desc": "",
"lua_type": "Promise<T>"
}
],
"function_type": "method",
"source": {
"line": 119,
"path": "src/settings/src/Shared/Setting/SettingDefinition.lua"
}
},
{
"name": "Observe",
"desc": "Promise gets the value",
"params": [
{
"name": "player",
"desc": "",
"lua_type": "Player"
}
],
"returns": [
{
"desc": "",
"lua_type": "Promise<T>"
}
],
"function_type": "method",
"source": {
"line": 132,
"path": "src/settings/src/Shared/Setting/SettingDefinition.lua"
}
},
{
"name": "isSettingDefinition",
"desc": "Returns true if the value is a setting definition",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
}
],
"function_type": "static",
"source": {
"line": 145,
"path": "src/settings/src/Shared/Setting/SettingDefinition.lua"
}
},
{
"name": "GetSettingProperty",
"desc": "Gets a new setting property for the given definition",
"params": [
{
"name": "serviceBag",
"desc": "",
"lua_type": "ServiceBag"
},
{
"name": "player",
"desc": "",
"lua_type": "Player"
}
],
"returns": [
{
"desc": "",
"lua_type": "SettingProperty<T>"
}
],
"function_type": "method",
"source": {
"line": 156,
"path": "src/settings/src/Shared/Setting/SettingDefinition.lua"
}
},
{
"name": "GetLocalPlayerSettingProperty",
"desc": "Gets a new setting property for the given definition",
"params": [
{
"name": "serviceBag",
"desc": "",
"lua_type": "ServiceBag"
}
],
"returns": [
{
"desc": "",
"lua_type": "SettingProperty<T>"
}
],
"function_type": "method",
"source": {
"line": 171,
"path": "src/settings/src/Shared/Setting/SettingDefinition.lua"
}
},
{
"name": "GetSettingName",
"desc": "Retrieves the default name of the setting",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "string"
}
],
"function_type": "method",
"source": {
"line": 181,
"path": "src/settings/src/Shared/Setting/SettingDefinition.lua"
}
},
{
"name": "GetDefaultValue",
"desc": "Retrieves the default value for the setting",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "T"
}
],
"function_type": "method",
"source": {
"line": 189,
"path": "src/settings/src/Shared/Setting/SettingDefinition.lua"
}
}
],
"properties": [],
"types": [],
"name": "SettingDefinition",
"desc": "These settings definitions are used to define a setting and register them on both the client and server. See\n[SettingDefinitionProvider] for more details on grouping these.\n\nNotably a setting is basically anything on the client that can be stored on the server by the client, and that\nrelatively minimal validation is required upon. This can be both user-set settings, as well as very temporary\ndata.\n\n```lua\nlocal SettingDefinition = require(\"SettingDefinition\")\n\nreturn require(\"SettingDefinitionProvider\").new({\n\tLastTimeUpdateSeen = 0;\n\tLastTimeShopSeen = 0;\n})\n```",
"source": {
"line": 20,
"path": "src/settings/src/Shared/Setting/SettingDefinition.lua"
}
}