portfree
Version:
A cross-platform CLI tool for managing processes running on specific ports
52 lines • 1.37 kB
TypeScript
/**
* Process data model representing a system process running on a port
*/
export interface ProcessOptions {
pid: number;
name: string;
user: string;
protocol: 'TCP' | 'UDP';
port: number;
command?: string;
}
export declare class Process {
readonly pid: number;
readonly name: string;
readonly user: string;
readonly protocol: 'TCP' | 'UDP';
readonly port: number;
readonly command: string;
/**
* Create a Process instance
* @param options - Process options
*/
constructor({ pid, name, user, protocol, port, command }: ProcessOptions);
/**
* Validate process data
* @private
*/
private _validate;
/**
* Convert process to plain object
* @returns Plain object representation
*/
toObject(): ProcessOptions;
/**
* Convert process to JSON string
* @returns JSON representation
*/
toJSON(): string;
/**
* Create Process instance from plain object
* @param obj - Plain object with process data
* @returns Process instance
*/
static fromObject(obj: ProcessOptions): Process;
/**
* Create Process instance from JSON string
* @param json - JSON string with process data
* @returns Process instance
*/
static fromJSON(json: string): Process;
}
//# sourceMappingURL=process.d.ts.map