@siredvin/typed-peripheral-ap 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.
@@ -0,0 +1,9 @@
1
+ local function __TS__New(target, ...)
2
+ local instance = setmetatable({}, target.prototype)
3
+ instance:____constructor(...)
4
+ return instance
5
+ end
6
+
7
+ return {
8
+ __TS__New = __TS__New
9
+ }
package/meBridge.lua ADDED
@@ -0,0 +1,11 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local __TS__New = ____lualib.__TS__New
3
+ local ____exports = {}
4
+ local ____typed_2Dperipheral_2Dbase = require("@siredvin/typed-peripheral-base")
5
+ local IPeripheralProvider = ____typed_2Dperipheral_2Dbase.IPeripheralProvider
6
+ ____exports.meBridgePeripheralProvider = __TS__New(
7
+ IPeripheralProvider,
8
+ "me_bridge",
9
+ function() return nil end
10
+ )
11
+ return ____exports
package/meBridge.ts ADDED
@@ -0,0 +1,40 @@
1
+ import { IPeripheralProvider } from "@siredvin/typed-peripheral-base";
2
+
3
+ export type APAE2Item = {
4
+ components: Array<any>;
5
+ count: number;
6
+ displayName: string;
7
+ fingerprint: string;
8
+ isCraftable: boolean;
9
+ maxStackSize: number;
10
+ name: string;
11
+ tags: Array<string>;
12
+ };
13
+
14
+ export type AE2Filter = {
15
+ name?: string;
16
+ components?: string | Map<String, any>;
17
+ fingerprint?: string;
18
+ count?: number;
19
+ };
20
+
21
+ /** @noSelf **/
22
+ export interface MEBridge extends IPeripheral {
23
+ getItem(
24
+ filter: AE2Filter
25
+ ): LuaMultiReturn<[APAE2Item, null]> | LuaMultiReturn<[null, string]>;
26
+ getItems(
27
+ filter?: AE2Filter
28
+ ):
29
+ | LuaMultiReturn<[Array<APAE2Item>, null]>
30
+ | LuaMultiReturn<[null, string]>;
31
+ exportItem(
32
+ filter: AE2Filter,
33
+ target: string
34
+ ): LuaMultiReturn<[number, null]> | LuaMultiReturn<[null, string]>;
35
+ }
36
+
37
+ export const meBridgePeripheralProvider = new IPeripheralProvider<MEBridge>(
38
+ "me_bridge",
39
+ () => null
40
+ );
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@siredvin/typed-peripheral-ap",
3
+ "version": "0.1.0",
4
+ "description": "Typed peripheral library for Advanced 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
+ },
28
+ "devDependencies": {
29
+ "typescript-to-lua": "*",
30
+ "typescript": "*"
31
+ },
32
+ "nx": {
33
+ "targets": {
34
+ "lint": {
35
+ "executor": "@nx/linter:eslint",
36
+ "outputs": [
37
+ "{options.outputFile}"
38
+ ],
39
+ "options": {
40
+ "lintFilePatterns": [
41
+ "packages/typed-peripheral/**/*.{ts,tsx,js,jsx}"
42
+ ]
43
+ }
44
+ },
45
+ "depcheck": {
46
+ "executor": "nx:run-commands",
47
+ "options": {
48
+ "command": "depcheck",
49
+ "cwd": "packages/typed-peripheral"
50
+ }
51
+ }
52
+ }
53
+ }
54
+ }