license import React from 'react' ; import { StyleProp , ViewStyle , } from 'react-native' ; type ModalService method method method property property overview-example overview-example class ModalServiceType { panel : ModalPresenting | null = null ; private shouldUseTopInsets : boolean = false ; public mount ( panel ) { this . panel = panel ; } public unmount ( ) { this . panel = null ; } public show ( element , config ) { if ( this . panel ) { return this . panel . show ( element , config ) ; } } public update ( identifier , children ) { if ( this . panel ) { this . panel . update ( identifier , children ) ; } } public hide ( identifier ) { if ( this . panel ) { return this . panel . hide ( identifier ) ; } } public set setShouldUseTopInsets ( state ) { this . shouldUseTopInsets = state ; } ; public get getShouldUseTopInsets ( ) : boolean { return this . shouldUseTopInsets ; } } export interface ModalPresentingConfig { backdropStyle ? : StyleProp < ViewStyle > ; onBackdropPress ? : ( ) => void ; } export interface ModalPresenting { show ( element , config ) : string ; hide ( identifier ) : string ; update ( identifier , children ) : void ; } export const ModalService = new ModalServiceType ( ) ;