11import type { Ref } from "vue" ;
22
33import type {
4+ CompanyContext ,
45 InitOptions ,
56 RawFlags ,
67 ReflagClient ,
78 ReflagContext ,
89 RequestFeedbackData ,
10+ UserContext ,
911} from "@reflag/browser-sdk" ;
1012
1113export type EmptyFlagRemoteConfig = { key : undefined ; payload : undefined } ;
@@ -57,6 +59,11 @@ export type BootstrappedFlags = {
5759 flags : RawFlags ;
5860} ;
5961
62+ export type RequestFlagFeedbackOptions = Omit <
63+ RequestFeedbackData ,
64+ "flagKey" | "featureId"
65+ > ;
66+
6067/**
6168 * Base init options for the ReflagProvider and ReflagBootstrappedProvider.
6269 * @internal
@@ -66,7 +73,42 @@ export type ReflagInitOptionsBase = Omit<
6673 "user" | "company" | "other" | "otherContext" | "bootstrappedFlags"
6774> ;
6875
69- export type RequestFlagFeedbackOptions = Omit <
70- RequestFeedbackData ,
71- "flagKey" | "featureId"
72- > ;
76+ /**
77+ * Props for the ReflagProvider.
78+ */
79+ export type ReflagProps = ReflagInitOptionsBase & {
80+ /**
81+ * The context to use for the ReflagClient containing user, company, and other context.
82+ */
83+ context ?: ReflagContext ;
84+
85+ /**
86+ * Company related context. If you provide `id` Reflag will enrich the evaluation context with
87+ * company attributes on Reflag servers.
88+ * @deprecated Use `context` instead, this property will be removed in the next major version
89+ */
90+ company ?: CompanyContext ;
91+
92+ /**
93+ * User related context. If you provide `id` Reflag will enrich the evaluation context with
94+ * user attributes on Reflag servers.
95+ * @deprecated Use `context` instead, this property will be removed in the next major version
96+ */
97+ user ?: UserContext ;
98+
99+ /**
100+ * Context which is not related to a user or a company.
101+ * @deprecated Use `context` instead, this property will be removed in the next major version
102+ */
103+ otherContext ?: Record < string , string | number | undefined > ;
104+ } ;
105+
106+ /**
107+ * Props for the ReflagBootstrappedProvider.
108+ */
109+ export type ReflagBootstrappedProps = ReflagInitOptionsBase & {
110+ /**
111+ * Pre-fetched flags to be used instead of fetching them from the server.
112+ */
113+ flags : BootstrappedFlags ;
114+ } ;
0 commit comments