import { HostId } from "../../ids" ; import { Observable } from "rxjs" ; /**
 * A set of common attributes for both local and remote Jupyter
 * targets.
 */ export interface BaseHostProps { id ? : HostId | null ; defaultKernelName : string ; bookstoreEnabled ? : boolean ; showHeaderEditor ? : boolean ; } param hostType export const ofHostType = ( ... hostTypes ) => ( source ) => { if ( hostTypes . length === 1 && Array . isArray ( hostTypes [ 0 ] ) ) { return ofHostType ( ... ( hostTypes [ 0 ] as [ string ] ) ) ; } return new Observable ( ( observer ) => source . subscribe ( { next ( state ) { const host = state . core . app . host ; if ( host && hostTypes . indexOf ( host . type ) !== - 1 ) { return observer . next ( state ) ; } } , error ( err ) { observer . error ( err ) ; } , complete ( ) { observer . complete ( ) ; } } ) ) ; } ;