UNPKG

@iabtechlabtcf/core

Version:

Ensures consistent encoding and decoding of TC Signals for the iab. Transparency and Consent Framework (TCF).

28 lines (27 loc) 1.08 kB
import { EncodingOptions } from './encoder/index.js'; import { TCModel } from './TCModel.js'; /** * Main class for encoding and decoding a * TCF Transparency and Consent String */ export declare class TCString { /** * encodes a model into a TCString * * @param {TCModel} tcModel - model to convert into encoded string * @param {EncodingOptions} options - for encoding options other than default * @return {string} - base64url encoded Transparency and Consent String */ static encode(tcModel: TCModel, options?: EncodingOptions): string; /** * Decodes a string into a TCModel * * @param {string} encodedTCString - base64url encoded Transparency and * Consent String to decode - can also be a single or group of segments of * the string * @param {string} [tcModel] - model to enhance with the information. If * none is passed a new instance of TCModel will be created. * @return {TCModel} - Returns populated TCModel */ static decode(encodedTCString: string, tcModel?: TCModel): TCModel; }