index.ts 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. // Contexts
  2. export {
  3. StateProvider,
  4. useStateStore,
  5. useStateValue,
  6. useStateBinding,
  7. type StateContextValue,
  8. type StateProviderProps,
  9. } from "./contexts/state";
  10. export {
  11. VisibilityProvider,
  12. useVisibility,
  13. useIsVisible,
  14. type VisibilityContextValue,
  15. type VisibilityProviderProps,
  16. } from "./contexts/visibility";
  17. export {
  18. ActionProvider,
  19. useActions,
  20. useAction,
  21. ConfirmDialog,
  22. type ActionContextValue,
  23. type ActionProviderProps,
  24. type PendingConfirmation,
  25. type ConfirmDialogProps,
  26. } from "./contexts/actions";
  27. export {
  28. ValidationProvider,
  29. useValidation,
  30. useFieldValidation,
  31. type ValidationContextValue,
  32. type ValidationProviderProps,
  33. type FieldValidationState,
  34. } from "./contexts/validation";
  35. export {
  36. RepeatScopeProvider,
  37. useRepeatScope,
  38. type RepeatScopeValue,
  39. } from "./contexts/repeat-scope";
  40. // Schema (React's spec format)
  41. export {
  42. schema,
  43. type ReactSchema,
  44. type ReactSpec,
  45. // Backward compatibility
  46. elementTreeSchema,
  47. type ElementTreeSchema,
  48. type ElementTreeSpec,
  49. } from "./schema";
  50. // Core types (re-exported for convenience)
  51. export type { Spec, StateStore } from "@json-render/core";
  52. export { createStateStore } from "@json-render/core";
  53. // Catalog-aware types for React
  54. export type {
  55. EventHandle,
  56. BaseComponentProps,
  57. SetState,
  58. StateModel,
  59. ComponentContext,
  60. ComponentFn,
  61. Components,
  62. ActionFn,
  63. Actions,
  64. } from "./catalog-types";
  65. // Renderer
  66. export {
  67. // Registry
  68. defineRegistry,
  69. type DefineRegistryResult,
  70. // createRenderer (higher-level, includes providers)
  71. createRenderer,
  72. type CreateRendererProps,
  73. type ComponentMap,
  74. // Low-level
  75. Renderer,
  76. JSONUIProvider,
  77. type ComponentRenderProps,
  78. type ComponentRenderer,
  79. type ComponentRegistry,
  80. type RendererProps,
  81. type JSONUIProviderProps,
  82. } from "./renderer";
  83. // Hooks
  84. export {
  85. useUIStream,
  86. useChatUI,
  87. useBoundProp,
  88. flatToTree,
  89. buildSpecFromParts,
  90. getTextFromParts,
  91. useJsonRenderMessage,
  92. type UseUIStreamOptions,
  93. type UseUIStreamReturn,
  94. type UseChatUIOptions,
  95. type UseChatUIReturn,
  96. type ChatMessage,
  97. type DataPart,
  98. type TokenUsage,
  99. } from "./hooks";