Files
smartipc/ts/index.ts

40 lines
1.1 KiB
TypeScript
Raw Permalink Normal View History

export * from './classes.transports.js';
export * from './classes.ipcchannel.js';
export * from './classes.ipcserver.js';
export * from './classes.ipcclient.js';
import { IpcServer } from './classes.ipcserver.js';
import { IpcClient } from './classes.ipcclient.js';
import { IpcChannel } from './classes.ipcchannel.js';
import type { IIpcServerOptions } from './classes.ipcserver.js';
import type { IIpcClientOptions } from './classes.ipcclient.js';
import type { IIpcChannelOptions } from './classes.ipcchannel.js';
/**
* Main SmartIpc class - Factory for creating IPC servers, clients, and channels
*/
2019-04-08 19:42:23 +02:00
export class SmartIpc {
/**
* Create an IPC server
2019-04-08 19:42:23 +02:00
*/
public static createServer(options: IIpcServerOptions): IpcServer {
return new IpcServer(options);
2019-04-08 19:42:23 +02:00
}
/**
* Create an IPC client
2019-04-08 19:42:23 +02:00
*/
public static createClient(options: IIpcClientOptions): IpcClient {
return new IpcClient(options);
2019-04-08 19:42:23 +02:00
}
2019-04-08 19:56:21 +02:00
2019-04-09 12:30:12 +02:00
/**
* Create a raw IPC channel (for advanced use cases)
2019-04-09 12:30:12 +02:00
*/
public static createChannel(options: IIpcChannelOptions): IpcChannel {
return new IpcChannel(options);
2019-04-08 19:56:21 +02:00
}
2019-04-08 19:42:23 +02:00
}
// Export the main class as default
export default SmartIpc;