*Initial version
This commit is contained in:
parent
bffc58ccc1
commit
f0012ae8cb
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) <year> <copyright holders>
|
Copyright (c) 2022 Hammer Technologies LLC
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"name": "@lumeweb/rpc",
|
||||||
|
"type": "module",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"dependencies": {
|
||||||
|
"protomux-rpc": "^1.3.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/b4a": "^1.6.0"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
// @ts-ignore
|
||||||
|
import ProtomuxRPC from "protomux-rpc"
|
||||||
|
// @ts-ignore
|
||||||
|
import c from "compact-encoding"
|
||||||
|
import b4a from "b4a"
|
||||||
|
|
||||||
|
const ID = b4a.from("lumeweb")
|
||||||
|
|
||||||
|
export default class RPC extends ProtomuxRPC {
|
||||||
|
constructor(stream: any, options = {}) {
|
||||||
|
options = {
|
||||||
|
...{
|
||||||
|
id: ID,
|
||||||
|
valueEncoding: c.json
|
||||||
|
}, ...options
|
||||||
|
};
|
||||||
|
super(stream, options);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"declaration": true,
|
||||||
|
"strict": true,
|
||||||
|
"module": "esnext",
|
||||||
|
"target": "esnext",
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"sourceMap": false,
|
||||||
|
"rootDir": "src",
|
||||||
|
"outDir": "dist",
|
||||||
|
"typeRoots": [
|
||||||
|
"node_modules/@types",
|
||||||
|
],
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"declarationMap": true,
|
||||||
|
"declarationDir": "dist",
|
||||||
|
"emitDeclarationOnly": false,
|
||||||
|
"allowJs": true
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"src"
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in New Issue