@@ -43,80 +43,34 @@ export class OpenFeatureClient implements Client {
4343 this . _context = context ;
4444 }
4545
46- /**
47- * Sets a logger on the client. This logger supersedes to the global logger
48- * and is passed to various components in the SDK.
49- *
50- * @param {Logger } logger The logger to to be used
51- * @returns {OpenFeatureClient } OpenFeature Client
52- */
5346 setLogger ( logger : Logger ) : OpenFeatureClient {
5447 this . _clientLogger = new SafeLogger ( logger ) ;
5548 return this ;
5649 }
57-
58- /**
59- * Sets evaluation context that will be used during flag evaluations
60- * on this client.
61- *
62- * @param {EvaluationContext } context Client evaluation context
63- * @returns {OpenFeatureClient } OpenFeature Client
64- */
50+
6551 setContext ( context : EvaluationContext ) : OpenFeatureClient {
6652 this . _context = context ;
6753 return this ;
6854 }
6955
70- /**
71- * Access the evaluation context set on the client.
72- *
73- * @returns {EvaluationContext } Client evaluation context
74- */
7556 getContext ( ) : EvaluationContext {
7657 return this . _context ;
7758 }
7859
79- /**
80- * Adds hooks that will run during flag evaluations on this client. Client
81- * hooks are executed in the order they were registered. Adding additional hooks
82- * will not remove existing hooks.
83- *
84- * @param {Hook<FlagValue>[] } hooks A list of hooks that should always run
85- * @returns {OpenFeatureClient } OpenFeature Client
86- */
8760 addHooks ( ...hooks : Hook < FlagValue > [ ] ) : OpenFeatureClient {
8861 this . _hooks = [ ...this . _hooks , ...hooks ] ;
8962 return this ;
9063 }
9164
92- /**
93- * Access all the hooks that are registered on this client.
94- *
95- * @returns {Hook<FlagValue>[] } A list of the client hooks
96- */
9765 getHooks ( ) : Hook < FlagValue > [ ] {
9866 return this . _hooks ;
9967 }
10068
101- /**
102- * Clears all the hooks that are registered on this client.
103- *
104- * @returns {OpenFeatureClient } OpenFeature Client
105- */
10669 clearHooks ( ) : OpenFeatureClient {
10770 this . _hooks = [ ] ;
10871 return this ;
10972 }
11073
111- /**
112- * Performs a flag evaluation that returns a boolean.
113- *
114- * @param {string } flagKey The flag key uniquely identifies a particular flag
115- * @param {boolean } defaultValue The value returned if an error occurs
116- * @param {EvaluationContext } context The evaluation context used on an individual flag evaluation
117- * @param {FlagEvaluationOptions } options Additional flag evaluation options
118- * @returns {Promise<boolean> } Flag evaluation response
119- */
12074 async getBooleanValue (
12175 flagKey : string ,
12276 defaultValue : boolean ,
@@ -126,15 +80,6 @@ export class OpenFeatureClient implements Client {
12680 return ( await this . getBooleanDetails ( flagKey , defaultValue , context , options ) ) . value ;
12781 }
12882
129- /**
130- * Performs a flag evaluation that a returns an evaluation details object.
131- *
132- * @param {string } flagKey The flag key uniquely identifies a particular flag
133- * @param {boolean } defaultValue The value returned if an error occurs
134- * @param {EvaluationContext } context The evaluation context used on an individual flag evaluation
135- * @param {FlagEvaluationOptions } options Additional flag evaluation options
136- * @returns {Promise<EvaluationDetails<boolean>> } Flag evaluation details response
137- */
13883 getBooleanDetails (
13984 flagKey : string ,
14085 defaultValue : boolean ,
@@ -151,16 +96,6 @@ export class OpenFeatureClient implements Client {
15196 ) ;
15297 }
15398
154- /**
155- * Performs a flag evaluation that returns a string.
156- *
157- * @param {string } flagKey The flag key uniquely identifies a particular flag
158- * @template {string} T A optional generic argument constraining the string
159- * @param {T } defaultValue The value returned if an error occurs
160- * @param {EvaluationContext } context The evaluation context used on an individual flag evaluation
161- * @param {FlagEvaluationOptions } options Additional flag evaluation options
162- * @returns {Promise<T> } Flag evaluation response
163- */
16499 async getStringValue < T extends string = string > (
165100 flagKey : string ,
166101 defaultValue : T ,
@@ -170,16 +105,6 @@ export class OpenFeatureClient implements Client {
170105 return ( await this . getStringDetails < T > ( flagKey , defaultValue , context , options ) ) . value ;
171106 }
172107
173- /**
174- * Performs a flag evaluation that a returns an evaluation details object.
175- *
176- * @param {string } flagKey The flag key uniquely identifies a particular flag
177- * @template {string} T A optional generic argument constraining the string
178- * @param {T } defaultValue The value returned if an error occurs
179- * @param {EvaluationContext } context The evaluation context used on an individual flag evaluation
180- * @param {FlagEvaluationOptions } options Additional flag evaluation options
181- * @returns {Promise<EvaluationDetails<T>> } Flag evaluation details response
182- */
183108 getStringDetails < T extends string = string > (
184109 flagKey : string ,
185110 defaultValue : T ,
@@ -197,16 +122,6 @@ export class OpenFeatureClient implements Client {
197122 ) ;
198123 }
199124
200- /**
201- * Performs a flag evaluation that returns a number.
202- *
203- * @param {string } flagKey The flag key uniquely identifies a particular flag
204- * @template {number} T A optional generic argument constraining the number
205- * @param {T } defaultValue The value returned if an error occurs
206- * @param {EvaluationContext } context The evaluation context used on an individual flag evaluation
207- * @param {FlagEvaluationOptions } options Additional flag evaluation options
208- * @returns {Promise<T> } Flag evaluation response
209- */
210125 async getNumberValue < T extends number = number > (
211126 flagKey : string ,
212127 defaultValue : T ,
@@ -216,16 +131,6 @@ export class OpenFeatureClient implements Client {
216131 return ( await this . getNumberDetails ( flagKey , defaultValue , context , options ) ) . value ;
217132 }
218133
219- /**
220- * Performs a flag evaluation that a returns an evaluation details object.
221- *
222- * @param {string } flagKey The flag key uniquely identifies a particular flag
223- * @template {number} T A optional generic argument constraining the number
224- * @param {T } defaultValue The value returned if an error occurs
225- * @param {EvaluationContext } context The evaluation context used on an individual flag evaluation
226- * @param {FlagEvaluationOptions } options Additional flag evaluation options
227- * @returns {Promise<EvaluationDetails<T>> } Flag evaluation details response
228- */
229134 getNumberDetails < T extends number = number > (
230135 flagKey : string ,
231136 defaultValue : T ,
@@ -243,16 +148,6 @@ export class OpenFeatureClient implements Client {
243148 ) ;
244149 }
245150
246- /**
247- * Performs a flag evaluation that returns an object.
248- *
249- * @param {string } flagKey The flag key uniquely identifies a particular flag
250- * @template {JsonValue} T A optional generic argument describing the structure
251- * @param {T } defaultValue The value returned if an error occurs
252- * @param {EvaluationContext } context The evaluation context used on an individual flag evaluation
253- * @param {FlagEvaluationOptions } options Additional flag evaluation options
254- * @returns {Promise<T> } Flag evaluation response
255- */
256151 async getObjectValue < T extends JsonValue = JsonValue > (
257152 flagKey : string ,
258153 defaultValue : T ,
@@ -262,16 +157,6 @@ export class OpenFeatureClient implements Client {
262157 return ( await this . getObjectDetails ( flagKey , defaultValue , context , options ) ) . value ;
263158 }
264159
265- /**
266- * Performs a flag evaluation that a returns an evaluation details object.
267- *
268- * @param {string } flagKey The flag key uniquely identifies a particular flag
269- * @template {JsonValue} T A optional generic argument describing the structure
270- * @param {T } defaultValue The value returned if an error occurs
271- * @param {EvaluationContext } context The evaluation context used on an individual flag evaluation
272- * @param {FlagEvaluationOptions } options Additional flag evaluation options
273- * @returns {Promise<EvaluationDetails<T>> } Flag evaluation details response
274- */
275160 getObjectDetails < T extends JsonValue = JsonValue > (
276161 flagKey : string ,
277162 defaultValue : T ,
0 commit comments