@coinlist-co/react 0.3.0 → 0.4.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 (65) hide show
  1. package/dist/{RequirementItem-BvwsFu9e.d.cts → RequirementItem-B-MvcxSr.d.cts} +3 -3
  2. package/dist/{RequirementItem-BpkJQep8.d.ts → RequirementItem-DcYot2uC.d.ts} +3 -3
  3. package/dist/{chunk-IDCROXPS.js → chunk-EHZ6PIGN.js} +6 -4
  4. package/dist/chunk-EHZ6PIGN.js.map +1 -0
  5. package/dist/chunk-NC45IO63.js +777 -0
  6. package/dist/chunk-NC45IO63.js.map +1 -0
  7. package/dist/chunk-RIFATQB5.js +257 -0
  8. package/dist/chunk-RIFATQB5.js.map +1 -0
  9. package/dist/chunk-UGJUTRXC.js +304 -0
  10. package/dist/chunk-UGJUTRXC.js.map +1 -0
  11. package/dist/client/components/index.cjs +60 -59
  12. package/dist/client/components/index.cjs.map +1 -1
  13. package/dist/client/components/index.d.cts +40 -22
  14. package/dist/client/components/index.d.ts +40 -22
  15. package/dist/client/components/index.js +34 -62
  16. package/dist/client/components/index.js.map +1 -1
  17. package/dist/client/core/index.cjs +308 -222
  18. package/dist/client/core/index.cjs.map +1 -1
  19. package/dist/client/core/index.d.cts +4 -4
  20. package/dist/client/core/index.d.ts +4 -4
  21. package/dist/client/core/index.js +14 -14
  22. package/dist/client/hooks/index.cjs +87 -13
  23. package/dist/client/hooks/index.cjs.map +1 -1
  24. package/dist/client/hooks/index.d.cts +102 -9
  25. package/dist/client/hooks/index.d.ts +102 -9
  26. package/dist/client/hooks/index.js +9 -9
  27. package/dist/client/index.cjs +465 -237
  28. package/dist/client/index.cjs.map +1 -1
  29. package/dist/client/index.d.cts +7 -8
  30. package/dist/client/index.d.ts +7 -8
  31. package/dist/client/index.js +24 -18
  32. package/dist/{coinlist-client-B_dJkbwB.d.ts → coinlist-client-BSxpqylo.d.ts} +13 -138
  33. package/dist/{coinlist-client-DBKa6j3f.d.cts → coinlist-client-Cah5c_aF.d.cts} +13 -138
  34. package/dist/participation-DMMEDxON.d.cts +185 -0
  35. package/dist/participation-E-bT-GXJ.d.ts +185 -0
  36. package/dist/{requirement-CxbdY8l4.d.cts → requirement-XWT0T_zO.d.cts} +5 -2
  37. package/dist/{requirement-fJsQ3f9_.d.ts → requirement-XWT0T_zO.d.ts} +5 -2
  38. package/dist/server/index.cjs +519 -14
  39. package/dist/server/index.cjs.map +1 -1
  40. package/dist/server/index.d.cts +73 -4
  41. package/dist/server/index.d.ts +73 -4
  42. package/dist/server/index.js +116 -20
  43. package/dist/server/index.js.map +1 -1
  44. package/dist/useCoinListRequirements-B5-ZPOMz.d.ts +80 -0
  45. package/dist/useCoinListRequirements-Cuc32Tqw.d.cts +80 -0
  46. package/package.json +1 -1
  47. package/dist/chunk-GRVV7NLV.js +0 -282
  48. package/dist/chunk-GRVV7NLV.js.map +0 -1
  49. package/dist/chunk-IADBIDY6.js +0 -76
  50. package/dist/chunk-IADBIDY6.js.map +0 -1
  51. package/dist/chunk-IDCROXPS.js.map +0 -1
  52. package/dist/chunk-P4DTIPEX.js +0 -623
  53. package/dist/chunk-P4DTIPEX.js.map +0 -1
  54. package/dist/chunk-V5M7SA3C.js +0 -161
  55. package/dist/chunk-V5M7SA3C.js.map +0 -1
  56. package/dist/newtype-yKTvFdg_.d.cts +0 -6
  57. package/dist/newtype-yKTvFdg_.d.ts +0 -6
  58. package/dist/oauth-session-DgItaMKN.d.cts +0 -56
  59. package/dist/oauth-session-DnKDI5ou.d.ts +0 -56
  60. package/dist/useCoinListOffers-C5lBlzcC.d.ts +0 -27
  61. package/dist/useCoinListOffers-CguwXaCX.d.cts +0 -27
  62. package/dist/useCoinListRequirements-BECx1cIw.d.ts +0 -31
  63. package/dist/useCoinListRequirements-CX2gV9gJ.d.cts +0 -31
  64. package/dist/useCompleteCoinListOAuth-BRhAqD4_.d.cts +0 -55
  65. package/dist/useCompleteCoinListOAuth-DEZpHjd6.d.ts +0 -55
@@ -1,55 +0,0 @@
1
- import { a as CoinListClient, O as OauthClientErrorReason } from './coinlist-client-B_dJkbwB.js';
2
- import { A as AuthorizationCode, c as CodeVerifier } from './oauth-session-DnKDI5ou.js';
3
-
4
- interface UseCoinListResult {
5
- /**
6
- * Indicates whether the CoinList client has been initialized and ready to use.
7
- * While isReady is false, then the current user state will be `unknown`.
8
- */
9
- isReady: boolean;
10
- coinlist: CoinListClient;
11
- }
12
- declare function useCoinList(): UseCoinListResult;
13
-
14
- /**
15
- * Reasons passed to {@link UseCompleteCoinListOAuthOptions.onFailure} when the
16
- * OAuth callback cannot be completed. Includes PKCE / redirect validation
17
- * errors from {@link CoinListClient.completeOAuth} and a dedicated value when
18
- * {@link UseCompleteCoinListOAuthOptions.postOAuthComplete} fails or rejects.
19
- */
20
- type CompleteCoinListOAuthFailureReason = OauthClientErrorReason | 'complete_request_failed';
21
- interface UseCompleteCoinListOAuthOptions {
22
- /**
23
- * Exchange the authorization code on your backend (e.g. POST to your API).
24
- * Return `true` when the session was established successfully, `false` when
25
- * the request completed but signing in failed. Rejections are treated like
26
- * `false` and reported as {@link CompleteCoinListOAuthFailureReason}
27
- * `"complete_request_failed"`.
28
- */
29
- postOAuthComplete: (payload: {
30
- code: AuthorizationCode;
31
- codeVerifier: CodeVerifier;
32
- }) => Promise<boolean>;
33
- /**
34
- * Called when the user denied access (`error` query parameter), when
35
- * {@link CoinListClient.completeOAuth} fails PKCE/state validation, or when
36
- * {@link UseCompleteCoinListOAuthOptions.postOAuthComplete} fails.
37
- */
38
- onFailure: (reason: CompleteCoinListOAuthFailureReason) => void | Promise<void>;
39
- /** Invoked after {@link UseCompleteCoinListOAuthOptions.postOAuthComplete} succeeds and {@link CoinListClient.init} has refreshed the client session. */
40
- onSuccess: () => void | Promise<void>;
41
- }
42
- /**
43
- * Runs the CoinList OAuth callback once on mount: validates the redirect URL via
44
- * {@link CoinListClient.completeOAuth}, exchanges the code via {@link UseCompleteCoinListOAuthOptions.postOAuthComplete},
45
- * refreshes tokens with {@link CoinListClient.init}, then calls {@link UseCompleteCoinListOAuthOptions.onSuccess}.
46
- *
47
- * Framework-agnostic: reads `window.location` like {@link CoinListClient.completeOAuth}. Supply
48
- * {@link UseCompleteCoinListOAuthOptions.postOAuthComplete}, {@link UseCompleteCoinListOAuthOptions.onFailure},
49
- * and {@link UseCompleteCoinListOAuthOptions.onSuccess} to perform redirects or routing in your app.
50
- *
51
- * Must be used within {@link CoinListProvider}.
52
- */
53
- declare function useCompleteCoinListOAuth(options: UseCompleteCoinListOAuthOptions): void;
54
-
55
- export { type CompleteCoinListOAuthFailureReason as C, type UseCompleteCoinListOAuthOptions as U, useCompleteCoinListOAuth as a, useCoinList as u };