@ezcoder.dev/sdk 1.0.0

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.
Files changed (44) hide show
  1. package/dist/analytics/index.d.ts +18 -0
  2. package/dist/analytics/index.js +76 -0
  3. package/dist/analytics/index.js.map +1 -0
  4. package/dist/animation/index.d.ts +172 -0
  5. package/dist/animation/index.js +81 -0
  6. package/dist/animation/index.js.map +1 -0
  7. package/dist/auth/index.d.ts +80 -0
  8. package/dist/auth/index.js +463 -0
  9. package/dist/auth/index.js.map +1 -0
  10. package/dist/chunk-5XIZHBKE.js +372 -0
  11. package/dist/chunk-5XIZHBKE.js.map +1 -0
  12. package/dist/chunk-G7XDUN3Z.js +141 -0
  13. package/dist/chunk-G7XDUN3Z.js.map +1 -0
  14. package/dist/chunk-YNDCD53D.js +212 -0
  15. package/dist/chunk-YNDCD53D.js.map +1 -0
  16. package/dist/cms/index.d.ts +44 -0
  17. package/dist/cms/index.js +106 -0
  18. package/dist/cms/index.js.map +1 -0
  19. package/dist/errors/index.d.ts +20 -0
  20. package/dist/errors/index.js +61 -0
  21. package/dist/errors/index.js.map +1 -0
  22. package/dist/index.d.ts +30 -0
  23. package/dist/index.js +21 -0
  24. package/dist/index.js.map +1 -0
  25. package/dist/notifications/index.d.ts +30 -0
  26. package/dist/notifications/index.js +191 -0
  27. package/dist/notifications/index.js.map +1 -0
  28. package/dist/payments/index.d.ts +89 -0
  29. package/dist/payments/index.js +408 -0
  30. package/dist/payments/index.js.map +1 -0
  31. package/dist/roles/index.d.ts +37 -0
  32. package/dist/roles/index.js +120 -0
  33. package/dist/roles/index.js.map +1 -0
  34. package/dist/seo/index.d.ts +39 -0
  35. package/dist/seo/index.js +89 -0
  36. package/dist/seo/index.js.map +1 -0
  37. package/dist/server/index.d.ts +72 -0
  38. package/dist/server/index.js +191 -0
  39. package/dist/server/index.js.map +1 -0
  40. package/dist/storage/index.d.ts +52 -0
  41. package/dist/storage/index.js +212 -0
  42. package/dist/storage/index.js.map +1 -0
  43. package/dist/types-DtY5lp3P.d.ts +90 -0
  44. package/package.json +105 -0
@@ -0,0 +1,18 @@
1
+ interface UseAnalyticsReturn {
2
+ trackEvent: (eventName: string, properties?: Record<string, unknown>) => void;
3
+ trackPageView: (pathname?: string) => void;
4
+ trackError: (message: string, context?: Record<string, unknown>) => void;
5
+ identify: (userId: string, traits?: Record<string, unknown>) => void;
6
+ trackSignup: (user: {
7
+ id?: string;
8
+ email?: string;
9
+ }) => void;
10
+ trackLogin: (user: {
11
+ id?: string;
12
+ }) => void;
13
+ trackLogout: (userId: string) => void;
14
+ isConfigured: boolean;
15
+ }
16
+ declare function useAnalytics(): UseAnalyticsReturn;
17
+
18
+ export { useAnalytics };
@@ -0,0 +1,76 @@
1
+ import {
2
+ AuthContext
3
+ } from "../chunk-YNDCD53D.js";
4
+ import {
5
+ ezcoder,
6
+ ezcoderAuthIntegration
7
+ } from "../chunk-5XIZHBKE.js";
8
+ import {
9
+ features
10
+ } from "../chunk-G7XDUN3Z.js";
11
+
12
+ // src/analytics/useAnalytics.ts
13
+ import { useEffect, useRef, useCallback, useContext } from "react";
14
+ function useAnalytics() {
15
+ const auth = useContext(AuthContext);
16
+ const lastPageViewRef = useRef("");
17
+ const enrichProperties = useCallback((properties = {}) => {
18
+ const enriched = { ...properties };
19
+ if (auth?.user?.id) {
20
+ enriched.userId = auth.user.id;
21
+ enriched.userEmail = auth.user.email;
22
+ }
23
+ if (auth?.profile) {
24
+ const profile = auth.profile;
25
+ enriched.userTier = profile.subscription_tier || "free";
26
+ enriched.userName = profile.display_name;
27
+ }
28
+ return enriched;
29
+ }, [auth?.user, auth?.profile]);
30
+ const trackEvent = useCallback((eventName, properties = {}) => {
31
+ if (!features.analytics) return;
32
+ ezcoder.analytics.track(eventName, enrichProperties(properties));
33
+ }, [enrichProperties]);
34
+ const trackPageView = useCallback((pathname) => {
35
+ if (!features.analytics) return;
36
+ const path = pathname || (typeof window !== "undefined" ? window.location.pathname : "/");
37
+ if (path === lastPageViewRef.current) return;
38
+ lastPageViewRef.current = path;
39
+ ezcoder.analytics.pageView(path);
40
+ }, []);
41
+ const trackError = useCallback((message, context = {}) => {
42
+ if (!features.analytics) return;
43
+ ezcoder.analytics.error(message, enrichProperties(context));
44
+ }, [enrichProperties]);
45
+ const identify = useCallback((userId, traits = {}) => {
46
+ if (!features.analytics) return;
47
+ ezcoder.analytics.identify(userId, traits);
48
+ }, []);
49
+ const trackSignup = useCallback((user) => {
50
+ ezcoderAuthIntegration.onSignup(user);
51
+ }, []);
52
+ const trackLogin = useCallback((user) => {
53
+ ezcoderAuthIntegration.onLogin(user);
54
+ }, []);
55
+ const trackLogout = useCallback((userId) => {
56
+ ezcoderAuthIntegration.onLogout(userId);
57
+ }, []);
58
+ useEffect(() => {
59
+ if (!features.analytics) return;
60
+ trackPageView();
61
+ }, [trackPageView]);
62
+ return {
63
+ trackEvent,
64
+ trackPageView,
65
+ trackError,
66
+ identify,
67
+ trackSignup,
68
+ trackLogin,
69
+ trackLogout,
70
+ isConfigured: features.analytics
71
+ };
72
+ }
73
+ export {
74
+ useAnalytics
75
+ };
76
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/analytics/useAnalytics.ts"],"sourcesContent":["import { useEffect, useRef, useCallback, useContext } from 'react';\nimport { ezcoder, ezcoderAuthIntegration } from '../core/platform';\nimport { features } from '../core/config';\nimport { AuthContext } from '../auth/AuthProvider';\n\ninterface UseAnalyticsReturn {\n trackEvent: (eventName: string, properties?: Record<string, unknown>) => void;\n trackPageView: (pathname?: string) => void;\n trackError: (message: string, context?: Record<string, unknown>) => void;\n identify: (userId: string, traits?: Record<string, unknown>) => void;\n trackSignup: (user: { id?: string; email?: string }) => void;\n trackLogin: (user: { id?: string }) => void;\n trackLogout: (userId: string) => void;\n isConfigured: boolean;\n}\n\nexport function useAnalytics(): UseAnalyticsReturn {\n const auth = useContext(AuthContext);\n const lastPageViewRef = useRef<string>('');\n\n const enrichProperties = useCallback((properties: Record<string, unknown> = {}): Record<string, unknown> => {\n const enriched = { ...properties };\n if (auth?.user?.id) {\n enriched.userId = auth.user.id;\n enriched.userEmail = auth.user.email;\n }\n if (auth?.profile) {\n const profile = auth.profile as unknown as Record<string, unknown>;\n enriched.userTier = profile.subscription_tier || 'free';\n enriched.userName = profile.display_name;\n }\n return enriched;\n }, [auth?.user, auth?.profile]);\n\n const trackEvent = useCallback((eventName: string, properties: Record<string, unknown> = {}) => {\n if (!features.analytics) return;\n ezcoder.analytics.track(eventName, enrichProperties(properties));\n }, [enrichProperties]);\n\n const trackPageView = useCallback((pathname?: string) => {\n if (!features.analytics) return;\n const path = pathname || (typeof window !== 'undefined' ? window.location.pathname : '/');\n if (path === lastPageViewRef.current) return;\n lastPageViewRef.current = path;\n ezcoder.analytics.pageView(path);\n }, []);\n\n const trackError = useCallback((message: string, context: Record<string, unknown> = {}) => {\n if (!features.analytics) return;\n ezcoder.analytics.error(message, enrichProperties(context));\n }, [enrichProperties]);\n\n const identify = useCallback((userId: string, traits: Record<string, unknown> = {}) => {\n if (!features.analytics) return;\n ezcoder.analytics.identify(userId, traits);\n }, []);\n\n const trackSignup = useCallback((user: { id?: string; email?: string }) => {\n ezcoderAuthIntegration.onSignup(user);\n }, []);\n\n const trackLogin = useCallback((user: { id?: string }) => {\n ezcoderAuthIntegration.onLogin(user);\n }, []);\n\n const trackLogout = useCallback((userId: string) => {\n ezcoderAuthIntegration.onLogout(userId);\n }, []);\n\n useEffect(() => {\n if (!features.analytics) return;\n trackPageView();\n }, [trackPageView]);\n\n return {\n trackEvent,\n trackPageView,\n trackError,\n identify,\n trackSignup,\n trackLogin,\n trackLogout,\n isConfigured: features.analytics,\n };\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,WAAW,QAAQ,aAAa,kBAAkB;AAgBpD,SAAS,eAAmC;AACjD,QAAM,OAAO,WAAW,WAAW;AACnC,QAAM,kBAAkB,OAAe,EAAE;AAE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,QAAM,aAAa,YAAY,CAAC,SAA0B;AACxD,2BAAuB,QAAQ,IAAI;AAAA,EACrC,GAAG,CAAC,CAAC;AAEL,QAAM,cAAc,YAAY,CAAC,WAAmB;AAClD,2BAAuB,SAAS,MAAM;AAAA,EACxC,GAAG,CAAC,CAAC;AAEL,YAAU,MAAM;AACd,QAAI,CAAC,SAAS,UAAW;AACzB,kBAAc;AAAA,EAChB,GAAG,CAAC,aAAa,CAAC;AAElB,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc,SAAS;AAAA,EACzB;AACF;","names":[]}
@@ -0,0 +1,172 @@
1
+ declare const DURATION: {
2
+ fast: number;
3
+ normal: number;
4
+ slow: number;
5
+ };
6
+ declare const EASING: {
7
+ easeInOut: readonly [0.4, 0, 0.2, 1];
8
+ easeOut: readonly [0, 0, 0.2, 1];
9
+ spring: {
10
+ type: "spring";
11
+ stiffness: number;
12
+ damping: number;
13
+ };
14
+ };
15
+ declare const fadeIn: {
16
+ initial: {
17
+ opacity: number;
18
+ };
19
+ animate: {
20
+ opacity: number;
21
+ };
22
+ exit: {
23
+ opacity: number;
24
+ };
25
+ transition: {
26
+ duration: number;
27
+ };
28
+ };
29
+ declare const slideUp: {
30
+ initial: {
31
+ opacity: number;
32
+ y: number;
33
+ };
34
+ animate: {
35
+ opacity: number;
36
+ y: number;
37
+ };
38
+ exit: {
39
+ opacity: number;
40
+ y: number;
41
+ };
42
+ transition: {
43
+ duration: number;
44
+ };
45
+ };
46
+ declare const slideInLeft: {
47
+ initial: {
48
+ opacity: number;
49
+ x: number;
50
+ };
51
+ animate: {
52
+ opacity: number;
53
+ x: number;
54
+ };
55
+ exit: {
56
+ opacity: number;
57
+ x: number;
58
+ };
59
+ transition: {
60
+ duration: number;
61
+ };
62
+ };
63
+ declare const scaleIn: {
64
+ initial: {
65
+ opacity: number;
66
+ scale: number;
67
+ };
68
+ animate: {
69
+ opacity: number;
70
+ scale: number;
71
+ };
72
+ exit: {
73
+ opacity: number;
74
+ scale: number;
75
+ };
76
+ transition: {
77
+ duration: number;
78
+ };
79
+ };
80
+ declare const staggerContainer: {
81
+ animate: {
82
+ transition: {
83
+ staggerChildren: number;
84
+ };
85
+ };
86
+ };
87
+ declare const staggerItem: {
88
+ initial: {
89
+ opacity: number;
90
+ y: number;
91
+ };
92
+ animate: {
93
+ opacity: number;
94
+ y: number;
95
+ };
96
+ };
97
+ declare const pageTransition: {
98
+ initial: {
99
+ opacity: number;
100
+ y: number;
101
+ };
102
+ animate: {
103
+ opacity: number;
104
+ y: number;
105
+ };
106
+ exit: {
107
+ opacity: number;
108
+ y: number;
109
+ };
110
+ transition: {
111
+ duration: number;
112
+ };
113
+ };
114
+ declare const tailwindAnimations: {
115
+ keyframes: {
116
+ fadeIn: {
117
+ '0%': {
118
+ opacity: string;
119
+ };
120
+ '100%': {
121
+ opacity: string;
122
+ };
123
+ };
124
+ slideUp: {
125
+ '0%': {
126
+ opacity: string;
127
+ transform: string;
128
+ };
129
+ '100%': {
130
+ opacity: string;
131
+ transform: string;
132
+ };
133
+ };
134
+ slideDown: {
135
+ '0%': {
136
+ opacity: string;
137
+ transform: string;
138
+ };
139
+ '100%': {
140
+ opacity: string;
141
+ transform: string;
142
+ };
143
+ };
144
+ scaleIn: {
145
+ '0%': {
146
+ opacity: string;
147
+ transform: string;
148
+ };
149
+ '100%': {
150
+ opacity: string;
151
+ transform: string;
152
+ };
153
+ };
154
+ shimmer: {
155
+ '0%': {
156
+ backgroundPosition: string;
157
+ };
158
+ '100%': {
159
+ backgroundPosition: string;
160
+ };
161
+ };
162
+ };
163
+ animation: {
164
+ 'fade-in': string;
165
+ 'slide-up': string;
166
+ 'slide-down': string;
167
+ 'scale-in': string;
168
+ shimmer: string;
169
+ };
170
+ };
171
+
172
+ export { DURATION, EASING, fadeIn, pageTransition, scaleIn, slideInLeft, slideUp, staggerContainer, staggerItem, tailwindAnimations };
@@ -0,0 +1,81 @@
1
+ // src/animation/variants.ts
2
+ var DURATION = {
3
+ fast: 0.15,
4
+ normal: 0.3,
5
+ slow: 0.5
6
+ };
7
+ var EASING = {
8
+ easeInOut: [0.4, 0, 0.2, 1],
9
+ easeOut: [0, 0, 0.2, 1],
10
+ spring: { type: "spring", stiffness: 300, damping: 30 }
11
+ };
12
+ var fadeIn = {
13
+ initial: { opacity: 0 },
14
+ animate: { opacity: 1 },
15
+ exit: { opacity: 0 },
16
+ transition: { duration: DURATION.normal }
17
+ };
18
+ var slideUp = {
19
+ initial: { opacity: 0, y: 20 },
20
+ animate: { opacity: 1, y: 0 },
21
+ exit: { opacity: 0, y: -20 },
22
+ transition: { duration: DURATION.normal }
23
+ };
24
+ var slideInLeft = {
25
+ initial: { opacity: 0, x: -20 },
26
+ animate: { opacity: 1, x: 0 },
27
+ exit: { opacity: 0, x: 20 },
28
+ transition: { duration: DURATION.normal }
29
+ };
30
+ var scaleIn = {
31
+ initial: { opacity: 0, scale: 0.95 },
32
+ animate: { opacity: 1, scale: 1 },
33
+ exit: { opacity: 0, scale: 0.95 },
34
+ transition: { duration: DURATION.fast }
35
+ };
36
+ var staggerContainer = {
37
+ animate: {
38
+ transition: {
39
+ staggerChildren: 0.1
40
+ }
41
+ }
42
+ };
43
+ var staggerItem = {
44
+ initial: { opacity: 0, y: 10 },
45
+ animate: { opacity: 1, y: 0 }
46
+ };
47
+ var pageTransition = {
48
+ initial: { opacity: 0, y: 10 },
49
+ animate: { opacity: 1, y: 0 },
50
+ exit: { opacity: 0, y: -10 },
51
+ transition: { duration: DURATION.normal }
52
+ };
53
+ var tailwindAnimations = {
54
+ keyframes: {
55
+ fadeIn: { "0%": { opacity: "0" }, "100%": { opacity: "1" } },
56
+ slideUp: { "0%": { opacity: "0", transform: "translateY(10px)" }, "100%": { opacity: "1", transform: "translateY(0)" } },
57
+ slideDown: { "0%": { opacity: "0", transform: "translateY(-10px)" }, "100%": { opacity: "1", transform: "translateY(0)" } },
58
+ scaleIn: { "0%": { opacity: "0", transform: "scale(0.95)" }, "100%": { opacity: "1", transform: "scale(1)" } },
59
+ shimmer: { "0%": { backgroundPosition: "-200% 0" }, "100%": { backgroundPosition: "200% 0" } }
60
+ },
61
+ animation: {
62
+ "fade-in": "fadeIn 0.3s ease-out",
63
+ "slide-up": "slideUp 0.3s ease-out",
64
+ "slide-down": "slideDown 0.3s ease-out",
65
+ "scale-in": "scaleIn 0.2s ease-out",
66
+ shimmer: "shimmer 2s infinite linear"
67
+ }
68
+ };
69
+ export {
70
+ DURATION,
71
+ EASING,
72
+ fadeIn,
73
+ pageTransition,
74
+ scaleIn,
75
+ slideInLeft,
76
+ slideUp,
77
+ staggerContainer,
78
+ staggerItem,
79
+ tailwindAnimations
80
+ };
81
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/animation/variants.ts"],"sourcesContent":["export const DURATION = {\n fast: 0.15,\n normal: 0.3,\n slow: 0.5,\n};\n\nexport const EASING = {\n easeInOut: [0.4, 0, 0.2, 1] as const,\n easeOut: [0, 0, 0.2, 1] as const,\n spring: { type: 'spring' as const, stiffness: 300, damping: 30 },\n};\n\nexport const fadeIn = {\n initial: { opacity: 0 },\n animate: { opacity: 1 },\n exit: { opacity: 0 },\n transition: { duration: DURATION.normal },\n};\n\nexport const slideUp = {\n initial: { opacity: 0, y: 20 },\n animate: { opacity: 1, y: 0 },\n exit: { opacity: 0, y: -20 },\n transition: { duration: DURATION.normal },\n};\n\nexport const slideInLeft = {\n initial: { opacity: 0, x: -20 },\n animate: { opacity: 1, x: 0 },\n exit: { opacity: 0, x: 20 },\n transition: { duration: DURATION.normal },\n};\n\nexport const scaleIn = {\n initial: { opacity: 0, scale: 0.95 },\n animate: { opacity: 1, scale: 1 },\n exit: { opacity: 0, scale: 0.95 },\n transition: { duration: DURATION.fast },\n};\n\nexport const staggerContainer = {\n animate: {\n transition: {\n staggerChildren: 0.1,\n },\n },\n};\n\nexport const staggerItem = {\n initial: { opacity: 0, y: 10 },\n animate: { opacity: 1, y: 0 },\n};\n\nexport const pageTransition = {\n initial: { opacity: 0, y: 10 },\n animate: { opacity: 1, y: 0 },\n exit: { opacity: 0, y: -10 },\n transition: { duration: DURATION.normal },\n};\n\nexport const tailwindAnimations = {\n keyframes: {\n fadeIn: { '0%': { opacity: '0' }, '100%': { opacity: '1' } },\n slideUp: { '0%': { opacity: '0', transform: 'translateY(10px)' }, '100%': { opacity: '1', transform: 'translateY(0)' } },\n slideDown: { '0%': { opacity: '0', transform: 'translateY(-10px)' }, '100%': { opacity: '1', transform: 'translateY(0)' } },\n scaleIn: { '0%': { opacity: '0', transform: 'scale(0.95)' }, '100%': { opacity: '1', transform: 'scale(1)' } },\n shimmer: { '0%': { backgroundPosition: '-200% 0' }, '100%': { backgroundPosition: '200% 0' } },\n },\n animation: {\n 'fade-in': 'fadeIn 0.3s ease-out',\n 'slide-up': 'slideUp 0.3s ease-out',\n 'slide-down': 'slideDown 0.3s ease-out',\n 'scale-in': 'scaleIn 0.2s ease-out',\n shimmer: 'shimmer 2s infinite linear',\n },\n};\n"],"mappings":";AAAO,IAAM,WAAW;AAAA,EACtB,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,MAAM;AACR;AAEO,IAAM,SAAS;AAAA,EACpB,WAAW,CAAC,KAAK,GAAG,KAAK,CAAC;AAAA,EAC1B,SAAS,CAAC,GAAG,GAAG,KAAK,CAAC;AAAA,EACtB,QAAQ,EAAE,MAAM,UAAmB,WAAW,KAAK,SAAS,GAAG;AACjE;AAEO,IAAM,SAAS;AAAA,EACpB,SAAS,EAAE,SAAS,EAAE;AAAA,EACtB,SAAS,EAAE,SAAS,EAAE;AAAA,EACtB,MAAM,EAAE,SAAS,EAAE;AAAA,EACnB,YAAY,EAAE,UAAU,SAAS,OAAO;AAC1C;AAEO,IAAM,UAAU;AAAA,EACrB,SAAS,EAAE,SAAS,GAAG,GAAG,GAAG;AAAA,EAC7B,SAAS,EAAE,SAAS,GAA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ACvH,WAAW,EAAE,MAAM,EAAE,SAAS,KAAK,WAAW,oBAAoB,GAAG,QAAQ,EAAE,SAAS,KAAK,WAAW,gBAAgB,EAAE;AAAA,IAC1H,SAAS,EAAE,MAAM,EAAE,SAAS,KAAK,WAAW,cAAc,GAAG,QAAQ,EAAE,SAAS,KAAK,WAAW,WAAW,EAAE;AAAA,IAC7G,SAAS,EAAE,MAAM,EAAE,oBAAoB,UAAU,GAAG,QAAQ,EAAE,oBAAoB,SAAS,EAAE;AAAA,EAC/F;AAAA,EACA,WAAW;AAAA,IACT,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,SAAS;AAAA,EACX;AACF;","names":[]}
@@ -0,0 +1,80 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as react from 'react';
3
+ import { User, Session } from '@supabase/supabase-js';
4
+ import { U as UserProfile, e as SubscriptionTier } from '../types-DtY5lp3P.js';
5
+
6
+ interface AuthResult<T = unknown> {
7
+ data: T | null;
8
+ error: Error | null;
9
+ }
10
+ interface SignUpOptions {
11
+ metadata?: Record<string, unknown>;
12
+ }
13
+ interface SignInWithProviderOptions {
14
+ redirectTo?: string;
15
+ [key: string]: unknown;
16
+ }
17
+ interface AuthContextType {
18
+ user: User | null;
19
+ profile: UserProfile | null;
20
+ session: Session | null;
21
+ loading: boolean;
22
+ isConfigured: boolean;
23
+ signUp: (email: string, password: string, options?: SignUpOptions) => Promise<AuthResult>;
24
+ signIn: (email: string, password: string) => Promise<AuthResult>;
25
+ signInWithProvider: (provider: string, options?: SignInWithProviderOptions) => Promise<AuthResult>;
26
+ signOut: () => Promise<{
27
+ error: Error | null;
28
+ }>;
29
+ resetPassword: (email: string) => Promise<AuthResult>;
30
+ updateProfile: (updates: Partial<UserProfile>) => Promise<AuthResult>;
31
+ refetchProfile: (userId: string) => Promise<UserProfile | null>;
32
+ }
33
+ declare const AuthContext: react.Context<AuthContextType>;
34
+ declare function AuthProvider({ children }: {
35
+ children: React.ReactNode;
36
+ }): react_jsx_runtime.JSX.Element;
37
+ declare function useAuth(): AuthContextType;
38
+
39
+ interface ProtectedRouteProps {
40
+ children: React.ReactNode;
41
+ requiredRoles?: string[];
42
+ requiredTier?: SubscriptionTier;
43
+ fallback?: React.ReactNode;
44
+ unauthorizedFallback?: React.ReactNode;
45
+ allowUnconfigured?: boolean;
46
+ loadingComponent?: React.ReactNode;
47
+ loginPath?: string;
48
+ }
49
+ declare function ProtectedRoute({ children, requiredTier, fallback, loadingComponent, allowUnconfigured, loginPath, }: ProtectedRouteProps): react_jsx_runtime.JSX.Element | null;
50
+
51
+ interface LoginFormProps {
52
+ onSuccess?: () => void;
53
+ onForgotPassword?: () => void;
54
+ onSignupClick?: () => void;
55
+ showOAuth?: boolean;
56
+ className?: string;
57
+ }
58
+ declare function LoginForm({ onSuccess, onForgotPassword, onSignupClick, showOAuth, className, }: LoginFormProps): react_jsx_runtime.JSX.Element;
59
+
60
+ interface SignupFormProps {
61
+ onSuccess?: () => void;
62
+ onLoginClick?: () => void;
63
+ showOAuth?: boolean;
64
+ className?: string;
65
+ }
66
+ declare function SignupForm({ onSuccess, onLoginClick, showOAuth, className, }: SignupFormProps): react_jsx_runtime.JSX.Element;
67
+
68
+ interface ForgotPasswordFormProps {
69
+ onBack?: () => void;
70
+ className?: string;
71
+ }
72
+ declare function ForgotPasswordForm({ onBack, className }: ForgotPasswordFormProps): react_jsx_runtime.JSX.Element;
73
+
74
+ interface AuthCallbackProps {
75
+ redirectTo?: string;
76
+ loadingComponent?: React.ReactNode;
77
+ }
78
+ declare function AuthCallback({ redirectTo, loadingComponent }: AuthCallbackProps): react_jsx_runtime.JSX.Element;
79
+
80
+ export { AuthCallback, AuthContext, type AuthContextType, AuthProvider, type AuthResult, ForgotPasswordForm, LoginForm, ProtectedRoute, type SignInWithProviderOptions, type SignUpOptions, SignupForm, useAuth };