Skip to main content

Manifest

Types

ShardInfo

interface ShardInfo {
shardCountnumber
keySuffixstring
hashstring
}

Manifest

interface Manifest {
maxItemsnumber
shardInfoShardInfo
shards{[string]string}
}

Functions

GetShardKey

Manifest.GetShardKey(
boardKeystring,
shardIndexnumber
) → string

Generates a shard key in the format "{boardKey}:shard"

CalculateShardCount

Manifest.CalculateShardCount(maxRecordsnumber) → number

Calculates the recommended shard count based on max records. Warns if maxRecords exceeds 100,000 or if shardCount > 16 is recommended.

CreateManifest

Manifest.CreateManifest(
boardKeystring,
shardCountnumber,
maxItemsnumber
) → Manifest

Creates a new manifest with the specified parameters.

LoadOrCreate

Manifest.LoadOrCreate(
boardKeystring,
shardCountnumber,
maxItemsnumber
) → (
number
)

Loads or creates a manifest for the given boardKey. Returns the manifest (if created/loaded) and the validated shardCount. If manifest exists but shardCount differs, warns and returns existing shardCount.

Show raw api
{
    "functions": [
        {
            "name": "GetShardKey",
            "desc": "Generates a shard key in the format \"{boardKey}:shard{shardIndex}\"",
            "params": [
                {
                    "name": "boardKey",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "shardIndex",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 60,
                "path": "lib/Leaderboard/Board/Manifest.luau"
            }
        },
        {
            "name": "CalculateShardCount",
            "desc": "Calculates the recommended shard count based on max records.\nWarns if maxRecords exceeds 100,000 or if shardCount > 16 is recommended.",
            "params": [
                {
                    "name": "maxRecords",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 72,
                "path": "lib/Leaderboard/Board/Manifest.luau"
            }
        },
        {
            "name": "CreateManifest",
            "desc": "Creates a new manifest with the specified parameters.",
            "params": [
                {
                    "name": "boardKey",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "shardCount",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "maxItems",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Manifest"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 101,
                "path": "lib/Leaderboard/Board/Manifest.luau"
            }
        },
        {
            "name": "LoadOrCreate",
            "desc": "Loads or creates a manifest for the given boardKey.\nReturns the manifest (if created/loaded) and the validated shardCount.\nIf manifest exists but shardCount differs, warns and returns existing shardCount.",
            "params": [
                {
                    "name": "boardKey",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "shardCount",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "maxItems",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "(Manifest?, number)"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 129,
                "path": "lib/Leaderboard/Board/Manifest.luau"
            }
        }
    ],
    "properties": [],
    "types": [
        {
            "name": "ShardInfo",
            "desc": "",
            "fields": [
                {
                    "name": "shardCount",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "keySuffix",
                    "lua_type": "string",
                    "desc": ""
                },
                {
                    "name": "hash",
                    "lua_type": "string",
                    "desc": ""
                }
            ],
            "source": {
                "line": 30,
                "path": "lib/Leaderboard/Board/Manifest.luau"
            }
        },
        {
            "name": "Manifest",
            "desc": "",
            "fields": [
                {
                    "name": "maxItems",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "shardInfo",
                    "lua_type": "ShardInfo",
                    "desc": ""
                },
                {
                    "name": "shards",
                    "lua_type": "{[string]: string}",
                    "desc": ""
                }
            ],
            "source": {
                "line": 43,
                "path": "lib/Leaderboard/Board/Manifest.luau"
            }
        }
    ],
    "name": "Manifest",
    "desc": "",
    "source": {
        "line": 50,
        "path": "lib/Leaderboard/Board/Manifest.luau"
    }
}