// tslint:disable:max-line-length import { KernelRef, KernelspecInfo, LocalKernelProps, RemoteKernelProps } from "@nteract/types"; import { Action, ErrorAction, HasContent, HasKernel, makeActionFunction, makeErrorActionFunction, MaybeHasContent, MaybeHasKernel } from "../utils"; export type RestartKernelOutputHandling = "None" | "Clear All" | "Run All"; export const INTERRUPT_KERNEL = "INTERRUPT_KERNEL"; export const INTERRUPT_KERNEL_SUCCESSFUL = "INTERRUPT_KERNEL_SUCCESSFUL"; export const INTERRUPT_KERNEL_FAILED = "INTERRUPT_KERNEL_FAILED"; export const KILL_KERNEL = "KILL_KERNEL"; export const KILL_KERNEL_SUCCESSFUL = "KILL_KERNEL_SUCCESSFUL"; export const KILL_KERNEL_FAILED = "KILL_KERNEL_FAILED"; export const RESTART_KERNEL = "RESTART_KERNEL"; export const RESTART_KERNEL_SUCCESSFUL = "RESTART_KERNEL_SUCCESSFUL"; export const RESTART_KERNEL_FAILED = "RESTART_KERNEL_FAILED"; export const CHANGE_KERNEL_BY_NAME = "CHANGE_KERNEL_BY_NAME"; export const LAUNCH_KERNEL = "LAUNCH_KERNEL"; export const LAUNCH_KERNEL_BY_NAME = "LAUNCH_KERNEL_BY_NAME"; export const LAUNCH_KERNEL_SUCCESSFUL = "LAUNCH_KERNEL_SUCCESSFUL"; export const LAUNCH_KERNEL_FAILED = "LAUNCH_KERNEL_FAILED"; export const SHUTDOWN_REPLY_SUCCEEDED = "SHUTDOWN_REPLY_SUCCEEDED"; export const SHUTDOWN_REPLY_TIMED_OUT = "SHUTDOWN_REPLY_TIMED_OUT"; export const DISPOSE_KERNEL = "DISPOSE_KERNEL"; export type InterruptKernel = Action ; export type InterruptKernelSuccessful = Action ; export type InterruptKernelFailed = ErrorAction; export type KillKernelAction = Action ; export type KillKernelSuccessful = Action ; export type KillKernelFailed = ErrorAction; export type RestartKernel = Action ; export type RestartKernelSuccessful = Action ; export type RestartKernelFailed = ErrorAction; export type ChangeKernelByName = Action ; export type LaunchKernelAction = Action ; export type LaunchKernelByNameAction = Action ; export type NewKernelAction = Action ; export type LaunchKernelFailed = ErrorAction; export type ShutdownReplySucceeded = Action ; export type ShutdownReplyTimedOut = Action ; export type DisposeKernel = Action ; export const interruptKernel = makeActionFunction (INTERRUPT_KERNEL); export const interruptKernelSuccessful = makeActionFunction (INTERRUPT_KERNEL_SUCCESSFUL); export const interruptKernelFailed = makeErrorActionFunction (INTERRUPT_KERNEL_FAILED); export const killKernel = makeActionFunction (KILL_KERNEL); export const killKernelSuccessful = makeActionFunction (KILL_KERNEL_SUCCESSFUL); export const killKernelFailed = makeErrorActionFunction (KILL_KERNEL_FAILED); export const restartKernel = makeActionFunction (RESTART_KERNEL); export const restartKernelSuccessful = makeActionFunction (RESTART_KERNEL_SUCCESSFUL); export const restartKernelFailed = makeErrorActionFunction (RESTART_KERNEL_FAILED); export const changeKernelByName = makeActionFunction (CHANGE_KERNEL_BY_NAME); export const launchKernel = makeActionFunction (LAUNCH_KERNEL); export const launchKernelByName = makeActionFunction (LAUNCH_KERNEL_BY_NAME); export const launchKernelSuccessful = makeActionFunction (LAUNCH_KERNEL_SUCCESSFUL); export const launchKernelFailed = makeErrorActionFunction (LAUNCH_KERNEL_FAILED); export const shutdownReplySucceeded = makeActionFunction (SHUTDOWN_REPLY_SUCCEEDED); export const shutdownReplyTimedOut = makeActionFunction (SHUTDOWN_REPLY_TIMED_OUT); export const disposeKernel = makeActionFunction (DISPOSE_KERNEL);