serialize
Serialize any model that follows the structural Serializable contract. The returned value is checked at runtime so custom implementations cannot emit non-JSON data.
You are reading the v8 docsDev
FunctionTypeScript@discord-player/plugin-host
View sourcepackages/plugin-host/src/utils/serde.ts:37function serialize<T extends SerializedEntity<string, JSONValue>>(value: Serializable<T>): TSerialize any model that follows the structural Serializable contract.
The returned value is checked at runtime so custom implementations cannot emit non-JSON data.
Parameters
| Name | Type | Description |
|---|---|---|
| value | Serializable<T> | Model implementing the versioned serialization contract. |
Returns
T
Its JSON-safe persistence payload.