Options
All
  • Public
  • Public/Protected
  • All
Menu

Package types

@nteract/types

This package contains a collection of type definitions that are used throughout nteract. You can use these types when interacting with kernelspecs, notebooks, and hosts.

Index

Enumerations

Interfaces

Type aliases

Variables

Functions

Type aliases

AppRecord

AppRecord: Immutable.RecordOf<AppRecordProps>

AppStateRecord

AppStateRecord: Immutable.RecordOf<AppState>

CommsRecord

CommsRecord: Immutable.RecordOf<CommsRecordProps>

ConfigState

ConfigState: Map<string, any>

ContentModel

ContentRecord

ContentRef

ContentRef: string

ContentsRecord

ContentsRecord: Immutable.RecordOf<ContentsRecordProps>

CoreRecord

CoreRecord: Immutable.RecordOf<StateRecordProps>

DirectoryContentRecord

DirectoryContentRecord: Immutable.RecordOf<DirectoryContentRecordProps>

DirectoryModelRecord

DirectoryModelRecord: Immutable.RecordOf<DirectoryModelRecordProps>

DummyContentRecord

DummyContentRecord: Immutable.RecordOf<DummyContentRecordProps>

EmptyHostRecord

EmptyHostRecord: Immutable.RecordOf<EmptyHost>

EmptyModelRecord

EmptyModelRecord: Immutable.RecordOf<EmptyModelRecordProps>

EntitiesRecord

EntitiesRecord: Immutable.RecordOf<EntitiesRecordProps>

FileContentRecord

FileContentRecord: Immutable.RecordOf<FileContentRecordProps>

FileModelRecord

FileModelRecord: Immutable.RecordOf<FileModelRecordProps>

HelpLinkRecord

HelpLinkRecord: Immutable.RecordOf<HelpLink>

HostId

HostId: string

HostRecord

HostRecordProps

HostRef

HostRef: string

JupyterHostRecord

JupyterHostRecord: Immutable.RecordOf<JupyterHostRecordProps>

JupyterHostRecordProps

JupyterHostRecordProps: BaseHostProps & object

KernelId

KernelId: string

KernelInfoRecord

KernelInfoRecord: Immutable.RecordOf<KernelInfo>

KernelNotStartedRecord

KernelNotStartedRecord: Immutable.RecordOf<KernelNotStartedProps>

KernelRecord

KernelRef

KernelRef: string

KernelSpecsRecord

KernelSpecsRecord: RecordOf<KernelspecsRecordProps>

KernelspecRecord

KernelspecRecord: RecordOf<KernelspecProps>

KernelspecsByRefRecord

KernelspecsByRefRecord: RecordOf<KernelspecsByRefRecordProps>

KernelspecsRef

KernelspecsRef: string

LocalHostRecord

LocalHostRecord: Immutable.RecordOf<LocalHostRecordProps>

LocalHostRecordProps

LocalHostRecordProps: BaseHostProps & object

LocalKernelRecord

LocalKernelRecord: Immutable.RecordOf<LocalKernelProps>

ModalsRecord

ModalsRecord: Immutable.RecordOf<ModalsRecordProps>

NotebookContentRecord

NotebookContentRecord: Immutable.RecordOf<NotebookContentRecordProps>

NotebookModel

NotebookModel: Immutable.RecordOf<DocumentRecordProps>

NotebookTypes

NotebookTypes: "unknown" | "directory" | "notebook" | "file"

PayloadMessage

RemoteKernelRecord

RemoteKernelRecord: Immutable.RecordOf<RemoteKernelProps>

SessionId

SessionId: string

TransformsRecord

TransformsRecord: Immutable.RecordOf<TransformsRecordProps>

Variables

Const kernelInfoRecordMaker

kernelInfoRecordMaker: Factory<KernelInfo> = Immutable.Record<KernelInfo>({protocolVersion: "0.0.0", // E.g. 1.2.3implementation: "",implementationVersion: "",banner: "",helpLinks: Immutable.List(),languageName: "",languageVersion: "",mimetype: "",fileExtension: "",pygmentsLexer: "",codemirrorMode: "text/plain",nbconvertExporter: ""})

Const makeAppRecord

makeAppRecord: Factory<AppRecordProps> = Immutable.Record<AppRecordProps>({host: makeEmptyHostRecord(),githubToken: null,notificationSystem: {addNotification: (msg: Notification) => {let logger = console.log.bind(console);switch (msg.level) {case "error":logger = console.error.bind(console);break;case "warning":logger = console.warn.bind(console);break;}logger(msg);}},isSaving: false,lastSaved: null,configLastSaved: null,error: null,// set the default version to @nteract/core's versionversion: `@nteract/core@${version}`})

Const makeAppStateRecord

makeAppStateRecord: Factory<AppState> = Immutable.Record<AppState>({app: makeAppRecord(),comms: makeCommsRecord(),config: Immutable.Map<string, any>(),core: makeStateRecord()})

Const makeCommsRecord

makeCommsRecord: Factory<CommsRecordProps> = Immutable.Record<CommsRecordProps>({targets: Immutable.Map(),info: Immutable.Map(),models: Immutable.Map()})

Const makeContentsRecord

makeContentsRecord: Factory<ContentsRecordProps> = Immutable.Record<ContentsRecordProps>({byRef: Immutable.Map<ContentRef, ContentRecord>()})

Const makeDirectoryContentRecord

makeDirectoryContentRecord: Factory<DirectoryContentRecordProps> = Immutable.Record<DirectoryContentRecordProps>({mimetype: null,type: "directory",created: null,format: "json",lastSaved: null,filepath: "",model: makeDirectoryModel(),saving: false,loading: false,error: null})

Const makeDirectoryModel

makeDirectoryModel: Factory<DirectoryModelRecordProps> = Immutable.Record<DirectoryModelRecordProps>({type: "directory",items: Immutable.List()})

Const makeDocumentRecord

makeDocumentRecord: Factory<DocumentRecordProps> = Immutable.Record<DocumentRecordProps>({type: "notebook",notebook: emptyNotebook,savedNotebook: emptyNotebook,transient: Immutable.Map({keyPathsForDisplays: Immutable.Map()}),cellPagers: Immutable.Map(),cellPrompts: Immutable.Map(),editorFocused: null,cellFocused: null,copied: null,kernelRef: null})

Const makeDummyContentRecord

makeDummyContentRecord: Factory<DummyContentRecordProps> = Immutable.Record<DummyContentRecordProps>({type: "dummy",mimetype: null,assumedType: "unknown",lastSaved: null,filepath: "",model: makeEmptyModel(),saving: false,loading: false,error: null})

Const makeEmptyHostRecord

makeEmptyHostRecord: Factory<EmptyHost> = Immutable.Record<EmptyHost>({type: "empty",bookstoreEnabled: false})

Const makeEmptyModel

makeEmptyModel: Factory<EmptyModelRecordProps> = Immutable.Record<EmptyModelRecordProps>({type: "unknown"})

Const makeEntitiesRecord

makeEntitiesRecord: Factory<EntitiesRecordProps> = Immutable.Record<EntitiesRecordProps>({contents: makeContentsRecord(),hosts: makeHostsRecord(),kernels: makeKernelsRecord(),kernelspecs: makeKernelspecsRecord(),modals: makeModalsRecord(),transforms: makeTransformsRecord()})

Const makeFileContentRecord

makeFileContentRecord: Factory<FileContentRecordProps> = Immutable.Record<FileContentRecordProps>({type: "file",mimetype: null,created: null,format: "json",lastSaved: null,filepath: "",model: makeFileModelRecord(),saving: false,loading: false,error: null})

Const makeFileModelRecord

makeFileModelRecord: Factory<FileModelRecordProps> = Immutable.Record<FileModelRecordProps>({type: "file",text: ""})

Const makeHelpLinkRecord

makeHelpLinkRecord: Factory<HelpLink> = Immutable.Record<HelpLink>({text: "",url: "#"})

Const makeHostsRecord

makeHostsRecord: Factory<HostsRecordProps> = Immutable.Record<HostsRecordProps>({byRef: Immutable.Map(),refs: Immutable.List()})

Const makeJupyterHostRecord

makeJupyterHostRecord: Factory<BaseHostProps & object> = Immutable.Record<JupyterHostRecordProps>({type: "jupyter",id: null,defaultKernelName: "python",token: null,origin: typeof location === "undefined" ? "" : location.origin,basePath: "/",crossDomain: false,ajaxOptions: undefined,wsProtocol: undefined,bookstoreEnabled: false,showHeaderEditor: false})

Const makeKernelNotStartedRecord

makeKernelNotStartedRecord: Factory<KernelNotStartedProps> = Immutable.Record<KernelNotStartedProps>({kernelSpecName: null,status: null,type: "unknown",cwd: ".",channels: new Subject(),info: null})

Const makeKernelsRecord

makeKernelsRecord: Factory<KernelsRecordProps> = Immutable.Record<KernelsRecordProps>({byRef: Immutable.Map()})

Const makeKernelspec

makeKernelspec: Factory<KernelspecProps> = Record<KernelspecProps>({name: "",argv: List(),env: Map(),interruptMode: null,language: "",displayName: "",metadata: Map(),resources: Map()})

Const makeKernelspecsByRefRecord

makeKernelspecsByRefRecord: Factory<KernelspecsByRefRecordProps> = Record<KernelspecsByRefRecordProps>({hostRef: null,defaultKernelName: "python",byName: Map()})

Const makeKernelspecsRecord

makeKernelspecsRecord: Factory<KernelspecsRecordProps> = Record<KernelspecsRecordProps>({byRef: Map(),refs: List()})

Const makeLocalHostRecord

makeLocalHostRecord: Factory<BaseHostProps & object> = Immutable.Record<LocalHostRecordProps>({type: "local",id: null,defaultKernelName: "python",bookstoreEnabled: false})

Const makeLocalKernelRecord

makeLocalKernelRecord: Factory<LocalKernelProps> = Immutable.Record<LocalKernelProps>({type: "zeromq",cwd: ".",info: null,kernelSpecName: null,hostRef: null,lastActivity: null,channels: new Subject(),status: null,spawn: null,connectionFile: null})

Const makeModalsRecord

makeModalsRecord: Factory<ModalsRecordProps> = Immutable.Record<ModalsRecordProps>({modalType: ""})

Const makeNotebookContentRecord

makeNotebookContentRecord: Factory<NotebookContentRecordProps> = Immutable.Record<NotebookContentRecordProps>({mimetype: null,created: null,format: "json",lastSaved: null,model: makeDocumentRecord(),filepath: "",type: "notebook",writable: true,saving: false,loading: false,error: null,showHeaderEditor: false})

Const makeRemoteKernelRecord

makeRemoteKernelRecord: Factory<RemoteKernelProps> = Immutable.Record<RemoteKernelProps>({type: "websocket",info: null,cwd: ".",id: null,kernelSpecName: null,hostRef: null,lastActivity: null,channels: new Subject(),sessionId: null,status: null})

Const makeStateRecord

makeStateRecord: Factory<StateRecordProps> = Immutable.Record<StateRecordProps>({kernelRef: null,currentKernelspecsRef: null,entities: makeEntitiesRecord()})

Const makeTransformsRecord

makeTransformsRecord: any = Immutable.Record<TransformsRecordProps>({displayOrder: Immutable.List<string>(),byId: Immutable.Map<string, any>()})

Const version

version: string = require("../package.json").version

Functions

Const castToHostId

  • castToHostId(id: string): HostId

Const castToKernelId

Const castToSessionId

createContentRef

createHostRef

createKernelRef

createKernelspecsRef

makeKernelInfoRecord

Const ofHostType

  • ofHostType(...hostTypes: Array<string | [string]>): (Anonymous function)
  • An RxJS operator for determining if the host that is currently set as the current host in the state is of a particular type.

    Parameters

    • Rest ...hostTypes: Array<string | [string]>

    Returns (Anonymous function)

Generated using TypeDoc