diff --git a/dist/index.d.ts b/dist/index.d.ts index ddcfcee..464aecb 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -11,9 +11,13 @@ declare const _default: { [key: string]: string | number | boolean; }) => boolean; disable: () => boolean; - consentForms: (consent: string | false) => boolean; - consentIP: (consent: string | false) => boolean; - consentAPI: (consent: string | false) => boolean; + record: (params: { + forms?: boolean; + ips?: boolean; + numbers?: boolean; + emails?: boolean; + api?: boolean; + }) => boolean; getData: (callback: () => void) => boolean; restart: () => boolean; pause: () => boolean; diff --git a/dist/index.js b/dist/index.js index adb339e..a40f614 100644 --- a/dist/index.js +++ b/dist/index.js @@ -64,31 +64,13 @@ exports.default = { w.smartlook('disable'); return true; }, - consentForms: function (consent) { + record: function (params) { var w = window; if (!w.smartlook) { console.warn(SL_NOT_INITIALIZED); return false; } - w.smartlook('consentForms', consent); - return true; - }, - consentIP: function (consent) { - var w = window; - if (!w.smartlook) { - console.warn(SL_NOT_INITIALIZED); - return false; - } - w.smartlook('consentIP', consent); - return true; - }, - consentAPI: function (consent) { - var w = window; - if (!w.smartlook) { - console.warn(SL_NOT_INITIALIZED); - return false; - } - w.smartlook('consentAPI', consent); + w.smartlook('record', params); return true; }, getData: function (callback) { diff --git a/dist/index.js.map b/dist/index.js.map index 32836d4..78fd2ac 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;AACA,IAAM,kBAAkB,GAAG,sCAAsC,CAAA;AAEjE,kBAAe;IAOd,IAAI,EAAE,UAAU,GAAW,EAAE,MAAiE;QAC7F,IAAM,CAAC,GAAG,MAAyB,CAAA;QACnC,IAAI,CAAC,CAAC,SAAS,EAAE;YAChB,OAAO,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAA;YACxD,OAAO,KAAK,CAAA;SACZ;QACD,CAAC,CAAC,SAAS,GAAG;YACb,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,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;QACV,IAAM,CAAC,GAAG,MAAyB,CAAA;QACnC,OAAO,CAAC,CAAC,SAAS,CAAC,OAAO,CAAA;IAC3B,CAAC;CACD,CAAA"} \ No newline at end of file diff --git a/index.ts b/index.ts index 5e64dde..619cae5 100644 --- a/index.ts +++ b/index.ts @@ -74,31 +74,19 @@ export default { w.smartlook('disable') return true }, - consentForms: function (consent: string | false): boolean { + record: function (params: { + forms?: boolean + ips?: boolean + numbers?: boolean + emails?: boolean + api?: boolean + }): boolean { const w = window as SmartlookWindow if (!w.smartlook) { console.warn(SL_NOT_INITIALIZED) return false } - w.smartlook('consentForms', consent) - return true - }, - consentIP: function (consent: string | false): boolean { - const w = window as SmartlookWindow - if (!w.smartlook) { - console.warn(SL_NOT_INITIALIZED) - return false - } - w.smartlook('consentIP', consent) - return true - }, - consentAPI: function (consent: string | false): boolean { - const w = window as SmartlookWindow - if (!w.smartlook) { - console.warn(SL_NOT_INITIALIZED) - return false - } - w.smartlook('consentAPI', consent) + w.smartlook('record', params) return true }, getData: function (callback: () => void): boolean { @@ -168,30 +156,28 @@ export default { const w = window as SmartlookWindow return !!w.smartlook }, - get playUrl(): string | undefined { - const w = window as SmartlookWindow + get playUrl(): string | undefined { + const w = window as SmartlookWindow return w.smartlook.playUrl }, - get sessionId(): string | undefined { - const w = window as SmartlookWindow + get sessionId(): string | undefined { + const w = window as SmartlookWindow return w.smartlook.sessionId }, - get visitorId(): string | undefined { - const w = window as SmartlookWindow + get visitorId(): string | undefined { + const w = window as SmartlookWindow return w.smartlook.visitorId }, - get recordId(): string | undefined { - const w = window as SmartlookWindow + get recordId(): string | undefined { + const w = window as SmartlookWindow return w.smartlook.recordId }, - get key(): string | undefined { - const w = window as SmartlookWindow + get key(): string | undefined { + const w = window as SmartlookWindow return w.smartlook.key }, - get version(): string | undefined { - const w = window as SmartlookWindow + get version(): string | undefined { + const w = window as SmartlookWindow return w.smartlook.version }, } - -