@siredvin/typed-peripheral-turtlematic 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lualib_bundle.lua +43 -0
- package/package.json +55 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
local function __TS__New(target, ...)
|
|
2
|
+
local instance = setmetatable({}, target.prototype)
|
|
3
|
+
instance:____constructor(...)
|
|
4
|
+
return instance
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
local function __TS__Class(self)
|
|
8
|
+
local c = {prototype = {}}
|
|
9
|
+
c.prototype.__index = c.prototype
|
|
10
|
+
c.prototype.constructor = c
|
|
11
|
+
return c
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
local function __TS__ClassExtends(target, base)
|
|
15
|
+
target.____super = base
|
|
16
|
+
local staticMetatable = setmetatable({__index = base}, base)
|
|
17
|
+
setmetatable(target, staticMetatable)
|
|
18
|
+
local baseMetatable = getmetatable(base)
|
|
19
|
+
if baseMetatable then
|
|
20
|
+
if type(baseMetatable.__index) == "function" then
|
|
21
|
+
staticMetatable.__index = baseMetatable.__index
|
|
22
|
+
end
|
|
23
|
+
if type(baseMetatable.__newindex) == "function" then
|
|
24
|
+
staticMetatable.__newindex = baseMetatable.__newindex
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
setmetatable(target.prototype, base.prototype)
|
|
28
|
+
if type(base.prototype.__index) == "function" then
|
|
29
|
+
target.prototype.__index = base.prototype.__index
|
|
30
|
+
end
|
|
31
|
+
if type(base.prototype.__newindex) == "function" then
|
|
32
|
+
target.prototype.__newindex = base.prototype.__newindex
|
|
33
|
+
end
|
|
34
|
+
if type(base.prototype.__tostring) == "function" then
|
|
35
|
+
target.prototype.__tostring = base.prototype.__tostring
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
return {
|
|
40
|
+
__TS__New = __TS__New,
|
|
41
|
+
__TS__Class = __TS__Class,
|
|
42
|
+
__TS__ClassExtends = __TS__ClassExtends
|
|
43
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@siredvin/typed-peripheral-turtlematic",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Typed peripheral library for Turtlematic peripherals",
|
|
5
|
+
"files": [
|
|
6
|
+
"./*.ts",
|
|
7
|
+
"./*.lua"
|
|
8
|
+
],
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"access": "public"
|
|
11
|
+
},
|
|
12
|
+
"author": "SirEdvin",
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"scripts": {
|
|
15
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
16
|
+
"build": "tstl",
|
|
17
|
+
"clean": "rm -f *.lua",
|
|
18
|
+
"lint": "eslint . --ext .ts,.js",
|
|
19
|
+
"depcheck": "depcheck"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@siredvin/cc-types": "1.1.0",
|
|
23
|
+
"@siredvin/craftos-types": "1.2.0",
|
|
24
|
+
"@siredvin/api-types": "1.1.0",
|
|
25
|
+
"@jackmacwindows/lua-types": "^2.13.1",
|
|
26
|
+
"@siredvin/typed-peripheral-base": "0.4.0",
|
|
27
|
+
"@siredvin/typed-peripheral-api": "0.1.0"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"typescript-to-lua": "*",
|
|
31
|
+
"typescript": "*"
|
|
32
|
+
},
|
|
33
|
+
"nx": {
|
|
34
|
+
"targets": {
|
|
35
|
+
"lint": {
|
|
36
|
+
"executor": "@nx/linter:eslint",
|
|
37
|
+
"outputs": [
|
|
38
|
+
"{options.outputFile}"
|
|
39
|
+
],
|
|
40
|
+
"options": {
|
|
41
|
+
"lintFilePatterns": [
|
|
42
|
+
"packages/typed-peripheral/**/*.{ts,tsx,js,jsx}"
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"depcheck": {
|
|
47
|
+
"executor": "nx:run-commands",
|
|
48
|
+
"options": {
|
|
49
|
+
"command": "depcheck",
|
|
50
|
+
"cwd": "packages/typed-peripheral"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|