import { MediaBundle } from "@nteract/commutable" ; import * as Immutable from "immutable" ; import { EntitiesRecordProps , makeEmptyHostRecord , makeEntitiesRecord } from "./entities" ; import { HostRecord } from "./entities/hosts" ; import { KernelRef , KernelspecsRef } from "./refs" ; export * from "./content-provider" ; export * from "./entities" ; export * from "./ids" ; export * from "./refs" ; import * as errors from "./errors" ; export { errors } ; export interface KernelspecMetadata { display_name : string ; language : string ; argv : string [ ] ; name ? : string ; env ? : { [ variable ] : string ; } ; } /**
 * This is the kernelspec as formed by spawnteract and jupyter kernelspecs --json
 */ export interface KernelspecInfo { name : string ; spec : KernelspecMetadata ; } export interface Kernelspecs { [ name ] : KernelspecInfo ; } export interface LanguageInfoMetadata { name : string ; codemirror_mode ? : string | Immutable . Map < string , any > | object ; file_extension ? : string ; mimetype ? : string ; pygments_lexer ? : string ; } export interface NotebookMetadata { kernelspec : KernelspecMetadata ; language_info : LanguageInfoMetadata ; } export interface PagePayloadMessage { source : "page" ; data : MediaBundle ; start : number ; } export interface SetNextInputPayloadMessage { source : "set_next_input" ; text : string ; replace : boolean ; } export interface EditPayloadMessage { source : "edit" ; filename : string ; line_number : number ; } export interface AskExitPayloadMessage { source : "ask_exit" ; keepkernel : boolean ; } export interface InputRequestMessage { prompt : string ; password : boolean ; } export type PayloadMessage = PagePayloadMessage | SetNextInputPayloadMessage | EditPayloadMessage | AskExitPayloadMessage ; const version = require ( "../package.json" ) . version ; export interface StateRecordProps { kernelRef : KernelRef | null ; currentKernelspecsRef ? : KernelspecsRef | null ; entities : Immutable . RecordOf < EntitiesRecordProps > ; } export const makeStateRecord = Immutable . Record < StateRecordProps > ( { kernelRef : null , currentKernelspecsRef : null , entities : makeEntitiesRecord ( ) } ) ; export type CoreRecord = Immutable . RecordOf < StateRecordProps > ; export interface AppRecordProps { host : HostRecord ; githubToken ? : string | null ; isSaving : boolean ; lastSaved ? : Date | null ; error : any ; version : string ; } export const makeAppRecord = Immutable . Record < AppRecordProps > ( { host : makeEmptyHostRecord ( ) , githubToken : null , isSaving : false , lastSaved : null , error : null , version : `@nteract/core@${ version }` } ) ; export type AppRecord = Immutable . RecordOf < AppRecordProps > ; export interface AppState { app : AppRecord ; core : CoreRecord ; }