@ops-ai/vue-feature-flags-toggly 1.0.0 → 1.0.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/README.md +47 -26
- package/dist/vue-feature-flags-toggly.es.js +69 -70
- package/dist/vue-feature-flags-toggly.umd.js +1 -1
- package/package.json +1 -1
- package/dist/types/App.vue.d.ts +0 -2
- package/dist/types/components/Feature.vue.d.ts +0 -40
- package/dist/types/components/HelloWorld.vue.d.ts +0 -15
- package/dist/types/index.d.ts +0 -2
- package/dist/types/main.d.ts +0 -1
- package/dist/types/toggly.d.ts +0 -22
- package/dist/vite.config.d.ts +0 -2
package/README.md
CHANGED
|
@@ -18,24 +18,36 @@ $ npm i -s @ops-ai/vue-feature-flags-toggly
|
|
|
18
18
|
|
|
19
19
|
## Basic Usage (with Toggly.io)
|
|
20
20
|
|
|
21
|
-
Import the Toggly
|
|
21
|
+
Import the Toggly plugin in your main file.
|
|
22
22
|
|
|
23
23
|
```js
|
|
24
|
-
import toggly from
|
|
24
|
+
import { toggly } from "@ops-ai/vue-feature-flags-toggly";
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
Install the toggly plugin while providing your App Key & Environment name from your [Toggly application page](https://app.toggly.io). This will register the Feature component & $toggly service globally.
|
|
28
28
|
|
|
29
29
|
```js
|
|
30
|
-
app.
|
|
31
|
-
app.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
'unique-user-identifier' // Use this in case you want to support custom feature rollouts
|
|
35
|
-
)
|
|
30
|
+
app.use(toggly, {
|
|
31
|
+
appKey: "your-app-key", // You can find this in app.toggly.io
|
|
32
|
+
environment: "your-environment-name", // You can find this in app.toggly.io
|
|
33
|
+
});
|
|
36
34
|
```
|
|
37
35
|
|
|
38
|
-
|
|
36
|
+
Using this package with [Toggly](https://toggly.io) allows you to define custom feature rollouts.
|
|
37
|
+
|
|
38
|
+
Custom rollouts offers the ability to show features only to certain groups of users based on various custom rules which you can define in [Toggly](https://app.toggly.io).
|
|
39
|
+
|
|
40
|
+
In case you want to support custom feature rollouts, remember to provide an unique identity string for each user to make sure they get the same feature values on future visits.
|
|
41
|
+
|
|
42
|
+
```js
|
|
43
|
+
app.use(toggly, {
|
|
44
|
+
appKey: "your-app-key", // You can find this in app.toggly.io
|
|
45
|
+
environment: "your-environment-name", // You can find this in app.toggly.io
|
|
46
|
+
identity: "unique-user-identifier", // Use this in case you want to support custom feature rollouts
|
|
47
|
+
});
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Now you can start using the Feature component anywhere in your application.
|
|
39
51
|
|
|
40
52
|
```html
|
|
41
53
|
<Feature feature-key="firstFeature">
|
|
@@ -63,7 +75,14 @@ You can also check multiple feature keys and make use of the *requirement* (all/
|
|
|
63
75
|
</Feature>
|
|
64
76
|
```
|
|
65
77
|
|
|
66
|
-
Lastly, you can use *$toggly* to check if a feature is ON or OFF programmatically.
|
|
78
|
+
Lastly, you can use the *$toggly* service to check if a feature is ON or OFF programmatically, by simply injecting it in any component.
|
|
79
|
+
|
|
80
|
+
```js
|
|
81
|
+
export default {
|
|
82
|
+
inject: ['$toggly'],
|
|
83
|
+
...
|
|
84
|
+
}
|
|
85
|
+
```
|
|
67
86
|
|
|
68
87
|
```js
|
|
69
88
|
await this.$toggly.isFeatureOn('firstFeature')
|
|
@@ -76,36 +95,31 @@ await this.$toggly.isFeatureOff('secondFeature')
|
|
|
76
95
|
And even evaluate a feature gate (with requirement & negate support).
|
|
77
96
|
|
|
78
97
|
```js
|
|
79
|
-
await this.$toggly.evaluateFeatureGate('firstFeature', 'secondFeature'], 'any', true)
|
|
98
|
+
await this.$toggly.evaluateFeatureGate(['firstFeature', 'secondFeature'], 'any', true)
|
|
80
99
|
```
|
|
81
100
|
|
|
82
101
|
## Basic Usage (without Toggly.io)
|
|
83
102
|
|
|
84
|
-
Import the Toggly
|
|
103
|
+
Import the Toggly plugin in your main file.
|
|
85
104
|
|
|
86
105
|
```js
|
|
87
|
-
import toggly from
|
|
106
|
+
import { toggly } from "@ops-ai/vue-feature-flags-toggly";
|
|
88
107
|
```
|
|
89
108
|
|
|
90
|
-
|
|
109
|
+
Install the toggly plugin while providing your default feature flags. This will register the Feature component & $toggly service globally.
|
|
91
110
|
|
|
92
111
|
```js
|
|
93
|
-
|
|
94
|
-
var featureFlagDefaults = {
|
|
112
|
+
var featureDefaults = {
|
|
95
113
|
firstFeature: true,
|
|
96
114
|
secondFeature: false,
|
|
97
115
|
}
|
|
98
116
|
|
|
99
|
-
app.
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
null, // No need for an evironment name
|
|
103
|
-
null, // Custom rollouts are not supported without Toggly.io
|
|
104
|
-
featureFlagDefaults
|
|
105
|
-
)
|
|
117
|
+
app.use(toggly, {
|
|
118
|
+
featureDefaults: featureDefaults,
|
|
119
|
+
});
|
|
106
120
|
```
|
|
107
121
|
|
|
108
|
-
Now you can start using the Feature component.
|
|
122
|
+
Now you can start using the Feature component anywhere in your application.
|
|
109
123
|
|
|
110
124
|
```html
|
|
111
125
|
<Feature feature-key="firstFeature">
|
|
@@ -133,7 +147,14 @@ You can also check multiple feature keys and make use of the *requirement* (all/
|
|
|
133
147
|
</Feature>
|
|
134
148
|
```
|
|
135
149
|
|
|
136
|
-
Lastly, you can use *$toggly* to check if a feature is ON or OFF programmatically.
|
|
150
|
+
Lastly, you can use the *$toggly* service to check if a feature is ON or OFF programmatically, by simply injecting it in any component.
|
|
151
|
+
|
|
152
|
+
```js
|
|
153
|
+
export default {
|
|
154
|
+
inject: ['$toggly'],
|
|
155
|
+
...
|
|
156
|
+
}
|
|
157
|
+
```
|
|
137
158
|
|
|
138
159
|
```js
|
|
139
160
|
await this.$toggly.isFeatureOn('firstFeature')
|
|
@@ -1,73 +1,23 @@
|
|
|
1
|
-
import { openBlock as o, createElementBlock as u, renderSlot as l, createCommentVNode as
|
|
2
|
-
|
|
3
|
-
props: {
|
|
4
|
-
featureKey: {
|
|
5
|
-
type: String
|
|
6
|
-
},
|
|
7
|
-
featureKeys: {
|
|
8
|
-
type: Array
|
|
9
|
-
},
|
|
10
|
-
requirement: {
|
|
11
|
-
type: String,
|
|
12
|
-
default: "all"
|
|
13
|
-
},
|
|
14
|
-
negate: {
|
|
15
|
-
type: Boolean,
|
|
16
|
-
default: !1
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
data() {
|
|
20
|
-
return {
|
|
21
|
-
shouldShow: !1,
|
|
22
|
-
isLoading: !1
|
|
23
|
-
};
|
|
24
|
-
},
|
|
25
|
-
mounted() {
|
|
26
|
-
this.checkIfShouldShow();
|
|
27
|
-
},
|
|
28
|
-
methods: {
|
|
29
|
-
async checkIfShouldShow() {
|
|
30
|
-
this.isLoading = !0;
|
|
31
|
-
var s = [];
|
|
32
|
-
this.featureKey && s.push(this.featureKey), this.featureKeys && (s = s.concat(this.featureKeys)), this.shouldShow = s.length > 0 ? await this.$toggly.evaluateFeatureGate(s, this.requirement, this.negate) : !0, this.isLoading = !1;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}, c = (s, e) => {
|
|
36
|
-
const t = s.__vccOpts || s;
|
|
37
|
-
for (const [i, a] of e)
|
|
38
|
-
t[i] = a;
|
|
39
|
-
return t;
|
|
40
|
-
}, d = { key: 0 };
|
|
41
|
-
function g(s, e, t, i, a, n) {
|
|
42
|
-
return a.shouldShow ? (o(), u("div", d, [
|
|
43
|
-
l(s.$slots, "default")
|
|
44
|
-
])) : f("", !0);
|
|
45
|
-
}
|
|
46
|
-
const p = /* @__PURE__ */ c(h, [["render", g]]);
|
|
47
|
-
class _ {
|
|
1
|
+
import { openBlock as o, createElementBlock as u, renderSlot as l, createCommentVNode as h } from "vue";
|
|
2
|
+
class f {
|
|
48
3
|
_config = {
|
|
49
4
|
baseURI: "https://client.toggly.io",
|
|
50
|
-
|
|
51
|
-
environment: null
|
|
5
|
+
showFeatureDuringEvaluation: !1
|
|
52
6
|
};
|
|
53
|
-
_featureDefaults = null;
|
|
54
7
|
_features = null;
|
|
55
8
|
_loadingFeatures = !1;
|
|
56
|
-
|
|
57
|
-
init =
|
|
9
|
+
shouldShowFeatureDuringEvaluation;
|
|
10
|
+
init = (e) => (e.appKey ? e.environment || (e.environment = "Production", console.warn(
|
|
58
11
|
"Toggly --- Using Production environment as no environment provided when initializing the Toggly"
|
|
59
|
-
)) :
|
|
12
|
+
)) : e.featureDefaults ? (this._features = e.featureDefaults ?? {}, console.warn(
|
|
60
13
|
"Toggly --- Using feature defaults as no application key provided when initializing the Toggly"
|
|
61
14
|
)) : console.warn(
|
|
62
15
|
"Toggly --- A valid application key is required to connect to your Toggly.io application for evaluating your features."
|
|
63
|
-
), this._config = Object.assign({}, this._config,
|
|
64
|
-
appKey: e,
|
|
65
|
-
environment: t
|
|
66
|
-
}), this._featureDefaults = a, this._features || await this._loadFeatures(), this);
|
|
16
|
+
), this._config = Object.assign({}, this._config, e), this.shouldShowFeatureDuringEvaluation = this._config.showFeatureDuringEvaluation, this);
|
|
67
17
|
_loadFeatures = async () => {
|
|
68
|
-
if (this._loadingFeatures && await new Promise((
|
|
18
|
+
if (this._loadingFeatures && await new Promise((a) => {
|
|
69
19
|
const i = () => {
|
|
70
|
-
this._loadingFeatures ? setTimeout(i, 100) :
|
|
20
|
+
this._loadingFeatures ? setTimeout(i, 100) : a();
|
|
71
21
|
};
|
|
72
22
|
i();
|
|
73
23
|
}), this._features !== null)
|
|
@@ -75,11 +25,11 @@ class _ {
|
|
|
75
25
|
this._loadingFeatures = !0;
|
|
76
26
|
try {
|
|
77
27
|
var e = `${this._config.baseURI}/${this._config.appKey}-${this._config.environment}/defs`;
|
|
78
|
-
this.
|
|
79
|
-
const
|
|
80
|
-
this._features = await
|
|
28
|
+
this._config.identity && (e += `?u=${this._config.identity}`);
|
|
29
|
+
const a = await fetch(e);
|
|
30
|
+
this._features = await a.json();
|
|
81
31
|
} catch {
|
|
82
|
-
this._features = this.
|
|
32
|
+
this._features = this._config.featureDefaults ?? {}, console.warn(
|
|
83
33
|
"Toggly --- Using feature defaults as features could not be loaded from the Toggly API"
|
|
84
34
|
);
|
|
85
35
|
} finally {
|
|
@@ -88,18 +38,67 @@ class _ {
|
|
|
88
38
|
return this._features;
|
|
89
39
|
};
|
|
90
40
|
_featuresLoaded = async () => this._features ?? await this._loadFeatures();
|
|
91
|
-
_evaluateFeatureGate = async (e,
|
|
41
|
+
_evaluateFeatureGate = async (e, a = "all", i = !1) => {
|
|
92
42
|
if (await this._featuresLoaded(), !this._features || Object.keys(this._features).length === 0)
|
|
93
43
|
return !0;
|
|
94
|
-
var
|
|
95
|
-
return
|
|
44
|
+
var s;
|
|
45
|
+
return a === "any" ? s = e.reduce((n, r) => n || this._features[r] && this._features[r] === !0, !1) : s = e.reduce((n, r) => n && this._features[r] && this._features[r] === !0, !0), s = i ? !s : s, s;
|
|
96
46
|
};
|
|
97
|
-
evaluateFeatureGate = async (e,
|
|
47
|
+
evaluateFeatureGate = async (e, a = "all", i = !1) => await this._evaluateFeatureGate(e, a, i);
|
|
98
48
|
isFeatureOn = async (e) => await this._evaluateFeatureGate([e]);
|
|
99
49
|
isFeatureOff = async (e) => await this._evaluateFeatureGate([e], "all", !0);
|
|
100
50
|
}
|
|
101
|
-
const
|
|
51
|
+
const g = new f(), c = {
|
|
52
|
+
inject: ["$toggly"],
|
|
53
|
+
props: {
|
|
54
|
+
featureKey: {
|
|
55
|
+
type: String
|
|
56
|
+
},
|
|
57
|
+
featureKeys: {
|
|
58
|
+
type: Array
|
|
59
|
+
},
|
|
60
|
+
requirement: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: "all"
|
|
63
|
+
},
|
|
64
|
+
negate: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: !1
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
data() {
|
|
70
|
+
return {
|
|
71
|
+
shouldShow: !1,
|
|
72
|
+
isLoading: !1
|
|
73
|
+
};
|
|
74
|
+
},
|
|
75
|
+
mounted() {
|
|
76
|
+
this.checkIfShouldShow();
|
|
77
|
+
},
|
|
78
|
+
methods: {
|
|
79
|
+
async checkIfShouldShow() {
|
|
80
|
+
this.isLoading = !0, this.shouldShow = this.$toggly.shouldShowFeatureDuringEvaluation;
|
|
81
|
+
var t = [];
|
|
82
|
+
this.featureKey && t.push(this.featureKey), this.featureKeys && (t = t.concat(this.featureKeys)), this.shouldShow = t.length > 0 ? await this.$toggly.evaluateFeatureGate(t, this.requirement, this.negate) : !0, this.isLoading = !1;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}, d = (t, e) => {
|
|
86
|
+
const a = t.__vccOpts || t;
|
|
87
|
+
for (const [i, s] of e)
|
|
88
|
+
a[i] = s;
|
|
89
|
+
return a;
|
|
90
|
+
}, _ = { key: 0 };
|
|
91
|
+
function y(t, e, a, i, s, n) {
|
|
92
|
+
return s.shouldShow ? (o(), u("div", _, [
|
|
93
|
+
l(t.$slots, "default")
|
|
94
|
+
])) : h("", !0);
|
|
95
|
+
}
|
|
96
|
+
const w = /* @__PURE__ */ d(c, [["render", y]]), p = {
|
|
97
|
+
install: (t, e) => {
|
|
98
|
+
const a = g.init(e);
|
|
99
|
+
t.provide("$toggly", a), t.component("Feature", w);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
102
|
export {
|
|
103
|
-
p as
|
|
104
|
-
w as toggly
|
|
103
|
+
p as toggly
|
|
105
104
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(n
|
|
1
|
+
(function(r,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],n):(r=typeof globalThis<"u"?globalThis:r||self,n(r.VueFeatureFlagsToggly={},r.Vue))})(this,function(r,n){"use strict";class l{_config={baseURI:"https://client.toggly.io",showFeatureDuringEvaluation:!1};_features=null;_loadingFeatures=!1;shouldShowFeatureDuringEvaluation;init=e=>(e.appKey?e.environment||(e.environment="Production",console.warn("Toggly --- Using Production environment as no environment provided when initializing the Toggly")):e.featureDefaults?(this._features=e.featureDefaults??{},console.warn("Toggly --- Using feature defaults as no application key provided when initializing the Toggly")):console.warn("Toggly --- A valid application key is required to connect to your Toggly.io application for evaluating your features."),this._config=Object.assign({},this._config,e),this.shouldShowFeatureDuringEvaluation=this._config.showFeatureDuringEvaluation,this);_loadFeatures=async()=>{if(this._loadingFeatures&&await new Promise(a=>{const s=()=>{this._loadingFeatures?setTimeout(s,100):a()};s()}),this._features!==null)return this._features;this._loadingFeatures=!0;try{var e=`${this._config.baseURI}/${this._config.appKey}-${this._config.environment}/defs`;this._config.identity&&(e+=`?u=${this._config.identity}`);const a=await fetch(e);this._features=await a.json()}catch{this._features=this._config.featureDefaults??{},console.warn("Toggly --- Using feature defaults as features could not be loaded from the Toggly API")}finally{this._loadingFeatures=!1}return this._features};_featuresLoaded=async()=>this._features??await this._loadFeatures();_evaluateFeatureGate=async(e,a="all",s=!1)=>{if(await this._featuresLoaded(),!this._features||Object.keys(this._features).length===0)return!0;var i;return a==="any"?i=e.reduce((u,o)=>u||this._features[o]&&this._features[o]===!0,!1):i=e.reduce((u,o)=>u&&this._features[o]&&this._features[o]===!0,!0),i=s?!i:i,i};evaluateFeatureGate=async(e,a="all",s=!1)=>await this._evaluateFeatureGate(e,a,s);isFeatureOn=async e=>await this._evaluateFeatureGate([e]);isFeatureOff=async e=>await this._evaluateFeatureGate([e],"all",!0)}const f=new l,h={inject:["$toggly"],props:{featureKey:{type:String},featureKeys:{type:Array},requirement:{type:String,default:"all"},negate:{type:Boolean,default:!1}},data(){return{shouldShow:!1,isLoading:!1}},mounted(){this.checkIfShouldShow()},methods:{async checkIfShouldShow(){this.isLoading=!0,this.shouldShow=this.$toggly.shouldShowFeatureDuringEvaluation;var t=[];this.featureKey&&t.push(this.featureKey),this.featureKeys&&(t=t.concat(this.featureKeys)),this.shouldShow=t.length>0?await this.$toggly.evaluateFeatureGate(t,this.requirement,this.negate):!0,this.isLoading=!1}}},g=(t,e)=>{const a=t.__vccOpts||t;for(const[s,i]of e)a[s]=i;return a},c={key:0};function d(t,e,a,s,i,u){return i.shouldShow?(n.openBlock(),n.createElementBlock("div",c,[n.renderSlot(t.$slots,"default")])):n.createCommentVNode("",!0)}const y=g(h,[["render",d]]),_={install:(t,e)=>{const a=f.init(e);t.provide("$toggly",a),t.component("Feature",y)}};r.toggly=_,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"test": "exit 0"
|
|
35
35
|
},
|
|
36
36
|
"name": "@ops-ai/vue-feature-flags-toggly",
|
|
37
|
-
"version": "1.0.
|
|
37
|
+
"version": "1.0.1",
|
|
38
38
|
"description": "Provides feature flags support for Vue.js applications allowing you to enable and disable features easily. Can be used with or without Toggly.io.",
|
|
39
39
|
"type": "module",
|
|
40
40
|
"dependencies": {
|
package/dist/types/App.vue.d.ts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
-
export default _default;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{
|
|
2
|
-
featureKey: {
|
|
3
|
-
type: StringConstructor;
|
|
4
|
-
};
|
|
5
|
-
featureKeys: {
|
|
6
|
-
type: ArrayConstructor;
|
|
7
|
-
};
|
|
8
|
-
requirement: {
|
|
9
|
-
type: StringConstructor;
|
|
10
|
-
default: string;
|
|
11
|
-
};
|
|
12
|
-
negate: {
|
|
13
|
-
type: BooleanConstructor;
|
|
14
|
-
default: boolean;
|
|
15
|
-
};
|
|
16
|
-
}, unknown, {
|
|
17
|
-
shouldShow: boolean;
|
|
18
|
-
isLoading: boolean;
|
|
19
|
-
}, {}, {
|
|
20
|
-
checkIfShouldShow(): Promise<void>;
|
|
21
|
-
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
22
|
-
featureKey: {
|
|
23
|
-
type: StringConstructor;
|
|
24
|
-
};
|
|
25
|
-
featureKeys: {
|
|
26
|
-
type: ArrayConstructor;
|
|
27
|
-
};
|
|
28
|
-
requirement: {
|
|
29
|
-
type: StringConstructor;
|
|
30
|
-
default: string;
|
|
31
|
-
};
|
|
32
|
-
negate: {
|
|
33
|
-
type: BooleanConstructor;
|
|
34
|
-
default: boolean;
|
|
35
|
-
};
|
|
36
|
-
}>>, {
|
|
37
|
-
requirement: string;
|
|
38
|
-
negate: boolean;
|
|
39
|
-
}>;
|
|
40
|
-
export default _default;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
2
|
-
msg: string;
|
|
3
|
-
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
4
|
-
msg: string;
|
|
5
|
-
}>>>, {}>;
|
|
6
|
-
export default _default;
|
|
7
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
8
|
-
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
9
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
10
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
11
|
-
} : {
|
|
12
|
-
type: import('vue').PropType<T[K]>;
|
|
13
|
-
required: true;
|
|
14
|
-
};
|
|
15
|
-
};
|
package/dist/types/index.d.ts
DELETED
package/dist/types/main.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './style.css';
|
package/dist/types/toggly.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export declare class Toggly {
|
|
2
|
-
private _config;
|
|
3
|
-
private _featureDefaults;
|
|
4
|
-
private _features;
|
|
5
|
-
private _loadingFeatures;
|
|
6
|
-
private _identity;
|
|
7
|
-
init: (appKey: string, environment: string, identity: string, featureDefaults?: {
|
|
8
|
-
[key: string]: boolean;
|
|
9
|
-
} | null) => Promise<this>;
|
|
10
|
-
_loadFeatures: () => Promise<{
|
|
11
|
-
[key: string]: boolean;
|
|
12
|
-
} | null>;
|
|
13
|
-
_featuresLoaded: () => Promise<{
|
|
14
|
-
[key: string]: boolean;
|
|
15
|
-
} | null>;
|
|
16
|
-
_evaluateFeatureGate: (gate: string[], requirement?: string, negate?: boolean) => Promise<any>;
|
|
17
|
-
evaluateFeatureGate: (featureKeys: string[], requirement?: string, negate?: boolean) => Promise<any>;
|
|
18
|
-
isFeatureOn: (featureKey: string) => Promise<any>;
|
|
19
|
-
isFeatureOff: (featureKey: string) => Promise<any>;
|
|
20
|
-
}
|
|
21
|
-
declare const toggly: Toggly;
|
|
22
|
-
export default toggly;
|
package/dist/vite.config.d.ts
DELETED