@4players/odin
Version:
A cross-platform SDK enabling developers to integrate real-time VoIP chat technology into their projects
23 lines (22 loc) • 742 B
TypeScript
/**
* Convenience type used when converting JSON data to byte arrays.
*/
export type JsonValue = string | number | boolean | null | JsonValue[] | {
[key: string]: JsonValue;
};
export declare function toRaw<T extends JsonValue>(value: T): T;
export declare function parseJwt(token: string): unknown;
/**
* Encodes a value or an object with the help of JSON.stringify to an Uint8Array.
*
* @param value Value or object to encode
* @returns The Uint8Array encoded value
*/
export declare function valueToUint8Array(value: any): Uint8Array;
/**
* Decodes a Uint8Array.
*
* @param bytes Byte array to decode
* @returns The decoded value or undefined on error
*/
export declare function uint8ArrayToValue<T>(bytes: Uint8Array): T;