-- Compiled with roblox-ts v1.2.7 local TS = _G[script] local Players = game:GetService("Players") local ZrPlayerScriptContext = TS.import(script, TS.getModule(script, "@rbxts", "zirconium").out.Runtime.PlayerScriptContext).default local ZirconEnum = TS.import(script, script.Parent.Parent, "Class", "ZirconEnum").ZirconEnum local ZirconFunction = TS.import(script, script.Parent.Parent, "Class", "ZirconFunction").ZirconFunction local ZirconClientStore = TS.import(script, script.Parent.Parent, "Client", "BuiltInConsole", "Store").default local ZirconClientRegistryService = {} do local _container = ZirconClientRegistryService local globals = {} local initialized = false --[[ * * Creates a scripting environment on the client for Zircon. * * NOTE: This is 100% insecure because it's on the client, and thus shouldn't use any elevated functions * (WIP client) * @param configuration * @hidden @deprecated ]] local function Init(configuration) for _, global in ipairs(configuration.Registry) do -- ▼ Array.push ▼ globals[#globals + 1] = global -- ▲ Array.push ▲ end initialized = true if #globals > 0 then ZirconClientStore:dispatch({ type = "SetClientExecutionEnabled", enabled = true, }) end end _container.Init = Init -- * @internal local function GetScriptContextsForLocalPlayer() local context = ZrPlayerScriptContext.new(Players.LocalPlayer) for _, global in ipairs(globals) do if TS.instanceof(global, ZirconFunction) then context:registerGlobal(global:GetName(), global) elseif TS.instanceof(global, ZirconEnum) then context:registerGlobal(global:getEnumName(), global) end end return context end _container.GetScriptContextsForLocalPlayer = GetScriptContextsForLocalPlayer end return { ZirconClientRegistryService = ZirconClientRegistryService, }