Mark files as containing only type definitions and metadata, not runtime code
Mark a file as containing only type definitions and metadata, not executable runtime code. Files marked with @meta are used for providing type information without affecting runtime behavior.
---@meta-- Define types that exist at runtime but not in source---@class string---@field len fun(self: string): number---@field sub fun(self: string, start: number, end?: number): string---@field find fun(self: string, pattern: string): number?, number?
---@meta _G---@param obj any Object to get type of---@return string Type namefunction type(obj) end---@param func function Function to call---@param ... any Arguments---@return boolean success, ...function pcall(func, ...) end---@param co thread Coroutine---@param ... any Values to pass---@return boolean success, ...function coroutine.resume(co, ...) end
---@meta love2d---@class lovelocal love = {}---@class love.graphicslove.graphics = {}---@param text string Text to draw---@param x number X position---@param y number Y positionfunction love.graphics.print(text, x, y) end---@param r number Red component (0-1)---@param g number Green component (0-1)---@param b number Blue component (0-1)---@param a? number Alpha component (0-1)function love.graphics.setColor(r, g, b, a) end---@param mode string Draw mode---@param ... number Coordinatesfunction love.graphics.polygon(mode, ...) end