@atlaskit/tmp-editor-statsig 13.43.0 → 13.44.0
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/CHANGELOG.md +12 -0
- package/dist/cjs/exp-val-equals-no-exposure.js +2 -2
- package/dist/cjs/exp-val-equals.js +2 -2
- package/dist/cjs/expVal.js +15 -17
- package/dist/cjs/experiments-config.js +16 -8
- package/dist/es2019/exp-val-equals-no-exposure.js +2 -2
- package/dist/es2019/exp-val-equals.js +2 -2
- package/dist/es2019/expVal.js +17 -19
- package/dist/es2019/experiments-config.js +17 -8
- package/dist/esm/exp-val-equals-no-exposure.js +2 -2
- package/dist/esm/exp-val-equals.js +2 -2
- package/dist/esm/expVal.js +15 -17
- package/dist/esm/experiments-config.js +17 -8
- package/dist/types/exp-val-equals-no-exposure.d.ts +4 -4
- package/dist/types/exp-val-equals.d.ts +4 -4
- package/dist/types/expVal.d.ts +4 -5
- package/dist/types/experiments-config.d.ts +12 -6
- package/dist/types-ts4.5/exp-val-equals-no-exposure.d.ts +4 -4
- package/dist/types-ts4.5/exp-val-equals.d.ts +4 -4
- package/dist/types-ts4.5/expVal.d.ts +4 -5
- package/dist/types-ts4.5/experiments-config.d.ts +12 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-statsig-tmp
|
|
2
2
|
|
|
3
|
+
## 13.44.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`60c2daf68b2a9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/60c2daf68b2a9) -
|
|
8
|
+
add type guard for expected value and default value in expVal, expValNoExposure, expValEquals and
|
|
9
|
+
expValEqualsNoExposure
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 13.43.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -28,8 +28,8 @@ var _expValEqualsInternal = require("./exp-val-equals-internal");
|
|
|
28
28
|
*
|
|
29
29
|
* @param experimentName - experiment key
|
|
30
30
|
* @param experimentParam - the name of the parameter to fetch from the experiment config
|
|
31
|
-
* @param experimentExpectedValue - expected value to compare with
|
|
32
|
-
* @param experimentDefaultValue - default value to use if the experiment is not defined.
|
|
31
|
+
* @param experimentExpectedValue - expected value to compare with. Can't use false for boolean experiments or invalid values for multivariate experiments.
|
|
32
|
+
* @param experimentDefaultValue - default value to use if the experiment is not defined. Can't use true for boolean experiments or invalid values for multivariate experiments.
|
|
33
33
|
*
|
|
34
34
|
* @returns boolean
|
|
35
35
|
*/
|
|
@@ -28,8 +28,8 @@ var _expValEqualsInternal = require("./exp-val-equals-internal");
|
|
|
28
28
|
*
|
|
29
29
|
* @param experimentName - experiment key
|
|
30
30
|
* @param experimentParam - the name of the parameter to fetch from the experiment config
|
|
31
|
-
* @param experimentExpectedValue - expected value to compare with
|
|
32
|
-
* @param experimentDefaultValue - default value to use if the experiment is not defined.
|
|
31
|
+
* @param experimentExpectedValue - expected value to compare with. Can't use false for boolean experiments or invalid values for multivariate experiments.
|
|
32
|
+
* @param experimentDefaultValue - default value to use if the experiment is not defined. Can't use true for boolean experiments or invalid values for multivariate experiments.
|
|
33
33
|
*
|
|
34
34
|
* @returns boolean
|
|
35
35
|
*/
|
package/dist/cjs/expVal.js
CHANGED
|
@@ -75,11 +75,11 @@ function expValInternal(_ref) {
|
|
|
75
75
|
* - is not being served to the client (ie. pre start)
|
|
76
76
|
* - or is not configured in experiments-config
|
|
77
77
|
*
|
|
78
|
-
* If you need to check a param value without an exposure check see {@link
|
|
78
|
+
* If you need to check a param value without an exposure check see {@link expValNoExposure}
|
|
79
79
|
*
|
|
80
80
|
* @example
|
|
81
81
|
* ```ts
|
|
82
|
-
* const delay =
|
|
82
|
+
* const delay = expVal('experiment-name', 'param-name', defaultValue)
|
|
83
83
|
* await new Promise(res => setTimeout(res, delay)
|
|
84
84
|
* ```
|
|
85
85
|
*/
|
|
@@ -90,21 +90,19 @@ function expVal(experimentName, experimentParam, defaultValue) {
|
|
|
90
90
|
defaultValue: defaultValue,
|
|
91
91
|
fireExperimentExposure: true
|
|
92
92
|
});
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
* ```
|
|
107
|
-
*/
|
|
93
|
+
} /**
|
|
94
|
+
* Use to check a any param value for an experiment without firing an exposure event
|
|
95
|
+
*
|
|
96
|
+
* **Note**: this will return the default value when the experiment;
|
|
97
|
+
* - is not being served to the client (ie. pre start)
|
|
98
|
+
* - or is not configured in experiments-config
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```ts
|
|
102
|
+
* const delay = expParamEqualsNoExposure('experiment-name', 'param-name', defaultValue)
|
|
103
|
+
* await new Promise(res => setTimeout(res, delay)
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
108
106
|
function expValNoExposure(experimentName, experimentParam, defaultValue) {
|
|
109
107
|
return expValInternal({
|
|
110
108
|
experimentName: experimentName,
|
|
@@ -8,6 +8,22 @@ var _experimentBuilders = require("./experiment-builders");
|
|
|
8
8
|
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
9
9
|
// Entry file in package.json
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Extract valid expected values.
|
|
13
|
+
* - For multivariate experiments: returns union of valid string values (inferred from defaultValue type)
|
|
14
|
+
* - For boolean experiments: returns only 'true' literal (cannot use 'false' as expected value)
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
// Multivariate: use the default value type
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Extract valid default values.
|
|
21
|
+
* - For boolean experiments: returns only 'false' literal (cannot use 'true' as default value)
|
|
22
|
+
* - For multivariate experiments: returns the default value type (one of the string values)
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
// Multivariate: use the default value type
|
|
26
|
+
|
|
11
27
|
/**
|
|
12
28
|
* When adding a new experiment, you need to add it here.
|
|
13
29
|
* Please follow the pattern established in the examples and any
|
|
@@ -400,14 +416,6 @@ var editorExperimentsConfig = exports.editorExperimentsConfig = {
|
|
|
400
416
|
param: 'isEnabled',
|
|
401
417
|
defaultValue: false
|
|
402
418
|
}),
|
|
403
|
-
// Added 2025-10-15
|
|
404
|
-
platform_editor_no_ssr: (0, _experimentBuilders.createBooleanExperiment)({
|
|
405
|
-
productKeys: {
|
|
406
|
-
confluence: 'platform_editor_no_ssr'
|
|
407
|
-
},
|
|
408
|
-
param: 'isEnabled',
|
|
409
|
-
defaultValue: false
|
|
410
|
-
}),
|
|
411
419
|
// Added 2025-08-14
|
|
412
420
|
platform_editor_jira_advanced_code_blocks: (0, _experimentBuilders.createBooleanExperiment)({
|
|
413
421
|
productKeys: {
|
|
@@ -22,8 +22,8 @@ import { expValEqualsInternal } from './exp-val-equals-internal';
|
|
|
22
22
|
*
|
|
23
23
|
* @param experimentName - experiment key
|
|
24
24
|
* @param experimentParam - the name of the parameter to fetch from the experiment config
|
|
25
|
-
* @param experimentExpectedValue - expected value to compare with
|
|
26
|
-
* @param experimentDefaultValue - default value to use if the experiment is not defined.
|
|
25
|
+
* @param experimentExpectedValue - expected value to compare with. Can't use false for boolean experiments or invalid values for multivariate experiments.
|
|
26
|
+
* @param experimentDefaultValue - default value to use if the experiment is not defined. Can't use true for boolean experiments or invalid values for multivariate experiments.
|
|
27
27
|
*
|
|
28
28
|
* @returns boolean
|
|
29
29
|
*/
|
|
@@ -22,8 +22,8 @@ import { expValEqualsInternal } from './exp-val-equals-internal';
|
|
|
22
22
|
*
|
|
23
23
|
* @param experimentName - experiment key
|
|
24
24
|
* @param experimentParam - the name of the parameter to fetch from the experiment config
|
|
25
|
-
* @param experimentExpectedValue - expected value to compare with
|
|
26
|
-
* @param experimentDefaultValue - default value to use if the experiment is not defined.
|
|
25
|
+
* @param experimentExpectedValue - expected value to compare with. Can't use false for boolean experiments or invalid values for multivariate experiments.
|
|
26
|
+
* @param experimentDefaultValue - default value to use if the experiment is not defined. Can't use true for boolean experiments or invalid values for multivariate experiments.
|
|
27
27
|
*
|
|
28
28
|
* @returns boolean
|
|
29
29
|
*/
|
package/dist/es2019/expVal.js
CHANGED
|
@@ -68,11 +68,11 @@ function expValInternal({
|
|
|
68
68
|
* - is not being served to the client (ie. pre start)
|
|
69
69
|
* - or is not configured in experiments-config
|
|
70
70
|
*
|
|
71
|
-
* If you need to check a param value without an exposure check see {@link
|
|
71
|
+
* If you need to check a param value without an exposure check see {@link expValNoExposure}
|
|
72
72
|
*
|
|
73
73
|
* @example
|
|
74
74
|
* ```ts
|
|
75
|
-
* const delay =
|
|
75
|
+
* const delay = expVal('experiment-name', 'param-name', defaultValue)
|
|
76
76
|
* await new Promise(res => setTimeout(res, delay)
|
|
77
77
|
* ```
|
|
78
78
|
*/
|
|
@@ -80,29 +80,27 @@ export function expVal(experimentName, experimentParam, defaultValue) {
|
|
|
80
80
|
return expValInternal({
|
|
81
81
|
experimentName,
|
|
82
82
|
experimentParam,
|
|
83
|
-
defaultValue,
|
|
83
|
+
defaultValue: defaultValue,
|
|
84
84
|
fireExperimentExposure: true
|
|
85
85
|
});
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
* ```
|
|
100
|
-
*/
|
|
86
|
+
} /**
|
|
87
|
+
* Use to check a any param value for an experiment without firing an exposure event
|
|
88
|
+
*
|
|
89
|
+
* **Note**: this will return the default value when the experiment;
|
|
90
|
+
* - is not being served to the client (ie. pre start)
|
|
91
|
+
* - or is not configured in experiments-config
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```ts
|
|
95
|
+
* const delay = expParamEqualsNoExposure('experiment-name', 'param-name', defaultValue)
|
|
96
|
+
* await new Promise(res => setTimeout(res, delay)
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
101
99
|
export function expValNoExposure(experimentName, experimentParam, defaultValue) {
|
|
102
100
|
return expValInternal({
|
|
103
101
|
experimentName,
|
|
104
102
|
experimentParam,
|
|
105
|
-
defaultValue,
|
|
103
|
+
defaultValue: defaultValue,
|
|
106
104
|
fireExperimentExposure: false
|
|
107
105
|
});
|
|
108
106
|
}
|
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
// Entry file in package.json
|
|
3
3
|
|
|
4
4
|
import { createBooleanExperiment, createMultivariateExperiment } from './experiment-builders';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Extract valid expected values.
|
|
8
|
+
* - For multivariate experiments: returns union of valid string values (inferred from defaultValue type)
|
|
9
|
+
* - For boolean experiments: returns only 'true' literal (cannot use 'false' as expected value)
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
// Multivariate: use the default value type
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Extract valid default values.
|
|
16
|
+
* - For boolean experiments: returns only 'false' literal (cannot use 'true' as default value)
|
|
17
|
+
* - For multivariate experiments: returns the default value type (one of the string values)
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
// Multivariate: use the default value type
|
|
21
|
+
|
|
5
22
|
/**
|
|
6
23
|
* When adding a new experiment, you need to add it here.
|
|
7
24
|
* Please follow the pattern established in the examples and any
|
|
@@ -394,14 +411,6 @@ export const editorExperimentsConfig = {
|
|
|
394
411
|
param: 'isEnabled',
|
|
395
412
|
defaultValue: false
|
|
396
413
|
}),
|
|
397
|
-
// Added 2025-10-15
|
|
398
|
-
platform_editor_no_ssr: createBooleanExperiment({
|
|
399
|
-
productKeys: {
|
|
400
|
-
confluence: 'platform_editor_no_ssr'
|
|
401
|
-
},
|
|
402
|
-
param: 'isEnabled',
|
|
403
|
-
defaultValue: false
|
|
404
|
-
}),
|
|
405
414
|
// Added 2025-08-14
|
|
406
415
|
platform_editor_jira_advanced_code_blocks: createBooleanExperiment({
|
|
407
416
|
productKeys: {
|
|
@@ -22,8 +22,8 @@ import { expValEqualsInternal } from './exp-val-equals-internal';
|
|
|
22
22
|
*
|
|
23
23
|
* @param experimentName - experiment key
|
|
24
24
|
* @param experimentParam - the name of the parameter to fetch from the experiment config
|
|
25
|
-
* @param experimentExpectedValue - expected value to compare with
|
|
26
|
-
* @param experimentDefaultValue - default value to use if the experiment is not defined.
|
|
25
|
+
* @param experimentExpectedValue - expected value to compare with. Can't use false for boolean experiments or invalid values for multivariate experiments.
|
|
26
|
+
* @param experimentDefaultValue - default value to use if the experiment is not defined. Can't use true for boolean experiments or invalid values for multivariate experiments.
|
|
27
27
|
*
|
|
28
28
|
* @returns boolean
|
|
29
29
|
*/
|
|
@@ -22,8 +22,8 @@ import { expValEqualsInternal } from './exp-val-equals-internal';
|
|
|
22
22
|
*
|
|
23
23
|
* @param experimentName - experiment key
|
|
24
24
|
* @param experimentParam - the name of the parameter to fetch from the experiment config
|
|
25
|
-
* @param experimentExpectedValue - expected value to compare with
|
|
26
|
-
* @param experimentDefaultValue - default value to use if the experiment is not defined.
|
|
25
|
+
* @param experimentExpectedValue - expected value to compare with. Can't use false for boolean experiments or invalid values for multivariate experiments.
|
|
26
|
+
* @param experimentDefaultValue - default value to use if the experiment is not defined. Can't use true for boolean experiments or invalid values for multivariate experiments.
|
|
27
27
|
*
|
|
28
28
|
* @returns boolean
|
|
29
29
|
*/
|
package/dist/esm/expVal.js
CHANGED
|
@@ -67,11 +67,11 @@ function expValInternal(_ref) {
|
|
|
67
67
|
* - is not being served to the client (ie. pre start)
|
|
68
68
|
* - or is not configured in experiments-config
|
|
69
69
|
*
|
|
70
|
-
* If you need to check a param value without an exposure check see {@link
|
|
70
|
+
* If you need to check a param value without an exposure check see {@link expValNoExposure}
|
|
71
71
|
*
|
|
72
72
|
* @example
|
|
73
73
|
* ```ts
|
|
74
|
-
* const delay =
|
|
74
|
+
* const delay = expVal('experiment-name', 'param-name', defaultValue)
|
|
75
75
|
* await new Promise(res => setTimeout(res, delay)
|
|
76
76
|
* ```
|
|
77
77
|
*/
|
|
@@ -82,21 +82,19 @@ export function expVal(experimentName, experimentParam, defaultValue) {
|
|
|
82
82
|
defaultValue: defaultValue,
|
|
83
83
|
fireExperimentExposure: true
|
|
84
84
|
});
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
* ```
|
|
99
|
-
*/
|
|
85
|
+
} /**
|
|
86
|
+
* Use to check a any param value for an experiment without firing an exposure event
|
|
87
|
+
*
|
|
88
|
+
* **Note**: this will return the default value when the experiment;
|
|
89
|
+
* - is not being served to the client (ie. pre start)
|
|
90
|
+
* - or is not configured in experiments-config
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```ts
|
|
94
|
+
* const delay = expParamEqualsNoExposure('experiment-name', 'param-name', defaultValue)
|
|
95
|
+
* await new Promise(res => setTimeout(res, delay)
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
100
98
|
export function expValNoExposure(experimentName, experimentParam, defaultValue) {
|
|
101
99
|
return expValInternal({
|
|
102
100
|
experimentName: experimentName,
|
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
// Entry file in package.json
|
|
3
3
|
|
|
4
4
|
import { createBooleanExperiment, createMultivariateExperiment } from './experiment-builders';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Extract valid expected values.
|
|
8
|
+
* - For multivariate experiments: returns union of valid string values (inferred from defaultValue type)
|
|
9
|
+
* - For boolean experiments: returns only 'true' literal (cannot use 'false' as expected value)
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
// Multivariate: use the default value type
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Extract valid default values.
|
|
16
|
+
* - For boolean experiments: returns only 'false' literal (cannot use 'true' as default value)
|
|
17
|
+
* - For multivariate experiments: returns the default value type (one of the string values)
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
// Multivariate: use the default value type
|
|
21
|
+
|
|
5
22
|
/**
|
|
6
23
|
* When adding a new experiment, you need to add it here.
|
|
7
24
|
* Please follow the pattern established in the examples and any
|
|
@@ -394,14 +411,6 @@ export var editorExperimentsConfig = {
|
|
|
394
411
|
param: 'isEnabled',
|
|
395
412
|
defaultValue: false
|
|
396
413
|
}),
|
|
397
|
-
// Added 2025-10-15
|
|
398
|
-
platform_editor_no_ssr: createBooleanExperiment({
|
|
399
|
-
productKeys: {
|
|
400
|
-
confluence: 'platform_editor_no_ssr'
|
|
401
|
-
},
|
|
402
|
-
param: 'isEnabled',
|
|
403
|
-
defaultValue: false
|
|
404
|
-
}),
|
|
405
414
|
// Added 2025-08-14
|
|
406
415
|
platform_editor_jira_advanced_code_blocks: createBooleanExperiment({
|
|
407
416
|
productKeys: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type EditorExperimentsConfig } from './experiments-config';
|
|
1
|
+
import { type EditorExperimentsConfig, type ExperimentDefaultValue, type ExperimentExpectedValue } from './experiments-config';
|
|
2
2
|
/**
|
|
3
3
|
* Check the value if an editor experiment without firing exposure.
|
|
4
4
|
*
|
|
@@ -22,9 +22,9 @@ import { type EditorExperimentsConfig } from './experiments-config';
|
|
|
22
22
|
*
|
|
23
23
|
* @param experimentName - experiment key
|
|
24
24
|
* @param experimentParam - the name of the parameter to fetch from the experiment config
|
|
25
|
-
* @param experimentExpectedValue - expected value to compare with
|
|
26
|
-
* @param experimentDefaultValue - default value to use if the experiment is not defined.
|
|
25
|
+
* @param experimentExpectedValue - expected value to compare with. Can't use false for boolean experiments or invalid values for multivariate experiments.
|
|
26
|
+
* @param experimentDefaultValue - default value to use if the experiment is not defined. Can't use true for boolean experiments or invalid values for multivariate experiments.
|
|
27
27
|
*
|
|
28
28
|
* @returns boolean
|
|
29
29
|
*/
|
|
30
|
-
export declare function expValEqualsNoExposure<ExperimentName extends keyof EditorExperimentsConfig>(experimentName: ExperimentName, experimentParam: EditorExperimentsConfig[ExperimentName]['param'], experimentExpectedValue:
|
|
30
|
+
export declare function expValEqualsNoExposure<ExperimentName extends keyof EditorExperimentsConfig>(experimentName: ExperimentName, experimentParam: EditorExperimentsConfig[ExperimentName]['param'], experimentExpectedValue: ExperimentExpectedValue<ExperimentName>, experimentDefaultValue?: ExperimentDefaultValue<ExperimentName> | null): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type EditorExperimentsConfig } from './experiments-config';
|
|
1
|
+
import { type EditorExperimentsConfig, type ExperimentDefaultValue, type ExperimentExpectedValue } from './experiments-config';
|
|
2
2
|
/**
|
|
3
3
|
* Check the value if an editor experiment and fire exposure.
|
|
4
4
|
*
|
|
@@ -22,9 +22,9 @@ import { type EditorExperimentsConfig } from './experiments-config';
|
|
|
22
22
|
*
|
|
23
23
|
* @param experimentName - experiment key
|
|
24
24
|
* @param experimentParam - the name of the parameter to fetch from the experiment config
|
|
25
|
-
* @param experimentExpectedValue - expected value to compare with
|
|
26
|
-
* @param experimentDefaultValue - default value to use if the experiment is not defined.
|
|
25
|
+
* @param experimentExpectedValue - expected value to compare with. Can't use false for boolean experiments or invalid values for multivariate experiments.
|
|
26
|
+
* @param experimentDefaultValue - default value to use if the experiment is not defined. Can't use true for boolean experiments or invalid values for multivariate experiments.
|
|
27
27
|
*
|
|
28
28
|
* @returns boolean
|
|
29
29
|
*/
|
|
30
|
-
export declare function expValEquals<ExperimentName extends keyof EditorExperimentsConfig>(experimentName: ExperimentName, experimentParam: EditorExperimentsConfig[ExperimentName]['param'], experimentExpectedValue:
|
|
30
|
+
export declare function expValEquals<ExperimentName extends keyof EditorExperimentsConfig>(experimentName: ExperimentName, experimentParam: EditorExperimentsConfig[ExperimentName]['param'], experimentExpectedValue: ExperimentExpectedValue<ExperimentName>, experimentDefaultValue?: ExperimentDefaultValue<ExperimentName> | null): boolean;
|
package/dist/types/expVal.d.ts
CHANGED
|
@@ -6,16 +6,15 @@ import { type EditorExperimentsConfig } from './experiments-config';
|
|
|
6
6
|
* - is not being served to the client (ie. pre start)
|
|
7
7
|
* - or is not configured in experiments-config
|
|
8
8
|
*
|
|
9
|
-
* If you need to check a param value without an exposure check see {@link
|
|
9
|
+
* If you need to check a param value without an exposure check see {@link expValNoExposure}
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
12
|
* ```ts
|
|
13
|
-
* const delay =
|
|
13
|
+
* const delay = expVal('experiment-name', 'param-name', defaultValue)
|
|
14
14
|
* await new Promise(res => setTimeout(res, delay)
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
|
-
export declare function expVal<ExperimentName extends keyof EditorExperimentsConfig, DefaultValue extends string | number | boolean>(experimentName: ExperimentName, experimentParam: string, defaultValue: DefaultValue): DefaultValue;
|
|
18
|
-
/**
|
|
17
|
+
export declare function expVal<ExperimentName extends keyof EditorExperimentsConfig, DefaultValue extends string | number | boolean>(experimentName: ExperimentName, experimentParam: string, defaultValue: DefaultValue extends boolean ? false : DefaultValue): DefaultValue; /**
|
|
19
18
|
* Use to check a any param value for an experiment without firing an exposure event
|
|
20
19
|
*
|
|
21
20
|
* **Note**: this will return the default value when the experiment;
|
|
@@ -28,4 +27,4 @@ export declare function expVal<ExperimentName extends keyof EditorExperimentsCon
|
|
|
28
27
|
* await new Promise(res => setTimeout(res, delay)
|
|
29
28
|
* ```
|
|
30
29
|
*/
|
|
31
|
-
export declare function expValNoExposure<ExperimentName extends keyof EditorExperimentsConfig, DefaultValue extends string | number | boolean>(experimentName: ExperimentName, experimentParam: string, defaultValue: DefaultValue): DefaultValue;
|
|
30
|
+
export declare function expValNoExposure<ExperimentName extends keyof EditorExperimentsConfig, DefaultValue extends string | number | boolean>(experimentName: ExperimentName, experimentParam: string, defaultValue: DefaultValue extends boolean ? false : DefaultValue): DefaultValue;
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
export type EditorExperimentsConfig = typeof editorExperimentsConfig;
|
|
2
|
+
/**
|
|
3
|
+
* Extract valid expected values.
|
|
4
|
+
* - For multivariate experiments: returns union of valid string values (inferred from defaultValue type)
|
|
5
|
+
* - For boolean experiments: returns only 'true' literal (cannot use 'false' as expected value)
|
|
6
|
+
*/
|
|
7
|
+
export type ExperimentExpectedValue<ExperimentName extends keyof EditorExperimentsConfig> = EditorExperimentsConfig[ExperimentName]['defaultValue'] extends boolean ? true : EditorExperimentsConfig[ExperimentName]['defaultValue'];
|
|
8
|
+
/**
|
|
9
|
+
* Extract valid default values.
|
|
10
|
+
* - For boolean experiments: returns only 'false' literal (cannot use 'true' as default value)
|
|
11
|
+
* - For multivariate experiments: returns the default value type (one of the string values)
|
|
12
|
+
*/
|
|
13
|
+
export type ExperimentDefaultValue<ExperimentName extends keyof EditorExperimentsConfig> = EditorExperimentsConfig[ExperimentName]['defaultValue'] extends boolean ? false : EditorExperimentsConfig[ExperimentName]['defaultValue'];
|
|
2
14
|
/**
|
|
3
15
|
* When adding a new experiment, you need to add it here.
|
|
4
16
|
* Please follow the pattern established in the examples and any
|
|
@@ -288,12 +300,6 @@ export declare const editorExperimentsConfig: {
|
|
|
288
300
|
param: string;
|
|
289
301
|
productKeys?: import("./types").ProductKeys;
|
|
290
302
|
};
|
|
291
|
-
platform_editor_no_ssr: {
|
|
292
|
-
typeGuard: typeof import("./type-guards").isBoolean;
|
|
293
|
-
defaultValue: boolean;
|
|
294
|
-
param: string;
|
|
295
|
-
productKeys?: import("./types").ProductKeys;
|
|
296
|
-
};
|
|
297
303
|
platform_editor_jira_advanced_code_blocks: {
|
|
298
304
|
typeGuard: typeof import("./type-guards").isBoolean;
|
|
299
305
|
defaultValue: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type EditorExperimentsConfig } from './experiments-config';
|
|
1
|
+
import { type EditorExperimentsConfig, type ExperimentDefaultValue, type ExperimentExpectedValue } from './experiments-config';
|
|
2
2
|
/**
|
|
3
3
|
* Check the value if an editor experiment without firing exposure.
|
|
4
4
|
*
|
|
@@ -22,9 +22,9 @@ import { type EditorExperimentsConfig } from './experiments-config';
|
|
|
22
22
|
*
|
|
23
23
|
* @param experimentName - experiment key
|
|
24
24
|
* @param experimentParam - the name of the parameter to fetch from the experiment config
|
|
25
|
-
* @param experimentExpectedValue - expected value to compare with
|
|
26
|
-
* @param experimentDefaultValue - default value to use if the experiment is not defined.
|
|
25
|
+
* @param experimentExpectedValue - expected value to compare with. Can't use false for boolean experiments or invalid values for multivariate experiments.
|
|
26
|
+
* @param experimentDefaultValue - default value to use if the experiment is not defined. Can't use true for boolean experiments or invalid values for multivariate experiments.
|
|
27
27
|
*
|
|
28
28
|
* @returns boolean
|
|
29
29
|
*/
|
|
30
|
-
export declare function expValEqualsNoExposure<ExperimentName extends keyof EditorExperimentsConfig>(experimentName: ExperimentName, experimentParam: EditorExperimentsConfig[ExperimentName]['param'], experimentExpectedValue:
|
|
30
|
+
export declare function expValEqualsNoExposure<ExperimentName extends keyof EditorExperimentsConfig>(experimentName: ExperimentName, experimentParam: EditorExperimentsConfig[ExperimentName]['param'], experimentExpectedValue: ExperimentExpectedValue<ExperimentName>, experimentDefaultValue?: ExperimentDefaultValue<ExperimentName> | null): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type EditorExperimentsConfig } from './experiments-config';
|
|
1
|
+
import { type EditorExperimentsConfig, type ExperimentDefaultValue, type ExperimentExpectedValue } from './experiments-config';
|
|
2
2
|
/**
|
|
3
3
|
* Check the value if an editor experiment and fire exposure.
|
|
4
4
|
*
|
|
@@ -22,9 +22,9 @@ import { type EditorExperimentsConfig } from './experiments-config';
|
|
|
22
22
|
*
|
|
23
23
|
* @param experimentName - experiment key
|
|
24
24
|
* @param experimentParam - the name of the parameter to fetch from the experiment config
|
|
25
|
-
* @param experimentExpectedValue - expected value to compare with
|
|
26
|
-
* @param experimentDefaultValue - default value to use if the experiment is not defined.
|
|
25
|
+
* @param experimentExpectedValue - expected value to compare with. Can't use false for boolean experiments or invalid values for multivariate experiments.
|
|
26
|
+
* @param experimentDefaultValue - default value to use if the experiment is not defined. Can't use true for boolean experiments or invalid values for multivariate experiments.
|
|
27
27
|
*
|
|
28
28
|
* @returns boolean
|
|
29
29
|
*/
|
|
30
|
-
export declare function expValEquals<ExperimentName extends keyof EditorExperimentsConfig>(experimentName: ExperimentName, experimentParam: EditorExperimentsConfig[ExperimentName]['param'], experimentExpectedValue:
|
|
30
|
+
export declare function expValEquals<ExperimentName extends keyof EditorExperimentsConfig>(experimentName: ExperimentName, experimentParam: EditorExperimentsConfig[ExperimentName]['param'], experimentExpectedValue: ExperimentExpectedValue<ExperimentName>, experimentDefaultValue?: ExperimentDefaultValue<ExperimentName> | null): boolean;
|
|
@@ -6,16 +6,15 @@ import { type EditorExperimentsConfig } from './experiments-config';
|
|
|
6
6
|
* - is not being served to the client (ie. pre start)
|
|
7
7
|
* - or is not configured in experiments-config
|
|
8
8
|
*
|
|
9
|
-
* If you need to check a param value without an exposure check see {@link
|
|
9
|
+
* If you need to check a param value without an exposure check see {@link expValNoExposure}
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
12
|
* ```ts
|
|
13
|
-
* const delay =
|
|
13
|
+
* const delay = expVal('experiment-name', 'param-name', defaultValue)
|
|
14
14
|
* await new Promise(res => setTimeout(res, delay)
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
|
-
export declare function expVal<ExperimentName extends keyof EditorExperimentsConfig, DefaultValue extends string | number | boolean>(experimentName: ExperimentName, experimentParam: string, defaultValue: DefaultValue): DefaultValue;
|
|
18
|
-
/**
|
|
17
|
+
export declare function expVal<ExperimentName extends keyof EditorExperimentsConfig, DefaultValue extends string | number | boolean>(experimentName: ExperimentName, experimentParam: string, defaultValue: DefaultValue extends boolean ? false : DefaultValue): DefaultValue; /**
|
|
19
18
|
* Use to check a any param value for an experiment without firing an exposure event
|
|
20
19
|
*
|
|
21
20
|
* **Note**: this will return the default value when the experiment;
|
|
@@ -28,4 +27,4 @@ export declare function expVal<ExperimentName extends keyof EditorExperimentsCon
|
|
|
28
27
|
* await new Promise(res => setTimeout(res, delay)
|
|
29
28
|
* ```
|
|
30
29
|
*/
|
|
31
|
-
export declare function expValNoExposure<ExperimentName extends keyof EditorExperimentsConfig, DefaultValue extends string | number | boolean>(experimentName: ExperimentName, experimentParam: string, defaultValue: DefaultValue): DefaultValue;
|
|
30
|
+
export declare function expValNoExposure<ExperimentName extends keyof EditorExperimentsConfig, DefaultValue extends string | number | boolean>(experimentName: ExperimentName, experimentParam: string, defaultValue: DefaultValue extends boolean ? false : DefaultValue): DefaultValue;
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
export type EditorExperimentsConfig = typeof editorExperimentsConfig;
|
|
2
|
+
/**
|
|
3
|
+
* Extract valid expected values.
|
|
4
|
+
* - For multivariate experiments: returns union of valid string values (inferred from defaultValue type)
|
|
5
|
+
* - For boolean experiments: returns only 'true' literal (cannot use 'false' as expected value)
|
|
6
|
+
*/
|
|
7
|
+
export type ExperimentExpectedValue<ExperimentName extends keyof EditorExperimentsConfig> = EditorExperimentsConfig[ExperimentName]['defaultValue'] extends boolean ? true : EditorExperimentsConfig[ExperimentName]['defaultValue'];
|
|
8
|
+
/**
|
|
9
|
+
* Extract valid default values.
|
|
10
|
+
* - For boolean experiments: returns only 'false' literal (cannot use 'true' as default value)
|
|
11
|
+
* - For multivariate experiments: returns the default value type (one of the string values)
|
|
12
|
+
*/
|
|
13
|
+
export type ExperimentDefaultValue<ExperimentName extends keyof EditorExperimentsConfig> = EditorExperimentsConfig[ExperimentName]['defaultValue'] extends boolean ? false : EditorExperimentsConfig[ExperimentName]['defaultValue'];
|
|
2
14
|
/**
|
|
3
15
|
* When adding a new experiment, you need to add it here.
|
|
4
16
|
* Please follow the pattern established in the examples and any
|
|
@@ -288,12 +300,6 @@ export declare const editorExperimentsConfig: {
|
|
|
288
300
|
param: string;
|
|
289
301
|
productKeys?: import("./types").ProductKeys;
|
|
290
302
|
};
|
|
291
|
-
platform_editor_no_ssr: {
|
|
292
|
-
typeGuard: typeof import("./type-guards").isBoolean;
|
|
293
|
-
defaultValue: boolean;
|
|
294
|
-
param: string;
|
|
295
|
-
productKeys?: import("./types").ProductKeys;
|
|
296
|
-
};
|
|
297
303
|
platform_editor_jira_advanced_code_blocks: {
|
|
298
304
|
typeGuard: typeof import("./type-guards").isBoolean;
|
|
299
305
|
defaultValue: boolean;
|
package/package.json
CHANGED