@ops-ai/vue-feature-flags-toggly 1.0.0 → 1.0.2

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 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 service inside your main.js file.
21
+ Import the Toggly plugin in your main file.
22
22
 
23
23
  ```js
24
- import toggly from './toggly'
24
+ import { toggly } from "@ops-ai/vue-feature-flags-toggly";
25
25
  ```
26
26
 
27
- Declare $toggly as a global property & initialize it by running the $toggly.init method and by providing your App Key from your [Toggly application page](https://app.toggly.io)
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.config.globalProperties.$toggly = toggly
31
- app.config.globalProperties.$toggly.init(
32
- 'your-app-key', // You can find this in Toggly.io
33
- 'your-environment-name', // You can find this in Toggly.io
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
- Now you can start using the Feature component.
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 service inside your main.js file.
103
+ Import the Toggly plugin in your main file.
85
104
 
86
105
  ```js
87
- import toggly from './toggly'
106
+ import { toggly } from "@ops-ai/vue-feature-flags-toggly";
88
107
  ```
89
108
 
90
- Declare $toggly as a global property & initialize it by running the $toggly.init method and by providing your App Key from your [Toggly application page](https://app.toggly.io)
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.config.globalProperties.$toggly = toggly
100
- app.config.globalProperties.$toggly.init(
101
- null, // No need for an application key
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,2 +1 @@
1
- export { default as Feature } from './components/Feature.vue';
2
- export { default as toggly } from './toggly';
1
+ export { default as toggly } from './plugins/toggly';
@@ -0,0 +1,5 @@
1
+ import { TogglyOptions } from './toggly.service';
2
+ declare const _default: {
3
+ install: (app: any, options: TogglyOptions) => void;
4
+ };
5
+ export default _default;
@@ -0,0 +1,45 @@
1
+ export interface TogglyOptions {
2
+ baseURI?: string;
3
+ appKey?: string;
4
+ environment?: string;
5
+ identity?: string;
6
+ featureDefaults?: {
7
+ [key: string]: boolean;
8
+ };
9
+ showFeatureDuringEvaluation?: boolean;
10
+ }
11
+ export interface TogglyService {
12
+ shouldShowFeatureDuringEvaluation: boolean;
13
+ init: (options: TogglyOptions) => this;
14
+ _loadFeatures: () => Promise<{
15
+ [key: string]: boolean;
16
+ } | null>;
17
+ _featuresLoaded: () => Promise<{
18
+ [key: string]: boolean;
19
+ } | null>;
20
+ _evaluateFeatureGate: (gate: string[], requirement: string, negate: boolean) => Promise<boolean>;
21
+ evaluateFeatureGate: (featureKeys: string[], requirement: string, negate: boolean) => Promise<boolean>;
22
+ isFeatureOn: (featureKey: string) => Promise<boolean>;
23
+ isFeatureOff: (featureKey: string) => Promise<boolean>;
24
+ }
25
+ export declare class Toggly implements TogglyService {
26
+ private _config;
27
+ private _features;
28
+ private _loadingFeatures;
29
+ shouldShowFeatureDuringEvaluation: boolean;
30
+ init: (options: TogglyOptions) => this;
31
+ _loadFeatures: () => Promise<{
32
+ [key: string]: boolean;
33
+ } | null>;
34
+ _featuresLoaded: () => Promise<{
35
+ [key: string]: boolean;
36
+ } | null>;
37
+ _evaluateFeatureGate: (gate: string[], requirement?: string, negate?: boolean) => Promise<boolean>;
38
+ evaluateFeatureGate: (featureKeys: string[], requirement?: string, negate?: boolean) => Promise<boolean>;
39
+ isFeatureOn: (featureKey: string) => Promise<boolean>;
40
+ isFeatureOff: (featureKey: string) => Promise<boolean>;
41
+ setIdentity: (identity: string) => void;
42
+ clearIdentity: () => void;
43
+ }
44
+ declare const toggly: Toggly;
45
+ export default toggly;
@@ -1,85 +1,35 @@
1
- import { openBlock as o, createElementBlock as u, renderSlot as l, createCommentVNode as f } from "vue";
2
- const h = {
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
- appKey: null,
51
- environment: null
5
+ showFeatureDuringEvaluation: !1
52
6
  };
53
- _featureDefaults = null;
54
7
  _features = null;
55
8
  _loadingFeatures = !1;
56
- _identity = null;
57
- init = async (e, t, i, a = null) => (e ? t || (t = "Production", console.warn(
9
+ shouldShowFeatureDuringEvaluation = !1;
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
- )) : a ? (this._features = a, console.warn(
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((t) => {
69
- const i = () => {
70
- this._loadingFeatures ? setTimeout(i, 100) : t();
18
+ if (this._loadingFeatures && await new Promise((a) => {
19
+ const s = () => {
20
+ this._loadingFeatures ? setTimeout(s, 100) : a();
71
21
  };
72
- i();
22
+ s();
73
23
  }), this._features !== null)
74
24
  return this._features;
75
25
  this._loadingFeatures = !0;
76
26
  try {
77
27
  var e = `${this._config.baseURI}/${this._config.appKey}-${this._config.environment}/defs`;
78
- this._identity && (e += `?u=${this._identity}`);
79
- const t = await fetch(e);
80
- this._features = await t.json();
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._featureDefaults ?? {}, console.warn(
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,73 @@ class _ {
88
38
  return this._features;
89
39
  };
90
40
  _featuresLoaded = async () => this._features ?? await this._loadFeatures();
91
- _evaluateFeatureGate = async (e, t = "all", i = !1) => {
41
+ _evaluateFeatureGate = async (e, a = "all", s = !1) => {
92
42
  if (await this._featuresLoaded(), !this._features || Object.keys(this._features).length === 0)
93
43
  return !0;
94
- var a;
95
- return t === "any" ? a = e.reduce((n, r) => n || this._features[r] && this._features[r] === !0, !1) : a = e.reduce((n, r) => n && this._features[r] && this._features[r] === !0, !0), a = i ? !a : a, a;
44
+ var i;
45
+ return a === "any" ? i = e.reduce((r, n) => r || this._features[n] && this._features[n] === !0, !1) : i = e.reduce((r, n) => r && this._features[n] && this._features[n] === !0, !0), i = s ? !i : i, i;
96
46
  };
97
- evaluateFeatureGate = async (e, t = "all", i = !1) => await this._evaluateFeatureGate(e, t, i);
47
+ evaluateFeatureGate = async (e, a = "all", s = !1) => await this._evaluateFeatureGate(e, a, s);
98
48
  isFeatureOn = async (e) => await this._evaluateFeatureGate([e]);
99
49
  isFeatureOff = async (e) => await this._evaluateFeatureGate([e], "all", !0);
50
+ setIdentity = (e) => {
51
+ this._features = null, this._config.identity = e;
52
+ };
53
+ clearIdentity = () => {
54
+ this._features = null, this._config.identity = void 0;
55
+ };
100
56
  }
101
- const w = new _();
57
+ const c = new f(), g = {
58
+ inject: ["$toggly"],
59
+ props: {
60
+ featureKey: {
61
+ type: String
62
+ },
63
+ featureKeys: {
64
+ type: Array
65
+ },
66
+ requirement: {
67
+ type: String,
68
+ default: "all"
69
+ },
70
+ negate: {
71
+ type: Boolean,
72
+ default: !1
73
+ }
74
+ },
75
+ data() {
76
+ return {
77
+ shouldShow: !1,
78
+ isLoading: !1
79
+ };
80
+ },
81
+ mounted() {
82
+ this.checkIfShouldShow();
83
+ },
84
+ methods: {
85
+ async checkIfShouldShow() {
86
+ this.isLoading = !0, this.shouldShow = this.$toggly.shouldShowFeatureDuringEvaluation;
87
+ var t = [];
88
+ 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;
89
+ }
90
+ }
91
+ }, d = (t, e) => {
92
+ const a = t.__vccOpts || t;
93
+ for (const [s, i] of e)
94
+ a[s] = i;
95
+ return a;
96
+ }, _ = { key: 0 };
97
+ function y(t, e, a, s, i, r) {
98
+ return i.shouldShow ? (o(), u("div", _, [
99
+ l(t.$slots, "default")
100
+ ])) : h("", !0);
101
+ }
102
+ const v = /* @__PURE__ */ d(g, [["render", y]]), p = {
103
+ install: (t, e) => {
104
+ const a = c.init(e);
105
+ t.provide("$toggly", a), t.component("Feature", v);
106
+ }
107
+ };
102
108
  export {
103
- p as Feature,
104
- w as toggly
109
+ p as toggly
105
110
  };
@@ -1 +1 @@
1
- (function(n,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],r):(n=typeof globalThis<"u"?globalThis:n||self,r(n.VueFeatureFlagsToggly={},n.Vue))})(this,function(n,r){"use strict";const l={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;var s=[];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}}},f=(s,e)=>{const t=s.__vccOpts||s;for(const[i,a]of e)t[i]=a;return t},h={key:0};function c(s,e,t,i,a,u){return a.shouldShow?(r.openBlock(),r.createElementBlock("div",h,[r.renderSlot(s.$slots,"default")])):r.createCommentVNode("",!0)}const d=f(l,[["render",c]]);class g{_config={baseURI:"https://client.toggly.io",appKey:null,environment:null};_featureDefaults=null;_features=null;_loadingFeatures=!1;_identity=null;init=async(e,t,i,a=null)=>(e?t||(t="Production",console.warn("Toggly --- Using Production environment as no environment provided when initializing the Toggly")):a?(this._features=a,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,{appKey:e,environment:t}),this._featureDefaults=a,this._features||await this._loadFeatures(),this);_loadFeatures=async()=>{if(this._loadingFeatures&&await new Promise(t=>{const i=()=>{this._loadingFeatures?setTimeout(i,100):t()};i()}),this._features!==null)return this._features;this._loadingFeatures=!0;try{var e=`${this._config.baseURI}/${this._config.appKey}-${this._config.environment}/defs`;this._identity&&(e+=`?u=${this._identity}`);const t=await fetch(e);this._features=await t.json()}catch{this._features=this._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,t="all",i=!1)=>{if(await this._featuresLoaded(),!this._features||Object.keys(this._features).length===0)return!0;var a;return t==="any"?a=e.reduce((u,o)=>u||this._features[o]&&this._features[o]===!0,!1):a=e.reduce((u,o)=>u&&this._features[o]&&this._features[o]===!0,!0),a=i?!a:a,a};evaluateFeatureGate=async(e,t="all",i=!1)=>await this._evaluateFeatureGate(e,t,i);isFeatureOn=async e=>await this._evaluateFeatureGate([e]);isFeatureOff=async e=>await this._evaluateFeatureGate([e],"all",!0)}const _=new g;n.Feature=d,n.toggly=_,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
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=!1;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);setIdentity=e=>{this._features=null,this._config.identity=e};clearIdentity=()=>{this._features=null,this._config.identity=void 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.0",
37
+ "version": "1.0.2",
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": {
@@ -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,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
- };
@@ -1 +0,0 @@
1
- import './style.css';
@@ -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;