@shiva004/surveys 0.12.0 → 0.12.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/dist/elements.js +8772 -8297
- package/dist/flags/client/client.d.ts +34 -0
- package/dist/flags/client/context.d.ts +19 -0
- package/dist/flags/client/events.d.ts +18 -0
- package/dist/flags/client/index.d.ts +4 -0
- package/dist/flags/client/status.d.ts +17 -0
- package/dist/flags/client/types.d.ts +77 -0
- package/dist/flags/context/index.d.ts +1 -0
- package/dist/flags/context/use-context-mutator.d.ts +27 -0
- package/dist/flags/data.d.ts +13 -1
- package/dist/flags/declarative/FeatureFlag.d.ts +52 -0
- package/dist/flags/declarative/index.d.ts +1 -0
- package/dist/flags/evaluation/index.d.ts +1 -0
- package/dist/flags/evaluation/use-feature-flag.d.ts +43 -0
- package/dist/flags/internal/context.d.ts +21 -0
- package/dist/flags/internal/errors.d.ts +3 -0
- package/dist/flags/internal/hook-flag-query.d.ts +16 -0
- package/dist/flags/internal/index.d.ts +4 -0
- package/dist/flags/internal/is-equal.d.ts +11 -0
- package/dist/flags/internal/options.d.ts +15 -0
- package/dist/flags/internal/suspense.d.ts +18 -0
- package/dist/flags/internal/use.d.ts +18 -0
- package/dist/flags/options.d.ts +43 -0
- package/dist/flags/provider/index.d.ts +5 -0
- package/dist/flags/provider/provider.d.ts +27 -0
- package/dist/flags/provider/use-flags-backend.d.ts +8 -0
- package/dist/flags/provider/use-flags-client-status.d.ts +7 -0
- package/dist/flags/provider/use-flags-client.d.ts +7 -0
- package/dist/flags/provider/use-when-flags-ready.d.ts +13 -0
- package/dist/flags/query/index.d.ts +1 -0
- package/dist/flags/query/query.d.ts +45 -0
- package/dist/flags/sdk.d.ts +8 -0
- package/dist/flags/tracking/index.d.ts +1 -0
- package/dist/flags/tracking/use-track.d.ts +16 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5290 -4814
- package/dist/logs/data.d.ts +8 -0
- package/package.json +8 -5
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { ErrorCode, EvaluationDetails, FlagMetadata, FlagValue, ResolutionReason } from '../client';
|
|
2
|
+
export interface FlagQuery<T extends FlagValue = FlagValue> {
|
|
3
|
+
/**
|
|
4
|
+
* A structure representing the result of the flag evaluation process
|
|
5
|
+
*/
|
|
6
|
+
readonly details: EvaluationDetails<T>;
|
|
7
|
+
/**
|
|
8
|
+
* The flag value
|
|
9
|
+
*/
|
|
10
|
+
readonly value: T;
|
|
11
|
+
/**
|
|
12
|
+
* A variant is a semantic identifier for a value (`on` or `off`).
|
|
13
|
+
*/
|
|
14
|
+
readonly variant: string | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Arbitrary data associated with this evaluation: bucket, rule name, flag kind and a plain-text explanation.
|
|
17
|
+
*/
|
|
18
|
+
readonly flagMetadata: FlagMetadata;
|
|
19
|
+
/**
|
|
20
|
+
* The reason the evaluation resolved to the particular value.
|
|
21
|
+
*/
|
|
22
|
+
readonly reason: ResolutionReason | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Indicates if this flag defaulted due to an error.
|
|
25
|
+
* Specifically, indicates reason equals ERROR or the errorCode is set, this field is truthy.
|
|
26
|
+
*/
|
|
27
|
+
readonly isError: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* The error code, see {@link ErrorCode}.
|
|
30
|
+
*/
|
|
31
|
+
readonly errorCode: ErrorCode | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* A message associated with the error.
|
|
34
|
+
*/
|
|
35
|
+
readonly errorMessage: string | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Indicates this flag is up-to-date and in sync with the source of truth.
|
|
38
|
+
* Specifically, indicates the evaluation did not default due to error, and the reason is neither STALE or DISABLED.
|
|
39
|
+
*/
|
|
40
|
+
readonly isAuthoritative: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* The type of the value, as returned by "typeof" operator.
|
|
43
|
+
*/
|
|
44
|
+
readonly type: 'boolean';
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './use-track';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TrackingEventDetails } from '../client';
|
|
2
|
+
export type Track = {
|
|
3
|
+
/**
|
|
4
|
+
* Context-aware tracking function for the parent `<FlagsProvider/>`.
|
|
5
|
+
* Track a user action or application state, usually representing a business objective or outcome.
|
|
6
|
+
* The event reaches Live Events with source "flags".
|
|
7
|
+
* @param trackingEventName an identifier for the event
|
|
8
|
+
* @param trackingEventDetails the details of the tracking event
|
|
9
|
+
*/
|
|
10
|
+
track: (trackingEventName: string, trackingEventDetails?: TrackingEventDetails) => void;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Get a context-aware tracking function.
|
|
14
|
+
* @returns {Track} context-aware tracking
|
|
15
|
+
*/
|
|
16
|
+
export declare function useTrack(): Track;
|
package/dist/index.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ export { configureFlags, isFeatureEnabled, evaluate as evaluateFlag, useFlags, g
|
|
|
20
20
|
export type { Flag, FlagKind, FlagsConfig, FlagsConnection, LiveStatus as FlagsLiveStatus, EnvState as FlagEnvState, Evaluation as FlagEvaluation, Env as FlagEnv } from './flags/data';
|
|
21
21
|
export { useTargeting, getSegments, getSegment, saveSegment, addAttribute as addUserAttribute, BUILTIN_ATTRIBUTES as USER_ATTRIBUTES, demoSegments, } from './flags/targeting';
|
|
22
22
|
export { deleteSegment, deleteAttribute } from './flags/data';
|
|
23
|
+
export { subscribeFlags } from './flags/data';
|
|
24
|
+
export * from './flags/sdk';
|
|
23
25
|
export type { Segment, Rule as FlagRule, Condition as FlagCondition, Attribute as UserAttribute, Context as FlagContext } from './flags/targeting';
|
|
24
26
|
export { QueuesApp } from './queues/QueuesApp';
|
|
25
27
|
export type { QueuesAppProps } from './queues/QueuesApp';
|