@datalayer/core
Version:
[](https://datalayer.io)
80 lines (79 loc) • 2.22 kB
TypeScript
import type { IMultiServiceManager } from '../../stateful/runtimes';
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;
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;