UNPKG

clean-insights-sdk

Version:

A privacy-preserving measurement framework.

52 lines (51 loc) 2.05 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ConsentRequestUi = void 0; /** * Implement this to provide a UI which explains your campaigns. * * Questions you should answer to the user: * * - Why do you need these measurements? * - How long will they get collected? * - What might attackers learn from these numbers? * - How long will you store them on your servers? * - What are you going to do with these measurements? * - How will the user benefit from these measurements? */ var ConsentRequestUi = /** @class */ (function () { function ConsentRequestUi() { } /** * Will be called if it is necessary to ask the user for consent to a measurement campaign. * * @param {string} campaignId * The campaign identifier. * * @param {Campaign} campaign * The campaign configuration. * * @param {function(boolean)} complete * The callback which will store the consent or the denial of it. * @returns {string} HTML output to show to the user, in case the user needs to get asked for consent. */ ConsentRequestUi.prototype.showForCampaign = function (campaignId, campaign, complete) { throw new Error('Override `ConsentRequestUi#showForCampaign` in your subclass!'); }; /** * Will be called if it is necessary to ask the user for consent to record a * common feature while measuring a campaign. * * @param {Feature} feature * The feature to record. (e.g. user agent, locale) * * @param {function(boolean)} complete * The callback which will store the consent or the denial of it. * @returns {string} HTML output to show to the user, in case the user needs to get asked for consent. */ ConsentRequestUi.prototype.showForFeature = function (feature, complete) { throw new Error('Override `ConsentRequestUi#showForFeature` in your subclass!'); }; return ConsentRequestUi; }()); exports.ConsentRequestUi = ConsentRequestUi;