@datalayer/core 0.0.3 → 0.0.5

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 (332) hide show
  1. package/README.md +114 -3
  2. package/lib/App.css +2 -2
  3. package/lib/App.d.ts +1 -1
  4. package/lib/App.js +9 -9
  5. package/lib/__tests__/index.test.js +5 -5
  6. package/lib/api/DatalayerApi.d.ts +1 -1
  7. package/lib/api/DatalayerApi.js +3 -3
  8. package/lib/api/index.d.ts +3 -3
  9. package/lib/api/index.js +3 -3
  10. package/lib/api/runtimes/actions.js +22 -23
  11. package/lib/api/runtimes/settings.js +3 -3
  12. package/lib/api/runtimes/snapshots.d.ts +1 -1
  13. package/lib/api/runtimes/snapshots.js +8 -8
  14. package/lib/api/runtimes/utils.js +1 -4
  15. package/lib/collaboration/DatalayerCollaboration.d.ts +9 -0
  16. package/lib/collaboration/DatalayerCollaboration.js +28 -0
  17. package/lib/collaboration/DatalayerCollaborationProvider.d.ts +54 -0
  18. package/lib/collaboration/DatalayerCollaborationProvider.js +162 -0
  19. package/lib/collaboration/index.d.ts +2 -0
  20. package/lib/collaboration/index.js +6 -0
  21. package/lib/components/avatars/BoringAvatar.d.ts +1 -1
  22. package/lib/components/avatars/BoringAvatar.js +2 -2
  23. package/lib/components/avatars/UserProfileAvatar.js +2 -9
  24. package/lib/components/banners/NoAutomationBanner.js +4 -4
  25. package/lib/components/buttons/DownloadCSVButton.js +1 -1
  26. package/lib/components/buttons/UploadButton.js +1 -1
  27. package/lib/components/checkout/StripeCheckout.d.ts +1 -1
  28. package/lib/components/checkout/StripeCheckout.js +6 -6
  29. package/lib/components/confetti/ConfettiSuccess.js +1 -1
  30. package/lib/components/context/OrganizationSelect.js +5 -5
  31. package/lib/components/context/SpaceSelect.js +7 -7
  32. package/lib/components/display/AvatarSkeleton.js +1 -1
  33. package/lib/components/display/CenteredSpinner.js +4 -4
  34. package/lib/components/display/CodePreview.js +4 -4
  35. package/lib/components/display/DatalayerBox.js +13 -14
  36. package/lib/components/display/HorizontalCenter.d.ts +1 -1
  37. package/lib/components/display/HorizontalCenter.js +1 -1
  38. package/lib/components/display/JupyterDialog.js +17 -15
  39. package/lib/components/display/NavLink.d.ts +4 -2
  40. package/lib/components/display/NavLink.js +6 -4
  41. package/lib/components/display/NotebookSkeleton.js +2 -2
  42. package/lib/components/display/Placeholder.js +1 -1
  43. package/lib/components/display/ToTopBranded.js +1 -1
  44. package/lib/components/echarts/EChartsReact.d.ts +1 -1
  45. package/lib/components/echarts/EChartsReact.js +1 -1
  46. package/lib/components/flashes/FlashClosable.js +11 -11
  47. package/lib/components/flashes/FlashDisclaimer.js +2 -3
  48. package/lib/components/flashes/FlashGuest.js +3 -4
  49. package/lib/components/flashes/FlashSurveys.js +3 -4
  50. package/lib/components/flashes/FlashUnauthorized.js +2 -2
  51. package/lib/components/flashes/surveys/Survey2025_1.d.ts +1 -1
  52. package/lib/components/flashes/surveys/Survey2025_1.js +62 -85
  53. package/lib/components/iam/ExternalTokenSilentLogin.js +6 -4
  54. package/lib/components/icons/ArtifactIcon.d.ts +2 -2
  55. package/lib/components/icons/ArtifactIcon.js +39 -39
  56. package/lib/components/labels/VisibilityLabel.js +2 -5
  57. package/lib/components/landings/StepBlock.d.ts +1 -1
  58. package/lib/components/landings/StepBlock.js +1 -1
  59. package/lib/components/navbar/NavigationVisbilityObserver.js +2 -2
  60. package/lib/components/navbar/SubdomainNavBar.js +45 -23
  61. package/lib/components/navbar/SubdomainNavBar.module.css +33 -14
  62. package/lib/components/nbgrader/NbGradesDetails.d.ts +1 -1
  63. package/lib/components/nbgrader/NbGradesDetails.js +5 -8
  64. package/lib/components/notebooks/JupyterNotebook.js +5 -5
  65. package/lib/components/notebooks/JupyterNotebookToolbar.js +3 -3
  66. package/lib/components/primer/Helper.d.ts +1 -1
  67. package/lib/components/primer/Helper.js +5 -3
  68. package/lib/components/primer/Portals.d.ts +1 -1
  69. package/lib/components/primer/Portals.js +2 -2
  70. package/lib/components/primer/Styles.js +1 -1
  71. package/lib/components/progress/ConsumptionBar.js +2 -2
  72. package/lib/components/progress/CreditsIndicator.d.ts +1 -1
  73. package/lib/components/progress/CreditsIndicator.js +4 -7
  74. package/lib/components/progress/ProgressRing.js +2 -2
  75. package/lib/components/runtimes/RuntimeCellVariables.js +9 -9
  76. package/lib/components/runtimes/RuntimeCellVariablesDialog.js +3 -3
  77. package/lib/components/runtimes/RuntimeLauncherDialog.js +30 -34
  78. package/lib/components/runtimes/RuntimePickerBase.js +42 -31
  79. package/lib/components/runtimes/RuntimePickerCell.js +9 -12
  80. package/lib/components/runtimes/RuntimePickerNotebook.js +44 -44
  81. package/lib/components/runtimes/RuntimeReservationControl.js +10 -15
  82. package/lib/components/runtimes/RuntimeSimplePicker.js +9 -12
  83. package/lib/components/runtimes/RuntimeUtils.js +22 -12
  84. package/lib/components/runtimes/RuntimeVariables.js +7 -7
  85. package/lib/components/screenshot/ScreenCapture.js +9 -13
  86. package/lib/components/screenshot/ScreenCaptureButton.d.ts +1 -1
  87. package/lib/components/screenshot/ScreenCaptureButton.js +14 -8
  88. package/lib/components/snapshots/RuntimeSnapshotMenu.js +19 -17
  89. package/lib/components/snippets/SnippetDialog.js +5 -5
  90. package/lib/components/storage/ContentsBrowser.js +63 -56
  91. package/lib/components/storage/ContentsItems.js +10 -8
  92. package/lib/components/students/StudentItemStatus.d.ts +1 -1
  93. package/lib/components/students/StudentItemStatus.js +35 -16
  94. package/lib/components/subnav/SubNav.d.ts +1 -1
  95. package/lib/components/subnav/SubNav.js +30 -15
  96. package/lib/components/subnav/SubNav.module.css +55 -21
  97. package/lib/components/tables/DataTable.js +1 -4
  98. package/lib/components/text-reveal/TextRevealAnimation.js +7 -2
  99. package/lib/components/text-reveal/TextRevealAnimation.module.css +4 -2
  100. package/lib/components/tokens/SpaceVariantToken.d.ts +1 -1
  101. package/lib/components/tokens/SpaceVariantToken.js +5 -5
  102. package/lib/components/toolbars/AssignmentEditorToolbar.js +1 -3
  103. package/lib/components/users/PeerIndicator.d.ts +1 -1
  104. package/lib/components/users/PeerIndicator.js +5 -5
  105. package/lib/config/Configuration.d.ts +48 -0
  106. package/lib/config/Configuration.js +42 -0
  107. package/lib/config/integrations/Loom.js +3 -3
  108. package/lib/examples/CellExample.d.ts +2 -2
  109. package/lib/examples/CellExample.js +34 -3
  110. package/lib/examples/DatalayerNotebookExample.d.ts +16 -0
  111. package/lib/examples/DatalayerNotebookExample.js +75 -0
  112. package/lib/examples/NativeNavigationExample.d.ts +8 -0
  113. package/lib/examples/NativeNavigationExample.js +97 -0
  114. package/lib/examples/NotebookExample.d.ts +1 -3
  115. package/lib/examples/NotebookExample.js +9 -7
  116. package/lib/examples/NotebookMutationsKernel.d.ts +2 -0
  117. package/lib/examples/NotebookMutationsKernel.js +115 -0
  118. package/lib/examples/NotebookMutationsServiceManager.d.ts +2 -0
  119. package/lib/examples/NotebookMutationsServiceManager.js +107 -0
  120. package/lib/examples/ReactRouterExample.d.ts +6 -0
  121. package/lib/examples/ReactRouterExample.js +175 -0
  122. package/lib/examples/example-selector.d.ts +22 -0
  123. package/lib/examples/example-selector.js +45 -0
  124. package/lib/examples/index.d.ts +2 -0
  125. package/lib/examples/index.js +6 -0
  126. package/lib/examples/main.js +153 -0
  127. package/lib/examples/notebooks/IPyWidgetsExample.ipynb.json +101 -0
  128. package/lib/examples/notebooks/IPyWidgetsExampleWithState.ipynb.json +112 -0
  129. package/lib/examples/{NotebookExample1.ipynb.json → notebooks/Lite.ipynb.json} +45 -53
  130. package/lib/examples/notebooks/Matplotlib.ipynb.json +137 -0
  131. package/lib/examples/notebooks/NotebookExample1.ipynb.json +126 -0
  132. package/lib/examples/notebooks/NotebookExample2.ipynb.json +48 -0
  133. package/lib/examples/notebooks/NotebookOutputs.ipynb.json +49 -0
  134. package/lib/examples/notebooks/NotebookToCExample.ipynb.json +102 -0
  135. package/lib/examples/notebooks/OutputIPyWidgetsExample.d.ts +145 -0
  136. package/lib/examples/notebooks/OutputIPyWidgetsExample.js +153 -0
  137. package/lib/examples/notebooks/PyGWalker.ipynb.json +55 -0
  138. package/lib/hooks/assets/OutputshotPlaceholders.d.ts +10 -10
  139. package/lib/hooks/assets/OutputshotPlaceholders.js +10 -10
  140. package/lib/hooks/index.d.ts +29 -28
  141. package/lib/hooks/index.js +29 -28
  142. package/lib/hooks/layouts/LayoutBackdrop.js +3 -6
  143. package/lib/hooks/layouts/LayoutScreenshot.css +1 -1
  144. package/lib/hooks/layouts/LayoutScreenshot.js +6 -6
  145. package/lib/hooks/useAIAgents.d.ts +1 -1
  146. package/lib/hooks/useAIAgents.js +6 -6
  147. package/lib/hooks/useAuthorization.js +4 -4
  148. package/lib/hooks/useBackdrop.js +7 -7
  149. package/lib/hooks/useBackdropJupyterLab.d.ts +1 -1
  150. package/lib/hooks/useBackdropJupyterLab.js +4 -4
  151. package/lib/hooks/useCache.d.ts +6 -2
  152. package/lib/hooks/useCache.js +233 -179
  153. package/lib/hooks/useCellOutputshot.js +3 -6
  154. package/lib/hooks/useContainsFocus.js +2 -1
  155. package/lib/hooks/useDatalayer.js +5 -3
  156. package/lib/hooks/useError.d.ts +1 -1
  157. package/lib/hooks/useError.js +2 -2
  158. package/lib/hooks/useExternalScript.js +4 -4
  159. package/lib/hooks/useFocusTrap.js +2 -1
  160. package/lib/hooks/useIAM.js +4 -5
  161. package/lib/hooks/useId.js +3 -3
  162. package/lib/hooks/useJupyterLabTheme.js +3 -1
  163. package/lib/hooks/useLocation.d.ts +22 -0
  164. package/lib/hooks/useLocation.js +149 -0
  165. package/lib/hooks/useLocationHandles.d.ts +2 -2
  166. package/lib/hooks/useLocationHandles.js +6 -4
  167. package/lib/hooks/useNavigate.d.ts +5 -1
  168. package/lib/hooks/useNavigate.js +62 -7
  169. package/lib/hooks/useNotebookAIAgent.js +3 -1
  170. package/lib/hooks/useParams.d.ts +5 -0
  171. package/lib/hooks/useParams.js +112 -0
  172. package/lib/hooks/useRuntimes.js +2 -2
  173. package/lib/hooks/useScreenshot.js +5 -5
  174. package/lib/hooks/useToast.js +15 -13
  175. package/lib/hooks/useUpload.js +9 -9
  176. package/lib/hooks/useUser.js +1 -1
  177. package/lib/index.css +1 -1
  178. package/lib/index.d.ts +6 -3
  179. package/lib/index.js +7 -3
  180. package/lib/mocks/components/FlashMock.js +4 -4
  181. package/lib/mocks/hooks/rests/rests.js +15 -18
  182. package/lib/mocks/hooks/useDatalayerMock.d.ts +2 -2
  183. package/lib/mocks/hooks/useDatalayerMock.js +7 -7
  184. package/lib/mocks/models/CodeBlockMock.js +1 -1
  185. package/lib/mocks/models/CodelineMock.js +1 -1
  186. package/lib/mocks/models/CourseMock.d.ts +1 -1
  187. package/lib/mocks/models/CourseMock.js +10 -10
  188. package/lib/mocks/models/InviteMock.d.ts +1 -1
  189. package/lib/mocks/models/InviteMock.js +21 -6
  190. package/lib/mocks/models/JupyterLabUserMock.js +2 -2
  191. package/lib/mocks/models/OrganisationMock.d.ts +1 -1
  192. package/lib/mocks/models/OrganisationMock.js +11 -7
  193. package/lib/mocks/models/SchoolMock.d.ts +1 -1
  194. package/lib/mocks/models/SchoolMock.js +6 -6
  195. package/lib/mocks/models/SpaceMock.d.ts +1 -1
  196. package/lib/mocks/models/SpaceMock.js +9 -9
  197. package/lib/mocks/models/TeamMock.d.ts +1 -1
  198. package/lib/mocks/models/TeamMock.js +6 -6
  199. package/lib/mocks/models/UserMock.d.ts +1 -1
  200. package/lib/mocks/models/UserMock.js +4 -6
  201. package/lib/mocks/views/ActionMenuMock.js +1 -1
  202. package/lib/mocks/views/ChartMock.js +3 -3
  203. package/lib/mocks/views/ChartMockOptions.js +24 -24
  204. package/lib/mocks/views/DashboardMock.js +74 -74
  205. package/lib/mocks/views/FormMock.js +1 -1
  206. package/lib/mocks/views/TableMock.js +1 -1
  207. package/lib/models/Account.d.ts +2 -2
  208. package/lib/models/Assignment.d.ts +2 -2
  209. package/lib/models/Cell.d.ts +1 -1
  210. package/lib/models/CodeBlock.d.ts +1 -1
  211. package/lib/models/CodefeedBlocks.d.ts +2 -2
  212. package/lib/models/Contact.d.ts +1 -1
  213. package/lib/models/Contact.js +14 -14
  214. package/lib/models/ContactIAMProvider.js +2 -2
  215. package/lib/models/Course.d.ts +7 -7
  216. package/lib/models/Dataset.d.ts +1 -1
  217. package/lib/models/Dean.d.ts +1 -1
  218. package/lib/models/Document.d.ts +1 -1
  219. package/lib/models/Environment.d.ts +2 -2
  220. package/lib/models/Exercise.d.ts +1 -1
  221. package/lib/models/IAMProviderLinked.js +1 -1
  222. package/lib/models/Instructor.d.ts +1 -1
  223. package/lib/models/Invite.d.ts +2 -2
  224. package/lib/models/Invite.js +1 -1
  225. package/lib/models/Item.d.ts +5 -5
  226. package/lib/models/LandingRoles.js +18 -18
  227. package/lib/models/Lesson.d.ts +1 -1
  228. package/lib/models/Member.d.ts +1 -1
  229. package/lib/models/Notebook.d.ts +1 -1
  230. package/lib/models/Organization.d.ts +4 -4
  231. package/lib/models/Organization.js +2 -2
  232. package/lib/models/OrganizationMember.d.ts +2 -2
  233. package/lib/models/Page.js +4 -2
  234. package/lib/models/PageTag.d.ts +1 -1
  235. package/lib/models/PageTag.js +56 -9
  236. package/lib/models/Profile.d.ts +1 -1
  237. package/lib/models/RolesOrganization.d.ts +1 -1
  238. package/lib/models/RolesOrganization.js +4 -12
  239. package/lib/models/RolesPlatform.d.ts +1 -1
  240. package/lib/models/RolesPlatform.js +12 -34
  241. package/lib/models/RolesTeam.d.ts +1 -1
  242. package/lib/models/RolesTeam.js +3 -10
  243. package/lib/models/Runtime.js +4 -4
  244. package/lib/models/RuntimeSnapshot.js +1 -1
  245. package/lib/models/School.d.ts +4 -4
  246. package/lib/models/Space.d.ts +5 -5
  247. package/lib/models/Space.js +3 -3
  248. package/lib/models/SpaceItem.d.ts +8 -8
  249. package/lib/models/SpaceMember.d.ts +2 -2
  250. package/lib/models/Student.d.ts +2 -2
  251. package/lib/models/StudentItem.d.ts +3 -3
  252. package/lib/models/Team.d.ts +3 -3
  253. package/lib/models/Team.js +2 -2
  254. package/lib/models/TeamMember.d.ts +2 -2
  255. package/lib/models/URN.js +1 -1
  256. package/lib/models/User.d.ts +2 -2
  257. package/lib/models/User.js +5 -3
  258. package/lib/models/UserOnboarding.d.ts +1 -1
  259. package/lib/models/UserOnboarding.js +7 -7
  260. package/lib/models/UserSettings.js +2 -2
  261. package/lib/models/index.d.ts +2 -2
  262. package/lib/models/index.js +2 -2
  263. package/lib/navigation/adapters/native.d.ts +11 -0
  264. package/lib/navigation/adapters/native.js +48 -0
  265. package/lib/navigation/adapters/nextjs.d.ts +9 -0
  266. package/lib/navigation/adapters/nextjs.js +35 -0
  267. package/lib/navigation/adapters/react-router.d.ts +4 -0
  268. package/lib/navigation/adapters/react-router.js +12 -0
  269. package/lib/navigation/components.d.ts +20 -0
  270. package/lib/navigation/components.js +36 -0
  271. package/lib/navigation/index.d.ts +4 -0
  272. package/lib/navigation/index.js +12 -0
  273. package/lib/routes/index.d.ts +1 -1
  274. package/lib/routes/index.js +1 -1
  275. package/lib/services/DatalayerServiceManager.d.ts +22 -0
  276. package/lib/services/DatalayerServiceManager.js +69 -0
  277. package/lib/services/index.d.ts +4 -0
  278. package/lib/services/index.js +7 -0
  279. package/lib/services/reconnectToRuntime.d.ts +32 -0
  280. package/lib/services/reconnectToRuntime.js +59 -0
  281. package/lib/state/State.d.ts +1 -1
  282. package/lib/state/State.js +1 -1
  283. package/lib/state/index.d.ts +1 -1
  284. package/lib/state/index.js +1 -1
  285. package/lib/state/storage/IAMStorage.js +14 -2
  286. package/lib/state/storage/index.d.ts +1 -1
  287. package/lib/state/storage/index.js +1 -1
  288. package/lib/state/substates/AIAgentState.js +4 -2
  289. package/lib/state/substates/CellState.js +6 -5
  290. package/lib/state/substates/CoreState.d.ts +1 -1
  291. package/lib/state/substates/CoreState.js +26 -17
  292. package/lib/state/substates/DatasourceState.js +1 -1
  293. package/lib/state/substates/IAMState.d.ts +4 -0
  294. package/lib/state/substates/IAMState.js +39 -23
  295. package/lib/state/substates/JupyterLabState.js +1 -1
  296. package/lib/state/substates/LayoutState.d.ts +2 -2
  297. package/lib/state/substates/LayoutState.js +41 -28
  298. package/lib/state/substates/OrganizationState.js +1 -1
  299. package/lib/state/substates/RuntimesState.js +11 -6
  300. package/lib/state/substates/SpaceState.js +1 -1
  301. package/lib/state/substates/SurveysState.js +4 -4
  302. package/lib/state/substates/TeamState.js +1 -1
  303. package/lib/test-setup.js +25 -3
  304. package/lib/theme/DatalayerTheme.js +1 -1
  305. package/lib/theme/DatalayerThemeProvider.js +17 -14
  306. package/lib/theme/Palette.js +1 -1
  307. package/lib/utils/Avatar.js +2 -2
  308. package/lib/utils/Browser.js +6 -6
  309. package/lib/utils/Cells.d.ts +1 -1
  310. package/lib/utils/Cookie.js +1 -1
  311. package/lib/utils/Date.js +2 -2
  312. package/lib/utils/Download.js +5 -3
  313. package/lib/utils/DownloadFile.js +4 -2
  314. package/lib/utils/Env.js +2 -1
  315. package/lib/utils/Lazy.d.ts +1 -1
  316. package/lib/utils/Lazy.js +2 -2
  317. package/lib/utils/Name.js +10 -8
  318. package/lib/utils/Notebook.d.ts +1 -1
  319. package/lib/utils/Notebook.js +3 -3
  320. package/lib/utils/Number.js +13 -9
  321. package/lib/utils/Plots.js +4 -4
  322. package/lib/utils/Screenshot.js +1 -1
  323. package/lib/utils/Sleep.js +1 -1
  324. package/lib/utils/Snapshot.js +2 -2
  325. package/lib/utils/String.js +2 -2
  326. package/lib/utils/Uri.js +1 -1
  327. package/lib/utils/WithSuspense.js +3 -6
  328. package/lib/utils/logger.d.ts +16 -0
  329. package/lib/utils/logger.js +52 -0
  330. package/package.json +49 -5
  331. package/lib/__tests__/App.test.js +0 -17
  332. /package/lib/{__tests__/App.test.d.ts → examples/main.d.ts} +0 -0
package/README.md CHANGED
@@ -37,24 +37,41 @@ This package serves as the base foundation used by many other Datalayer packages
37
37
  - **📸 Snapshot Management**: Create and manage compute snapshots of your runtimes for reproducible environments
38
38
  - **🔒 Secrets Management**: Securely handle sensitive data and credentials in your workflows
39
39
  - **🐍 Python SDK**: Programmatic access to Datalayer platform with context managers and clean resource management
40
- - **🌐 TypeScript SDK**: Programmatic access to Datalayer platform with context managers and clean resource management
40
+ - **🌐 TypeScript/React SDK**: React components and services for building Jupyter-based applications
41
41
  - **💻 Command Line Interface**: CLI tools for managing runtimes, snapshots, and platform resources
42
42
  - **🔧 Base Classes**: Core application classes and configuration inherited by other Datalayer projects
43
+ - **📓 Jupyter Integration**: ServiceManager and collaboration providers for notebook experiences
44
+ - **🧭 Universal Navigation**: Smart navigation hooks that auto-detect and work with React Router, Next.js, or native browser
43
45
 
44
46
  ## Installation
45
47
 
48
+ ### Python SDK
49
+
46
50
  Install Datalayer Core using pip:
47
51
 
48
52
  ```bash
49
53
  pip install datalayer-core
50
54
  ```
51
55
 
52
- For development installation:
56
+ ### TypeScript/React SDK
57
+
58
+ Install as an npm package:
59
+
60
+ ```bash
61
+ npm install @datalayer/core
62
+ ```
63
+
64
+ ### Development Installation
53
65
 
54
66
  ```bash
55
67
  git clone https://github.com/datalayer/core.git
56
68
  cd core
69
+
70
+ # Python development
57
71
  pip install -e .[test]
72
+
73
+ # TypeScript development
74
+ npm install
58
75
  ```
59
76
 
60
77
  ## Quick Start with Python
@@ -117,7 +134,9 @@ datalayer snapshots create <pod-name> my-snapshot 'AI work!' False
117
134
 
118
135
  ## Examples
119
136
 
120
- For comprehensive usage examples, see the [`examples/`](https://github.com/datalayer/core/tree/main/examples) directory which includes:
137
+ ### Python Examples
138
+
139
+ For comprehensive Python usage examples, see the [`examples/`](https://github.com/datalayer/core/tree/main/examples) directory which includes:
121
140
 
122
141
  - **FastAPI + scikit-learn**: Web application with ML models
123
142
  - **Streamlit + scikit-learn**: Interactive data science apps
@@ -125,6 +144,48 @@ For comprehensive usage examples, see the [`examples/`](https://github.com/datal
125
144
  - **Decorator patterns**: Remote function execution with `@datalayer`
126
145
  - **And more**: Complete examples with documentation and setup instructions
127
146
 
147
+ ### TypeScript/React Examples
148
+
149
+ Run the interactive examples locally:
150
+
151
+ ```bash
152
+ # Install dependencies
153
+ npm install
154
+
155
+ # Set your Datalayer API token in .env
156
+ echo "VITE_DATALAYER_API_TOKEN=your-token-here" > .env
157
+
158
+ # Start the examples server
159
+ npm run example
160
+ ```
161
+
162
+ Available at http://localhost:3000/:
163
+
164
+ - **DatalayerNotebookExample**: Full integration with Datalayer services and collaboration
165
+ - **NotebookExample**: Basic Jupyter notebook in React
166
+ - **CellExample**: Individual code cell execution
167
+ - **ReactRouterAdvancedExample**: Comprehensive navigation demo with React Router integration
168
+ - **ReactRouterNavigationExample**: Basic navigation with route parameters
169
+ - **NativeNavigationExample**: Browser-native navigation fallback
170
+
171
+ ### Next.js Application Example
172
+
173
+ A complete Next.js application demonstrating platform integration:
174
+
175
+ ```bash
176
+ cd examples/nextjs-notebook
177
+ npm install
178
+ npm run dev
179
+ ```
180
+
181
+ Features:
182
+
183
+ - Token authentication with Datalayer IAM
184
+ - Browse and create notebooks from your workspace
185
+ - Select compute environments for execution
186
+ - Interactive notebook viewer with real-time outputs
187
+ - Clean, responsive UI with GitHub Primer components
188
+
128
189
  ## Platform Integration
129
190
 
130
191
  Datalayer adds AI capabilities and scalable compute runtimes to your development workflows. The platform is designed to seamlessly integrate into your existing processes and supercharge your computations with the processing power you need.
@@ -144,11 +205,61 @@ Key platform features accessible through this SDK and CLI:
144
205
 
145
206
  ## Development
146
207
 
208
+ ### Building the Library
209
+
210
+ ```bash
211
+ # Build TypeScript library
212
+ npm run build:lib
213
+
214
+ # Build Python package
215
+ python -m build
216
+ ```
217
+
218
+ ### Setup
219
+
220
+ ```bash
221
+ # Install Python dependencies
222
+ pip install -e .[test]
223
+
224
+ # Install TypeScript dependencies
225
+ npm install
226
+ ```
227
+
228
+ ### Code Quality
229
+
230
+ This project maintains high code quality standards with automated linting, formatting, and type checking:
231
+
232
+ ```bash
233
+ # Run all checks (format, lint, type-check)
234
+ npm run check
235
+
236
+ # Auto-fix all issues
237
+ npm run check:fix
238
+
239
+ # Individual commands
240
+ npm run lint # ESLint with React/TypeScript rules
241
+ npm run lint:fix # Auto-fix linting issues
242
+ npm run format # Prettier formatting
243
+ npm run format:check # Check formatting without changes
244
+ npm run type-check # TypeScript compilation check
245
+ ```
246
+
247
+ Pre-commit hooks automatically run formatting and linting on staged files via Husky and lint-staged.
248
+
147
249
  ### Running Tests
148
250
 
149
251
  ```bash
252
+ # Python tests
150
253
  pip install -e .[test]
151
254
  pytest datalayer_core/tests/
255
+
256
+ # TypeScript tests
257
+ npm run test
258
+
259
+ # TypeScript type checking
260
+ npm run type-check
261
+ npm run test:watch # Watch mode
262
+ npm run test:coverage # With coverage
152
263
  ```
153
264
 
154
265
  ### Contributing
package/lib/App.css CHANGED
@@ -7,7 +7,7 @@
7
7
  max-width: 1280px;
8
8
  margin: 0 auto;
9
9
  padding: 2rem;
10
- /* text-align: center; */
10
+ /* text-align: center; */
11
11
  }
12
12
 
13
13
  .logo {
@@ -44,4 +44,4 @@
44
44
 
45
45
  .read-the-docs {
46
46
  color: #888;
47
- }
47
+ }
package/lib/App.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import "./App.css";
1
+ import './App.css';
2
2
  export declare function App(): import("react/jsx-runtime").JSX.Element;
3
3
  export default App;
package/lib/App.js CHANGED
@@ -8,19 +8,19 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
8
8
  *
9
9
  * MIT License
10
10
  */
11
- import { useState } from "react";
12
- import reactLogo from "./assets/react.svg";
11
+ import { useState } from 'react';
12
+ import reactLogo from './assets/react.svg';
13
13
  import { useJupyter, JupyterReactTheme } from '@datalayer/jupyter-react';
14
- import { CellExample } from "./examples/CellExample";
15
- import { NotebookExample } from "./examples/NotebookExample";
16
- import "./App.css";
14
+ import { CellExample } from './examples/CellExample';
15
+ import { NotebookExample } from './examples/NotebookExample';
16
+ import './App.css';
17
17
  export function App() {
18
- const { defaultKernel, serviceManager } = useJupyter({
19
- jupyterServerUrl: "https://oss.datalayer.run/api/jupyter-server",
20
- jupyterServerToken: "60c1661cc408f978c309d04157af55c9588ff9557c9380e4fb50785750703da6",
18
+ const { serviceManager } = useJupyter({
19
+ jupyterServerUrl: 'https://oss.datalayer.run/api/jupyter-server',
20
+ jupyterServerToken: '60c1661cc408f978c309d04157af55c9588ff9557c9380e4fb50785750703da6',
21
21
  startDefaultKernel: true,
22
22
  });
23
23
  const [count, setCount] = useState(0);
24
- return (_jsxs("div", { className: "App", children: [_jsx(_Fragment, { children: _jsxs(JupyterReactTheme, { children: [defaultKernel && _jsx(CellExample, { kernel: defaultKernel }), defaultKernel && serviceManager && _jsx(NotebookExample, { kernel: defaultKernel, serviceManager: serviceManager })] }) }), _jsxs("div", { children: [_jsx("a", { href: "https://reactjs.org", target: "_blank", children: _jsx("img", { src: reactLogo, className: "logo react", alt: "React logo" }) }), _jsx("a", { href: "https://vitejs.dev", target: "_blank", children: _jsx("img", { src: "/vite.svg", className: "logo", alt: "Vite logo" }) })] }), _jsx("h1", { children: "React + Vite" }), _jsx("h2", { children: "On CodeSandbox!" }), _jsxs("div", { className: "card", children: [_jsxs("button", { onClick: () => setCount((count) => count + 1), children: ["count is ", count] }), _jsxs("p", { children: ["Edit ", _jsx("code", { children: "src/App.tsx" }), " and save to test HMR."] }), _jsx("p", { children: "Tip: you can use the inspector button next to address bar to click on components in the preview and open the code in the editor!" })] }), _jsx("p", { className: "read-the-docs", children: "Click on the Vite and React logos to learn more" })] }));
24
+ return (_jsxs("div", { className: "App", children: [_jsx(_Fragment, { children: _jsxs(JupyterReactTheme, { children: [serviceManager && _jsx(CellExample, { serviceManager: serviceManager }), serviceManager && (_jsx(NotebookExample, { serviceManager: serviceManager }))] }) }), _jsxs("div", { children: [_jsx("a", { href: "https://reactjs.org", target: "_blank", rel: "noreferrer", children: _jsx("img", { src: reactLogo, className: "logo react", alt: "React logo" }) }), _jsx("a", { href: "https://vitejs.dev", target: "_blank", rel: "noreferrer", children: _jsx("img", { src: "/vite.svg", className: "logo", alt: "Vite logo" }) })] }), _jsx("h1", { children: "React + Vite" }), _jsx("h2", { children: "On CodeSandbox!" }), _jsxs("div", { className: "card", children: [_jsxs("button", { onClick: () => setCount(count => count + 1), children: ["count is ", count] }), _jsxs("p", { children: ["Edit ", _jsx("code", { children: "src/App.tsx" }), " and save to test HMR."] }), _jsx("p", { children: "Tip: you can use the inspector button next to address bar to click on components in the preview and open the code in the editor!" })] }), _jsx("p", { className: "read-the-docs", children: "Click on the Vite and React logos to learn more" })] }));
25
25
  }
26
26
  export default App;
@@ -5,10 +5,6 @@
5
5
  import { describe, it, expect } from 'vitest';
6
6
  import * as coreIndex from '../index';
7
7
  describe('@datalayer/core - index', () => {
8
- it('should export App', () => {
9
- expect(coreIndex.App).toBeDefined();
10
- expect(typeof coreIndex.App).toBe('function');
11
- });
12
8
  it('should export BackdropContext from hooks', () => {
13
9
  expect(coreIndex.BackdropContext).toBeDefined();
14
10
  expect(coreIndex.BackdropContext).toHaveProperty('$$typeof');
@@ -18,10 +14,14 @@ describe('@datalayer/core - index', () => {
18
14
  expect(coreIndex.convertToLargestUnit).toBeDefined();
19
15
  expect(coreIndex.asArray).toBeDefined();
20
16
  });
17
+ it('should export DatalayerServiceManager from services', () => {
18
+ expect(coreIndex.createDatalayerServiceManager).toBeDefined();
19
+ expect(typeof coreIndex.createDatalayerServiceManager).toBe('function');
20
+ });
21
21
  it('should have all expected exports', () => {
22
22
  const exports = Object.keys(coreIndex);
23
- expect(exports).toContain('App');
24
23
  expect(exports).toContain('convertToLargestUnit');
25
24
  expect(exports).toContain('asArray');
25
+ expect(exports).toContain('createDatalayerServiceManager');
26
26
  });
27
27
  });
@@ -72,4 +72,4 @@ export interface IRequestDatalayerAPIOptions {
72
72
  */
73
73
  signal?: AbortSignal;
74
74
  }
75
- export declare function requestDatalayerAPI<T = any>({ url, method, body, token, signal, headers }: IRequestDatalayerAPIOptions): Promise<T>;
75
+ export declare function requestDatalayerAPI<T = any>({ url, method, body, token, signal, headers, }: IRequestDatalayerAPIOptions): Promise<T>;
@@ -80,7 +80,7 @@ export class NetworkError extends TypeError {
80
80
  this.stack = original.stack;
81
81
  }
82
82
  }
83
- export async function requestDatalayerAPI({ url, method, body, token, signal, headers = {} }) {
83
+ export async function requestDatalayerAPI({ url, method, body, token, signal, headers = {}, }) {
84
84
  const headers_ = new Headers(headers);
85
85
  if (!headers_.has('Accept')) {
86
86
  headers_.set('Accept', 'application/json');
@@ -102,7 +102,7 @@ export async function requestDatalayerAPI({ url, method, body, token, signal, he
102
102
  credentials: 'include',
103
103
  mode: 'cors',
104
104
  cache: 'no-store',
105
- signal
105
+ signal,
106
106
  });
107
107
  }
108
108
  catch (error) {
@@ -135,7 +135,7 @@ async function wait_for_redirection(response, url, headers_) {
135
135
  headers: headers_,
136
136
  credentials: 'include',
137
137
  mode: 'cors',
138
- cache: 'no-store'
138
+ cache: 'no-store',
139
139
  });
140
140
  if (!response.ok) {
141
141
  throw await RunResponseError.create(response);
@@ -1,3 +1,3 @@
1
- export * from "./jupyter";
2
- export * from "./runtimes";
3
- export * from "./DatalayerApi";
1
+ export * from './jupyter';
2
+ export * from './runtimes';
3
+ export * from './DatalayerApi';
package/lib/api/index.js CHANGED
@@ -2,6 +2,6 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- export * from "./jupyter";
6
- export * from "./runtimes";
7
- export * from "./DatalayerApi";
5
+ export * from './jupyter';
6
+ export * from './runtimes';
7
+ export * from './DatalayerApi';
@@ -8,7 +8,7 @@
8
8
  import { URLExt } from '@jupyterlab/coreutils';
9
9
  import { PromiseDelegate } from '@lumino/coreutils';
10
10
  import { Upload } from 'tus-js-client';
11
- import { requestDatalayerAPI } from '..';
11
+ import { requestDatalayerAPI, } from '..';
12
12
  import { asRuntimeSnapshot } from '../../models';
13
13
  import { iamStore, runtimesStore } from '../../state';
14
14
  import { sleep } from '../../utils';
@@ -18,7 +18,7 @@ import { sleep } from '../../utils';
18
18
  export async function getEnvironments() {
19
19
  const data = await requestDatalayerAPI({
20
20
  url: URLExt.join(runtimesStore.getState().runtimesRunUrl, 'api/runtimes/v1/environments'),
21
- token: iamStore.getState().token
21
+ token: iamStore.getState().token,
22
22
  });
23
23
  if (!data.success) {
24
24
  console.error('Failed to fetch available environments.', data);
@@ -35,7 +35,7 @@ export async function createRuntime(options) {
35
35
  environment_name: options.environmentName,
36
36
  type: options.type ?? 'notebook',
37
37
  given_name: options.givenName,
38
- credits_limit: options.creditsLimit
38
+ credits_limit: options.creditsLimit,
39
39
  };
40
40
  if (options.capabilities) {
41
41
  body['capabilities'] = options.capabilities;
@@ -49,11 +49,11 @@ export async function createRuntime(options) {
49
49
  body,
50
50
  token: token,
51
51
  // externalToken may be needed for addons (like credits...).
52
- headers: externalToken ?
53
- {
54
- 'X-External-Token': externalToken
52
+ headers: externalToken
53
+ ? {
54
+ 'X-External-Token': externalToken,
55
55
  }
56
- : undefined
56
+ : undefined,
57
57
  });
58
58
  if (!data.success || !data.runtime) {
59
59
  const msg = `Failed to create a kernel for the environment ${options.environmentName}.`;
@@ -68,7 +68,7 @@ export async function createRuntime(options) {
68
68
  export async function getRuntimes() {
69
69
  const data = await requestDatalayerAPI({
70
70
  url: URLExt.join(runtimesStore.getState().runtimesRunUrl, 'api/runtimes/v1/runtimes'),
71
- token: iamStore.getState().token
71
+ token: iamStore.getState().token,
72
72
  });
73
73
  if (!data.success) {
74
74
  const msg = 'Failed to list the running kernels.';
@@ -88,12 +88,11 @@ export async function deleteRuntime(options) {
88
88
  method: 'DELETE',
89
89
  token: iamStore.getState().token,
90
90
  // externalToken may be needed for addons (like credits...).
91
- headers: externalToken ?
92
- {
93
- 'X-External-Token': externalToken
91
+ headers: externalToken
92
+ ? {
93
+ 'X-External-Token': externalToken,
94
94
  }
95
- :
96
- undefined
95
+ : undefined,
97
96
  });
98
97
  }
99
98
  /**
@@ -107,9 +106,9 @@ export async function snapshotRuntime(options) {
107
106
  pod_name: options.id,
108
107
  name: options.name,
109
108
  description: options.description,
110
- stop: options.stop
109
+ stop: options.stop,
111
110
  },
112
- token: iamStore.getState().token
111
+ token: iamStore.getState().token,
113
112
  });
114
113
  if (!data.success || !data.snapshot) {
115
114
  throw new Error(`Failed to pause the kernel snapshot ${options.id} - ${data}`);
@@ -122,7 +121,7 @@ export async function snapshotRuntime(options) {
122
121
  export async function getRuntimeSnapshots() {
123
122
  const data = await requestDatalayerAPI({
124
123
  url: URLExt.join(runtimesStore.getState().runtimesRunUrl, 'api/runtimes/v1/runtime-snapshots'),
125
- token: iamStore.getState().token
124
+ token: iamStore.getState().token,
126
125
  });
127
126
  if (!data.success) {
128
127
  console.error('Failed to fetch kernel snapshots.', data);
@@ -138,9 +137,9 @@ export async function loadRuntimeSnapshot(options) {
138
137
  url: URLExt.join(runtimesStore.getState().runtimesRunUrl, 'api/runtimes/v1/runtimes', options.id),
139
138
  method: 'PUT',
140
139
  body: {
141
- from: options.from
140
+ from: options.from,
142
141
  },
143
- token: iamStore.getState().token
142
+ token: iamStore.getState().token,
144
143
  });
145
144
  if (!data.success) {
146
145
  throw new Error(`Failed to load the kernel snapshot; ${data.message}`);
@@ -156,7 +155,7 @@ export function createRuntimeSnapshotDownloadURL(id) {
156
155
  return (URLExt.join(runtimesStore.getState().runtimesRunUrl, `api/runtimes/v1/runtime-snapshots/${id}`) +
157
156
  URLExt.objectToQueryString({
158
157
  download: '1',
159
- token: iamStore.getState().token ?? ''
158
+ token: iamStore.getState().token ?? '',
160
159
  }));
161
160
  }
162
161
  /**
@@ -180,7 +179,7 @@ export async function deleteRuntimeSnapshot(id) {
180
179
  await requestDatalayerAPI({
181
180
  url: URLExt.join(runtimesStore.getState().runtimesRunUrl, `api/runtimes/v1/runtime-snapshots/${id}`),
182
181
  method: 'DELETE',
183
- token: iamStore.getState().token
182
+ token: iamStore.getState().token,
184
183
  });
185
184
  // Poll Runtime Snapshot state up-to its deletion
186
185
  try {
@@ -190,7 +189,7 @@ export async function deleteRuntimeSnapshot(id) {
190
189
  sleepTimeout *= 2;
191
190
  const response = await requestDatalayerAPI({
192
191
  url: URLExt.join(runtimesStore.getState().runtimesRunUrl, `api/runtimes/v1/runtime-snapshots/${id}`),
193
- token: iamStore.getState().token
192
+ token: iamStore.getState().token,
194
193
  });
195
194
  if (response.success === false) {
196
195
  throw new Error(response.message);
@@ -216,7 +215,7 @@ export async function updateRuntimeSnapshot(id, metadata) {
216
215
  url: URLExt.join(runtimesStore.getState().runtimesRunUrl, `api/runtimes/v1/runtime-snapshots/${id}`),
217
216
  method: 'PATCH',
218
217
  body: { ...metadata },
219
- token: iamStore.getState().token
218
+ token: iamStore.getState().token,
220
219
  });
221
220
  }
222
221
  }
@@ -250,7 +249,7 @@ export async function uploadRuntimeSnapshot(options) {
250
249
  // Callback for once the upload is completed.
251
250
  onSuccess: () => {
252
251
  tracker.resolve();
253
- }
252
+ },
254
253
  });
255
254
  // Check if there are any previous uploads to continue then start the upload.
256
255
  const previousUploads = await upload.findPreviousUploads();
@@ -21,11 +21,11 @@ export function makeDatalayerSettings(baseUrl, token, wsUrl) {
21
21
  init: {
22
22
  mode: 'cors',
23
23
  credentials: 'include',
24
- cache: 'no-store'
25
- }
24
+ cache: 'no-store',
25
+ },
26
26
  });
27
27
  return serverSettings;
28
28
  }
29
29
  export default {
30
- makeDatalayerSettings
30
+ makeDatalayerSettings,
31
31
  };
@@ -18,7 +18,7 @@ export declare function createRuntimeSnapshot(props: Props): Promise<void>;
18
18
  *
19
19
  * Note: You should use this only for browser kernels.
20
20
  */
21
- export declare function loadBrowserRuntimeSnapshot({ connection, id }: {
21
+ export declare function loadBrowserRuntimeSnapshot({ connection, id, }: {
22
22
  connection: Kernel.IKernelConnection;
23
23
  id: string;
24
24
  }): Promise<void>;
@@ -11,18 +11,18 @@ import { createRuntimeSnapshotDownloadURL, uploadRuntimeSnapshot } from '.';
11
11
  */
12
12
  export async function createRuntimeSnapshot(props) {
13
13
  const { connection, metadata, onUploadProgress } = props;
14
- const dump = await new KernelExecutor({ connection })
15
- .execute(GET_RUNTIME_SNAPSHOT_SNIPPET, {
16
- storeHistory: false
14
+ const dump = await new KernelExecutor({ connection }).execute(GET_RUNTIME_SNAPSHOT_SNIPPET, {
15
+ storeHistory: false,
17
16
  });
18
- const serializedData = (dump.get(0)?.data['application/vnd.jupyter.stdout'] ?? '');
17
+ const serializedData = (dump.get(0)?.data['application/vnd.jupyter.stdout'] ??
18
+ '');
19
19
  // Convert the data to blob.
20
20
  const bytes = base64ToBytes(serializedData);
21
21
  const file = new Blob([bytes.buffer]);
22
22
  return uploadRuntimeSnapshot({
23
23
  file,
24
24
  metadata,
25
- onProgress: onUploadProgress
25
+ onProgress: onUploadProgress,
26
26
  });
27
27
  }
28
28
  function base64ToBytes(base64) {
@@ -36,16 +36,16 @@ function base64ToBytes(base64) {
36
36
  *
37
37
  * Note: You should use this only for browser kernels.
38
38
  */
39
- export async function loadBrowserRuntimeSnapshot({ connection, id }) {
39
+ export async function loadBrowserRuntimeSnapshot({ connection, id, }) {
40
40
  const downloadURL = createRuntimeSnapshotDownloadURL(id);
41
41
  const response = await fetch(downloadURL);
42
42
  const buffer = await response.arrayBuffer();
43
43
  const base64 = bytesToBase64(new Uint8Array(buffer));
44
44
  await new KernelExecutor({
45
- connection
45
+ connection,
46
46
  }).execute(getLoadRuntimeSnapshotSnippet(base64), {
47
47
  storeHistory: false,
48
- silent: true
48
+ silent: true,
49
49
  });
50
50
  }
51
51
  function bytesToBase64(bytes) {
@@ -2,10 +2,7 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- const NON_REMOTE_LOCATION = [
6
- 'browser',
7
- 'local',
8
- ];
5
+ const NON_REMOTE_LOCATION = ['browser', 'local'];
9
6
  /**
10
7
  * Check whether the location is remote or not.
11
8
  *
@@ -0,0 +1,9 @@
1
+ type IFetchSessionId = {
2
+ url: string;
3
+ token?: string;
4
+ };
5
+ /**
6
+ * Fetch the session ID of a collaborative documents from Datalayer.
7
+ */
8
+ export declare function requestDatalayerCollaborationSessionId({ url, token, }: IFetchSessionId): Promise<string>;
9
+ export {};
@@ -0,0 +1,28 @@
1
+ /*
2
+ * Copyright (c) 2023-2025 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+ /**
6
+ * Fetch the session ID of a collaborative documents from Datalayer.
7
+ */
8
+ export async function requestDatalayerCollaborationSessionId({ url, token, }) {
9
+ const headers = {
10
+ Accept: 'application/json',
11
+ };
12
+ if (token) {
13
+ headers['Authorization'] = `Bearer ${token}`;
14
+ }
15
+ const response = await fetch(url, {
16
+ method: 'GET',
17
+ headers,
18
+ credentials: token ? 'include' : 'omit',
19
+ mode: 'cors',
20
+ cache: 'no-store',
21
+ });
22
+ if (response.ok) {
23
+ const content = await response.json();
24
+ return content['sessionId'];
25
+ }
26
+ console.error('Failed to fetch session ID.', response);
27
+ throw new Error('Failed to fetch session ID.');
28
+ }
@@ -0,0 +1,54 @@
1
+ import { YNotebook } from '@jupyter/ydoc';
2
+ import { WebsocketProvider } from 'y-websocket';
3
+ import type { ICollaborationProvider, ICollaborationProviderEvents } from '@datalayer/jupyter-react';
4
+ declare enum CollaborationStatus {
5
+ Disconnected = "disconnected",
6
+ Connecting = "connecting",
7
+ Connected = "connected",
8
+ Error = "error"
9
+ }
10
+ /**
11
+ * Configuration for Datalayer collaboration provider
12
+ */
13
+ export interface IDatalayerCollaborationConfig {
14
+ /**
15
+ * Base URL for the Datalayer server (optional, uses config from store if not provided)
16
+ */
17
+ runUrl?: string;
18
+ /**
19
+ * Authentication token (optional, uses config from store if not provided)
20
+ */
21
+ token?: string;
22
+ }
23
+ /**
24
+ * Datalayer collaboration provider
25
+ *
26
+ * This provider connects to Datalayer's collaboration service using WebSockets.
27
+ */
28
+ export declare class DatalayerCollaborationProvider implements ICollaborationProvider {
29
+ readonly type = "datalayer";
30
+ private _status;
31
+ private _provider;
32
+ private _sharedModel;
33
+ private _statusChanged;
34
+ private _errorOccurred;
35
+ private _syncStateChanged;
36
+ private _isDisposed;
37
+ private _config;
38
+ private _onSync;
39
+ private _onConnectionClose;
40
+ constructor(config: IDatalayerCollaborationConfig);
41
+ get status(): CollaborationStatus;
42
+ get isConnected(): boolean;
43
+ get isDisposed(): boolean;
44
+ get events(): ICollaborationProviderEvents;
45
+ private setStatus;
46
+ connect(sharedModel: YNotebook, documentId: string, options?: Record<string, any>): Promise<void>;
47
+ disconnect(): void;
48
+ getProvider(): WebsocketProvider | null;
49
+ getSharedModel(): YNotebook | null;
50
+ handleConnectionClose(event: CloseEvent): void;
51
+ handleSync(isSynced: boolean): void;
52
+ dispose(): void;
53
+ }
54
+ export default DatalayerCollaborationProvider;