import type {Subscription} from './lib/inter.js'; export type Uint = number; export type MatchData = [boolean, string]; export type ListItem = [string, [Uint, Uint, string, boolean, string, ...MatchData[]][], [Uint, string, string[], string, Record, Uint, string, UserID | null, ...MatchData[]][]]; type List = ListItem[]; export type Match = { isSuffix: boolean; name: string; } type Redirect = NameID & { from: Uint; to: string; match: Match[]; } export type UserID = { uid: Uint; gid: Uint; } type Command = NameID & { exe: string; params: string[]; workDir: string; env: Record; match: Match[]; user?: UserID; } type NameID = { server: string; id: Uint; } export type RPC = { waitList: () => Subscription; waitAdd: () => Subscription; waitRename: () => Subscription<[string, string]>; waitRemove: () => Subscription; waitAddRedirect: () => Subscription; waitAddCommand: () => Subscription; waitModifyRedirect: () => Subscription; waitModifyCommand: () => Subscription; waitRemoveRedirect: () => Subscription; waitRemoveCommand: () => Subscription; waitStartRedirect: () => Subscription; waitStartCommand: () => Subscription; waitStopRedirect: () => Subscription; waitStopCommand: () => Subscription; waitCommandStopped: () => Subscription<[string, Uint]>; waitCommandError: () => Subscription; add: (name: string) => Promise; rename: (data: [string, string]) => Promise; remove: (name: string) => Promise; addRedirect: (data: Omit) => Promise; addCommand: (data: Omit) => Promise; modifyRedirect: (data: Redirect) => Promise; modifyCommand: (data: Command) => Promise; removeRedirect: (redirect: NameID) => Promise; removeCommand: (command: NameID) => Promise; startRedirect: (redirect: NameID) => Promise; startCommand: (command: NameID) => Promise; stopRedirect: (redirect: NameID) => Promise; stopCommand: (command: NameID) => Promise; getCommandPorts: (command: NameID) => Promise; }