@avsbhq/snippet-types 1.4.0 → 1.5.1
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/avsb.d.ts +3 -3
- package/package.json +4 -4
- package/variation-code.d.ts +1 -1
package/avsb.d.ts
CHANGED
|
@@ -374,8 +374,8 @@ interface AvsbApi {
|
|
|
374
374
|
setVisitorId(visitorId: string): boolean
|
|
375
375
|
/** The variation this visitor is assigned in the experiment, or null. Pass the numeric **Experiment ID** from the experiment details panel (a number or its string form); the value returned is that variation's numeric **Variation ID**. Internal UUIDs are not accepted. */
|
|
376
376
|
getVariation(experimentId: string | number): string | null
|
|
377
|
-
/** Force a variation, for QA, by the numeric **Experiment ID** and **Variation ID** shown in the experiment details panel. `{ track: false }` applies it without recording an exposure. */
|
|
378
|
-
forceVariation(experimentId: string | number, variationId: string | number, options?: { track?: boolean }): boolean
|
|
377
|
+
/** Force a variation, for QA, by the numeric **Experiment ID** and **Variation ID** shown in the experiment details panel. It stays the visitor's variation on later page loads until `exitPreview()`; `{ persist: false }` forces it for this page only. `{ track: false }` applies it without recording an exposure. */
|
|
378
|
+
forceVariation(experimentId: string | number, variationId: string | number, options?: { track?: boolean; persist?: boolean }): boolean
|
|
379
379
|
waitUntil: AvsbWaitUntilFn
|
|
380
380
|
utils: AvsbUtils
|
|
381
381
|
/** Subscribe to every experiment event. Returns an unsubscribe function. Absent in the preview bypass runtime. */
|
|
@@ -396,7 +396,7 @@ interface AvsbApi {
|
|
|
396
396
|
recs: AvsbRecsClient
|
|
397
397
|
/** Commerce events. Buffered until the commerce chunk loads. */
|
|
398
398
|
commerce: AvsbCommerceApi
|
|
399
|
-
/** Leave a shared preview link
|
|
399
|
+
/** Leave a shared preview link and undo every persisted `forceVariation`: clears both and reloads. */
|
|
400
400
|
exitPreview(): void
|
|
401
401
|
/** After a split-URL redirect in this tab: the referrer of the page the visitor was redirected FROM, captured before the redirect so your analytics can undo the self-referral. `''` means that visit was direct; `null` means no redirect has happened (or storage is unavailable). Same-origin only, so a destination on a different domain cannot read it. Optional: absent on snippet builds that predate it, so read it as `avsb.getOriginalReferrer?.()`. */
|
|
402
402
|
getOriginalReferrer?(): string | null
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avsbhq/snippet-types",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "TypeScript declarations for window.avsb, the A vs B web-snippet API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"avsb",
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
},
|
|
32
32
|
"repository": {
|
|
33
33
|
"type": "git",
|
|
34
|
-
"url": "git+https://github.com/avsbhq/
|
|
34
|
+
"url": "git+https://github.com/avsbhq/avsb-js.git",
|
|
35
35
|
"directory": "packages/avsb-snippet-types"
|
|
36
36
|
},
|
|
37
|
-
"homepage": "https://github.com/avsbhq/
|
|
37
|
+
"homepage": "https://github.com/avsbhq/avsb-js/tree/main/packages/avsb-snippet-types#readme",
|
|
38
38
|
"bugs": {
|
|
39
|
-
"url": "https://github.com/avsbhq/
|
|
39
|
+
"url": "https://github.com/avsbhq/avsb-js/issues"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"sync:types": "node ../../snippet/scripts/syncSnippetTypes.mjs",
|
package/variation-code.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ interface AvsbCodeOptions {
|
|
|
38
38
|
/** Experiments running on this page, as the same numeric dashboard ids. */
|
|
39
39
|
getActiveExperiments(): Array<{ experimentId: string; variationId: string }>
|
|
40
40
|
/** Force a variation by the numeric **Experiment ID** and **Variation ID** from the experiment details panel. */
|
|
41
|
-
forceVariation(experimentId: string | number, variationId: string | number, options?: { track?: boolean }): boolean
|
|
41
|
+
forceVariation(experimentId: string | number, variationId: string | number, options?: { track?: boolean; persist?: boolean }): boolean
|
|
42
42
|
/** Cancelled automatically on teardown, unlike `avsb.waitUntil`. */
|
|
43
43
|
waitUntil: AvsbWaitUntilFn
|
|
44
44
|
utils: AvsbUtils
|