UNPKG

@datalayer/core

Version:
89 lines (88 loc) 2.49 kB
import type { JupyterLabAppAdapter } from '@datalayer/jupyter-react'; import type { IMultiServiceManager } from '../../api'; import type { IRuntimesConfiguration } from '../../config'; import type { IRuntimePod, IRuntimeSnapshot, IRuntimeModel } from '../../models'; /** * Datalayer Runtimes state. */ export type RuntimesState = { /** * Runtimes configuration */ configuration: IRuntimesConfiguration; setConfiguration: (config: IRuntimesConfiguration) => void; /** * Runtimes RUN URL. */ runtimesRunUrl: string; /** * JupyterLabApp adapter. */ jupyterLabAdapter?: JupyterLabAppAdapter; /** * Set the JupyterLabAdapter. */ setJupyterLabAdapter: (jupyterLabAdapter: JupyterLabAppAdapter) => void; tab: number; getIntTab: () => number; setTab: (tab: number) => void; /** * Runtime pods. */ runtimePods: IRuntimePod[]; /** * Refresh the runtime pods. */ refreshRuntimePods: () => Promise<void>; /** * Cached runtime models. */ runtimeModels: readonly IRuntimeModel[]; /** * Add a runtime model. */ addRuntimeModel: (model: IRuntimeModel) => void; /** * Remove a runtime model by ID. */ removeRuntimeModel: (id: string) => void; /** * Set the runtimes models list. */ setRuntimeModels: (models: readonly IRuntimeModel[]) => void; /** * Jupyter service manager. */ multiServiceManager?: IMultiServiceManager; setMultiServiceManager: (multiServiceManager: IMultiServiceManager) => void; showDisclaimer: boolean; setShowDisclaimer: (showDisclaimer: boolean) => void; /** * Runtime snapshots. */ runtimeSnapshots: readonly IRuntimeSnapshot[]; /** * Add a runtime snapshot. */ addRuntimeSnapshot: (snapshot: IRuntimeSnapshot) => void; /** * Remove a Runtime Snapshot. */ removeRuntimeSnapshot: (id: string) => void; /** * Set Runtime Snapshots. */ setRuntimeSnapshots: (snapshots: IRuntimeSnapshot[]) => void; /** * Package version. */ version: string; setVersion: (version: string) => void; }; /** * Kernel store */ export declare const runtimesStore: import("zustand").StoreApi<RuntimesState>; export declare function useRuntimesStore(): RuntimesState; export declare function useRuntimesStore<T>(selector: (state: RuntimesState) => T): T; export default useRuntimesStore;