@ketch-sdk/ketch-types 1.1.4 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -33,17 +33,17 @@ export declare function isTab(value: string): value is Tab;
33
33
  */
34
34
  export interface PluginClass {
35
35
  init?: (host: Ketch, config: Configuration) => void;
36
- environmentLoaded?: (env: Environment) => void;
37
- geoIPLoaded?: (ipInfo: IPInfo) => void;
38
- identitiesLoaded?: (identities: Identities) => void;
39
- jurisdictionLoaded?: (policyScope: string) => void;
40
- regionInfoLoaded?: (region: string) => void;
41
- consentChanged?: (consent: Consent) => void;
42
- rightInvoked?: (request: InvokeRightRequest) => void;
43
- showConsentExperience?: ShowConsentExperience;
44
- showPreferenceExperience?: ShowPreferenceExperience;
45
- willShowExperience?: (type: string) => void;
46
- experienceHidden?: (reason: string) => void;
36
+ environmentLoaded?: (host: Ketch, config: Configuration, env: Environment) => void;
37
+ geoIPLoaded?: (host: Ketch, config: Configuration, ipInfo: IPInfo) => void;
38
+ identitiesLoaded?: (host: Ketch, config: Configuration, identities: Identities) => void;
39
+ jurisdictionLoaded?: (host: Ketch, config: Configuration, policyScope: string) => void;
40
+ regionInfoLoaded?: (host: Ketch, config: Configuration, region: string) => void;
41
+ consentChanged?: (host: Ketch, config: Configuration, consent: Consent) => void;
42
+ rightInvoked?: (host: Ketch, config: Configuration, request: InvokeRightRequest) => void;
43
+ showConsentExperience?: (host: Ketch, config: Configuration, consents: Consent, options?: ShowConsentOptions) => void;
44
+ showPreferenceExperience?: (host: Ketch, config: Configuration, consents: Consent, options?: ShowPreferenceOptions) => void;
45
+ willShowExperience?: (host: Ketch, config: Configuration, type: string) => void;
46
+ experienceHidden?: (host: Ketch, config: Configuration, reason: string) => void;
47
47
  }
48
48
  /**
49
49
  * Plugin factory function signature
@@ -62,32 +62,75 @@ export interface Ketch {
62
62
  hasConsent(): boolean;
63
63
  getConsent(): Promise<Consent>;
64
64
  setConsent(c: Consent): Promise<Consent>;
65
- setProvisionalConsent(c: Consent): Promise<void>;
65
+ /**
66
+ * @deprecated use on('consent', callback)
67
+ * @param callback
68
+ */
66
69
  onConsent(callback: Callback): Promise<void>;
67
70
  setShowConsentExperience(): Promise<void>;
68
71
  showConsentExperience(): Promise<Consent>;
69
- onShowConsentExperience(callback: ShowConsentExperience): Promise<void>;
72
+ /**
73
+ * @deprecated use on('showConsentExperience', callback)
74
+ * @param callback
75
+ */
76
+ onShowConsentExperience(callback: (consents: Consent, options?: ShowConsentOptions) => void): Promise<void>;
70
77
  showPreferenceExperience(params: ShowPreferenceOptions): Promise<Consent>;
71
- onShowPreferenceExperience(callback: ShowPreferenceExperience): Promise<void>;
78
+ /**
79
+ * @deprecated use on('showPreferenceExperience', callback)
80
+ * @param callback
81
+ */
82
+ onShowPreferenceExperience(callback: (consents: Consent, options?: ShowPreferenceOptions) => void): Promise<void>;
72
83
  experienceClosed(reason: ExperienceClosedReason): Promise<Consent>;
84
+ /**
85
+ * @deprecated use on('experienceHidden', callback)
86
+ * @param callback
87
+ */
73
88
  onHideExperience(callback: Callback): Promise<void>;
89
+ /**
90
+ * @deprecated use on('willShowExperience', callback)
91
+ * @param callback
92
+ */
74
93
  onWillShowExperience(callback: Callback): Promise<void>;
75
94
  invokeRight(eventData: InvokeRightEvent): Promise<void>;
95
+ /**
96
+ * @deprecated use on('rightInvoked', callback)
97
+ * @param callback
98
+ */
76
99
  onInvokeRight(callback: Callback): Promise<void>;
77
100
  setEnvironment(env: Environment): Promise<Environment>;
78
101
  getEnvironment(): Promise<Environment>;
102
+ /**
103
+ * @deprecated use on('environment', callback)
104
+ * @param callback
105
+ */
79
106
  onEnvironment(callback: Callback): Promise<void>;
80
107
  setGeoIP(g: IPInfo): Promise<IPInfo>;
81
108
  getGeoIP(): Promise<IPInfo>;
109
+ /**
110
+ * @deprecated use on('geoip', callback)
111
+ * @param callback
112
+ */
82
113
  onGeoIP(callback: Callback): Promise<void>;
83
114
  setIdentities(id: Identities): Promise<Identities>;
84
115
  getIdentities(): Promise<Identities>;
116
+ /**
117
+ * @deprecated use on('identities', callback)
118
+ * @param callback
119
+ */
85
120
  onIdentities(callback: Callback): Promise<void>;
86
121
  setJurisdiction(ps: string): Promise<string>;
87
122
  getJurisdiction(): Promise<string>;
123
+ /**
124
+ * @deprecated use on('jurisdiction', callback)
125
+ * @param callback
126
+ */
88
127
  onJurisdiction(callback: Callback): Promise<void>;
89
128
  setRegionInfo(info: string): Promise<string>;
90
129
  getRegionInfo(): Promise<string>;
130
+ /**
131
+ * @deprecated use on('region', callback)
132
+ * @param callback
133
+ */
91
134
  onRegionInfo(callback: Callback): Promise<void>;
92
135
  emit(eventName: string | symbol, ...args: any[]): boolean;
93
136
  addListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
@@ -96,14 +139,6 @@ export interface Ketch {
96
139
  once(eventName: string | symbol, listener: (...args: any[]) => void): this;
97
140
  off(eventName: string | symbol, listener: (...args: any[]) => void): this;
98
141
  }
99
- /**
100
- * ShowPreferenceExperience
101
- */
102
- export type ShowPreferenceExperience = (consents: Consent, options?: ShowPreferenceOptions) => void;
103
- /**
104
- * ShowConsentExperience
105
- */
106
- export type ShowConsentExperience = (consents: Consent, options?: ShowConsentOptions) => void;
107
142
  /**
108
143
  * ShowPreferenceOptions
109
144
  */
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name": "@ketch-sdk/ketch-types", "version": "1.1.4", "description": "Ketch Types", "main": "./dist/index.js", "types": "./dist/index.d.ts", "scripts": {"all": "npm run lint && npm run format-check && npm run test && npm run build && npm run docs", "build": "ncc build --minify --license licenses.txt src/index.ts", "lint": "eslint src/**/*.ts", "test": "jest --runInBand --passWithNoTests", "format": "prettier --write \"**/*.{ts,tsx,yml,yaml}\"", "format-check": "prettier --check '**/*.ts'", "docs": "typedoc --githubPages true --excludeInternal src/index.ts"}, "repository": {"type": "git", "url": "git+https://github.com/ketch-sdk/ketch-types.git"}, "author": "Ketch Kloud, Inc. (https://www.ketch.com/)", "license": "MIT", "homepage": "https://github.com/ketch-sdk/ketch-types", "bugs": {"url": "https://github.com/ketch-sdk/ketch-types/issues"}, "devDependencies": {"@jest/globals": "^29.3.1", "@types/jest": "^29.2.3", "@typescript-eslint/eslint-plugin": "^5.45.0", "@typescript-eslint/parser": "^5.45.0", "@vercel/ncc": "^0.34.0", "eslint": "^8.28.0", "eslint-config-prettier": "^8.5.0", "eslint-plugin-import": "^2.26.0", "eslint-plugin-jest": "^27.1.6", "eslint-plugin-prettier": "^4.2.1", "jest": "^29.3.1", "jest-environment-jsdom": "^29.3.1", "jest-junit": "^15.0.0", "prettier": "^2.8.0", "ts-jest": "^29.0.3", "typedoc": "^0.23.21", "typescript": "^4.9.3"}}
1
+ {"name": "@ketch-sdk/ketch-types", "version": "1.1.5", "description": "Ketch Types", "main": "./dist/index.js", "types": "./dist/index.d.ts", "scripts": {"all": "npm run lint && npm run format-check && npm run test && npm run build && npm run docs", "build": "ncc build --minify --license licenses.txt src/index.ts", "lint": "eslint src/**/*.ts", "test": "jest --runInBand --passWithNoTests", "format": "prettier --write \"**/*.{ts,tsx,yml,yaml}\"", "format-check": "prettier --check '**/*.ts'", "docs": "typedoc --githubPages true --excludeInternal src/index.ts"}, "repository": {"type": "git", "url": "git+https://github.com/ketch-sdk/ketch-types.git"}, "author": "Ketch Kloud, Inc. (https://www.ketch.com/)", "license": "MIT", "homepage": "https://github.com/ketch-sdk/ketch-types", "bugs": {"url": "https://github.com/ketch-sdk/ketch-types/issues"}, "devDependencies": {"@jest/globals": "^29.3.1", "@types/jest": "^29.2.3", "@typescript-eslint/eslint-plugin": "^5.45.0", "@typescript-eslint/parser": "^5.45.0", "@vercel/ncc": "^0.34.0", "eslint": "^8.28.0", "eslint-config-prettier": "^8.5.0", "eslint-plugin-import": "^2.26.0", "eslint-plugin-jest": "^27.1.6", "eslint-plugin-prettier": "^4.2.1", "jest": "^29.3.1", "jest-environment-jsdom": "^29.3.1", "jest-junit": "^15.0.0", "prettier": "^2.8.0", "ts-jest": "^29.0.3", "typedoc": "^0.23.21", "typescript": "^4.9.3"}}
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <coverage generated="1670012673522" clover="3.2.0">
3
- <project timestamp="1670012673522" name="All files">
2
+ <coverage generated="1670014381753" clover="3.2.0">
3
+ <project timestamp="1670014381753" name="All files">
4
4
  <metrics statements="0" coveredstatements="0" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0" elements="0" coveredelements="0" complexity="0" loc="0" ncloc="0" packages="0" files="0" classes="0"/>
5
5
  </project>
6
6
  </coverage>
@@ -86,7 +86,7 @@
86
86
  <div class='footer quiet pad2 space-top1 center small'>
87
87
  Code coverage generated by
88
88
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
89
- at 2022-12-02T20:24:33.519Z
89
+ at 2022-12-02T20:53:01.750Z
90
90
  </div>
91
91
  <script src="prettify.js"></script>
92
92
  <script>