Discord Player

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:37
function serialize<T extends SerializedEntity<string, JSONValue>>(value: Serializable<T>): T

Serialize any model that follows the structural Serializable contract. The returned value is checked at runtime so custom implementations cannot emit non-JSON data.

Parameters

NameTypeDescription
valueSerializable<T>

Model implementing the versioned serialization contract.

Returns

T

Its JSON-safe persistence payload.