thelounge/src/types/models/network.d.ts

52 lines
1,021 B
TypeScript
Raw Normal View History

2022-05-03 08:16:34 +02:00
import NetworkClass from "../../models/network";
2022-05-03 03:32:20 +02:00
import {Client as IRCClient} from "irc-framework";
import {WebIRC} from "../config";
declare global {
export type Network = NetworkClass;
2022-05-02 07:56:38 +02:00
2022-05-03 03:32:20 +02:00
type NetworkIrcOptions = {
host: string;
port: number;
password: string;
nick: string;
username: string;
gecos: string;
tls: boolean;
rejectUnauthorized: boolean;
webirc: WebIRC;
client_certificate: ClientCertificate | null;
socks?: {
host: string;
port: number;
user: string;
pass: string;
};
sasl_mechanism?: string;
account?:
| {
account: string;
password: string;
}
| {};
};
2022-05-02 07:56:38 +02:00
2022-05-03 03:32:20 +02:00
type NonNullableIRCWithOptions = NonNullable<IRCClient & {options: NetworkIrcOptions}>;
2022-05-03 03:32:20 +02:00
type NetworkWithIrcFramework = Network & {
irc: NonNullable<Network["irc"]> & {
options: NonNullableIRCWithOptions;
};
};
2022-05-03 03:32:20 +02:00
type NetworkStatus = {
connected: boolean;
secure: boolean;
};
type IgnoreListItem = Hostmask & {
when?: number;
};
type IgnoreList = IgnoreListItem[];
}