irctokens
Version:
RFC1459 and IRCv3 protocol tokeniser
22 lines (21 loc) • 652 B
TypeScript
import { Hostmask } from './hostmask';
import type { TextEncodingLabel } from '.';
export interface LineArgs {
tags?: Record<string, string>;
source?: string;
command: string;
params: string[];
}
export declare class Line {
#private;
tags?: Record<string, string>;
source?: string;
command: string;
params: string[];
constructor({ tags, source, command, params }: LineArgs);
get hostmask(): Hostmask;
format(): string;
withSource(source: string): Line;
copy(): Line;
}
export declare function tokenise(line: string | Uint8Array, encoding?: TextEncodingLabel, fallback?: TextEncodingLabel): Line;