Files
NapCatQQ/.pnpm-store/v3/files/8e/2461f4ca03bf697ca35a24e325cd495bd97250146328a7e4cc41f41fdc35d1cd3f16349e2e95e910652b51584913200d69af677e7a175af26cc59acbcd5fbf
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

29 lines
1.2 KiB
Plaintext

/**
* A runtime-agnostic collection of methods for working with CBOR encoding
* @module
*/
import * as tinyCbor from '@levischuck/tiny-cbor';
import type { Uint8Array_ } from '../../types/index.js';
/**
* Whatever CBOR encoder is used should keep CBOR data the same length when data is re-encoded
*
* MOST CRITICALLY, this means the following needs to be true of whatever CBOR library we use:
* - CBOR Map type values MUST decode to JavaScript Maps
* - CBOR tag 64 (uint8 Typed Array) MUST NOT be used when encoding Uint8Arrays back to CBOR
*
* So long as these requirements are maintained, then CBOR sequences can be encoded and decoded
* freely while maintaining their lengths for the most accurate pointer movement across them.
*/
/**
* Decode and return the first item in a sequence of CBOR-encoded values
*
* @param input The CBOR data to decode
* @param asObject (optional) Whether to convert any CBOR Maps into JavaScript Objects. Defaults to
* `false`
*/
export declare function decodeFirst<Type>(input: Uint8Array_): Type;
/**
* Encode data to CBOR
*/
export declare function encode(input: tinyCbor.CBORType): Uint8Array_;
//# sourceMappingURL=isoCBOR.d.ts.map