diff --git a/rOSs.lua b/rOSs.lua index e2ddb59..3103572 100644 --- a/rOSs.lua +++ b/rOSs.lua @@ -38,16 +38,18 @@ return { local ____lualib = require("lualib_bundle") local __TS__Class = ____lualib.__TS__Class local ____exports = {} +--- +-- @noSelf * ____exports.Peripheral = __TS__Class() local Peripheral = ____exports.Peripheral Peripheral.name = "Peripheral" function Peripheral.prototype.____constructor(self) end -function Peripheral.find(self, ty, filter) +function Peripheral.find(ty, filter) return peripheral.find(ty, filter) end -function Peripheral.findOne(self, ty, filter) - local p, _a, _b, _c = table.unpack(____exports.Peripheral:find(ty, filter)) +function Peripheral.findOne(ty, filter) + local p, _a, _b, _c = table.unpack(____exports.Peripheral.find(ty, filter)) return p end return ____exports @@ -60,7 +62,7 @@ local basalt = ____basalt.default local ____computercraft = require("src.computercraft") local Peripheral = ____computercraft.Peripheral local function main(self) - local d = table.unpack(Peripheral:findOne("monitor")) + local d = Peripheral.findOne("monitor") local main = basalt.addMonitor() main:setMonitor(d) main:addLabel():setText("uwu") diff --git a/src/computercraft.ts b/src/computercraft.ts index 79b9137..1b7bf98 100644 --- a/src/computercraft.ts +++ b/src/computercraft.ts @@ -1,4 +1,5 @@ +/** @noSelf **/ export class Peripheral { static find(ty: string, filter?: (name: string, wrapped: Peripheral) => boolean diff --git a/src/index.ts b/src/index.ts index 21815ad..9150ff7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,8 +3,7 @@ import {Peripheral } from "./computercraft"; function main() { - const [d]: [Monitor] = Peripheral.findOne("monitor"); - + const d: Monitor = Peripheral.findOne("monitor"); const main = basalt.addMonitor(); main.setMonitor(d);