Graphorin API reference v0.1.0
Graphorin API reference / @graphorin/protocol / close-codes
close-codes
Custom WebSocket close-code taxonomy used by @graphorin/server and @graphorin/client. The numeric values live in the 4xxx application-private range per RFC 6455 § 7.4.
Type Aliases
| Type Alias | Description |
|---|---|
| GraphorinCloseReason | Discriminator for every Graphorin-defined close code. The matching numeric value is exposed via CLOSE_CODE_VALUES. |
Variables
| Variable | Description |
|---|---|
| CLOSE_CODE_VALUES | Numeric close-code constants. The pair (value, reason) round-trips via closeCodeReason / closeCodeFor. |
Functions
| Function | Description |
|---|---|
| closeCodeFor | Return the numeric close code for a Graphorin reason discriminator. |
| closeCodeReason | Resolve a numeric close code back to its Graphorin reason discriminator. Returns undefined for codes outside the Graphorin range so callers can still surface the raw RFC 6455 reason for unrelated codes. |