Files
smartipc/ts/index.ts

40 lines
1.1 KiB
TypeScript

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
*/
export class SmartIpc {
/**
* Create an IPC server
*/
public static createServer(options: IIpcServerOptions): IpcServer {
return new IpcServer(options);
}
/**
* Create an IPC client
*/
public static createClient(options: IIpcClientOptions): IpcClient {
return new IpcClient(options);
}
/**
* Create a raw IPC channel (for advanced use cases)
*/
public static createChannel(options: IIpcChannelOptions): IpcChannel {
return new IpcChannel(options);
}
}
// Export the main class as default
export default SmartIpc;