f
isData(reply: Reply): reply is DataReply
Checks if a reply is a data reply
f
isDone(reply: Reply): reply is DoneReply
Checks if a reply is a done reply
f
isFatal(reply: Reply): reply is FatalReply
Checks if a reply is a fatal reply
f
isTrap(reply: Reply): reply is TrapReply
Checks if a reply is a trap (error) reply
f
parseReply(words: string[]): Reply
Parses a reply sentence into a structured Reply object
T
DataReply = { type: "re"; attributes: Record<string, string>; }
Data reply (!re)
-
attributes: Record<string, string>
Attributes containing the reply data
-
type: "re"
Reply type discriminator
T
DoneReply = { type: "done"; attributes?: Record<string, string>; }
Done reply (!done)
-
attributes: Record<string, string>
Optional attributes returned with the done reply
-
type: "done"
Reply type discriminator
T
FatalReply = { type: "fatal"; message: string; }
Fatal reply (!fatal)
-
message: string
Human-readable error message
-
type: "fatal"
Reply type discriminator
T
Reply = DoneReply | DataReply | TrapReply | FatalReply
Union of all possible reply types
T
TrapReply = { type: "trap"; message: string; category?: number; attributes?: Record<string, string>; }
Trap reply (!trap)
-
attributes: Record<string, string>
Optional additional attributes
-
category: number
Optional numeric error category
-
message: string
Human-readable error message
-
type: "trap"
Reply type discriminator
Usage
import * as mod from "protocol/reply.ts";