Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

typealias libtmux-ts latest

LibTmuxErrorCode

Every value LibTmuxError.code can hold.

Source and package
Qualified name
LibTmuxErrorCode
Module
errors
Package
libtmux
Source
packages/libtmux/src/errors.ts
type errors.LibTmuxErrorCode = | "FormatProtocolError" | "LibTmuxError" | "MultipleMatchesError" | "MultipleObjectsError" | "NoMatchError" | "ObjectNotFoundError" | "QueryValidationError" | "TmuxCommandError" | "TmuxObjectNotFoundError" | "TmuxServerRestartedError" | "TmuxTransportError" | "VersionTooLowError" | "WaitTimeoutError"

Description#

A union rather than string so a comparison against a name this package does not have is a type error rather than a branch that never runs.

Each class declares this type rather than its own literal because the hierarchy is three deep in places — NoMatchError extends ObjectNotFoundError — and a literal on the parent makes the child's declaration an illegal override. instanceof is the narrowing tool; this is the one that survives a bundler and a serialization round trip.

Esc

Type to search.

Reference previewOpen reference