Socket
Socket
Sign inDemoInstall

birpc

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

birpc - npm Package Compare versions

Comparing version 0.0.0 to 0.0.1

21

dist/index.d.ts
declare type ArgumentsType<T> = T extends (...args: infer A) => any ? A : never;
declare type ReturnType<T> = T extends (...args: any) => infer R ? R : never;
interface BirpcOptions<S> {
interface BirpcOptions<Functions> {
/**
* Local functions implementation.
*/
functions: S;
functions: Functions;
/**

@@ -29,14 +29,17 @@ * Function to post raw message

}
interface BirpcReturn<RemoteFunctions> {
declare type BirpcFn<T> = {
/**
* Call a remote function and wait for the result.
* Call the remote function and wait for the result.
*/
call<T extends keyof RemoteFunctions>(method: T, ...args: ArgumentsType<RemoteFunctions[T]>): Promise<Awaited<ReturnType<RemoteFunctions[T]>>>;
(...args: ArgumentsType<T>): Promise<Awaited<ReturnType<T>>>;
/**
* Send events without waiting for response
* Send event without asking for response
*/
send<T extends keyof RemoteFunctions>(method: T, ...args: ArgumentsType<RemoteFunctions[T]>): void;
}
noReply(...args: ArgumentsType<T>): void;
};
declare type BirpcReturn<RemoteFunctions> = {
[K in keyof RemoteFunctions]: BirpcFn<RemoteFunctions[K]>;
};
declare function createBirpc<LocalFunctions = {}, RemoteFunctions = {}>({ functions, post, on, serialize, deserialize, }: BirpcOptions<LocalFunctions>): BirpcReturn<RemoteFunctions>;
export { ArgumentsType, BirpcOptions, BirpcReturn, ReturnType, createBirpc };
export { ArgumentsType, BirpcFn, BirpcOptions, BirpcReturn, ReturnType, createBirpc };
{
"name": "birpc",
"version": "0.0.0",
"version": "0.0.1",
"description": "Message based Two-way remote procedure call",

@@ -34,11 +34,2 @@ "keywords": [

],
"scripts": {
"build": "unbuild",
"dev": "unbuild --stub",
"lint": "eslint --ext .js,.ts .",
"prepublishOnly": "nr build",
"release": "bumpp --commit --push --tag && pnpm publish",
"start": "esno src/index.ts",
"test": "vitest"
},
"devDependencies": {

@@ -55,3 +46,11 @@ "@antfu/eslint-config": "^0.14.0",

"vite": "^2.7.3"
},
"scripts": {
"build": "unbuild",
"dev": "unbuild --stub",
"lint": "eslint --ext .js,.ts .",
"release": "bumpp --commit --push --tag && pnpm publish",
"start": "esno src/index.ts",
"test": "vitest"
}
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc