UNPKG

@prosperitainova/dumbo-react-native

Version:
47 lines 2.52 kB
import React from 'react'; import { ViewProps, StyleProp, ViewStyle } from 'react-native'; import type { WebViewSource } from 'react-native-webview/lib/WebViewTypes'; /** Soource of DocumentViewer either string or WebView source */ export type DocumentViewerSource = string | WebViewSource; /** Props for DocumentViewer component */ export type DocumentViewerProps = { /** Title of text document */ title: string; /** Content to render (supports HTML (text or URL) and plain text) */ source?: DocumentViewerSource; /** Content to render as React Nodes. If set source is not used. Content is automatically wrapped in a ScrollView. */ sourceNode?: React.ReactNode; /** Force no scroll view for sourceNode */ disableScrollView?: boolean; /** Callback when the view is dismissed (if not set will not render close option) */ onDismiss?: () => void; /** Disable padding (useful for loading websites) */ disableContainerPadding?: boolean; /** On dismiss accessibility or visible text (iOS is visible, Android is accessibility). Defaults to ENGLISH "Done" */ dismissText?: string; /** Force the view (mostly for teting) to a specific platform */ forceView?: 'ios' | 'android'; /** Navigation footer to load in the document viewer (used mostly by other flows) */ navigationFooter?: React.ReactNode; /** Render children component into the document viewer. This is useful for rendering a modal within here. */ renderChildComponent?: React.ReactNode; /** Style to set on the item */ style?: StyleProp<ViewStyle>; /** Direct props to set on the React Native component (including iOS and Android specific props). Most use cases should not need this. */ componentProps?: ViewProps; }; /** * DocumentViewer component mostly for Legal content (like Privacy Policy, Terms and Conditions...). * But can also be used for web login flows or any popup overlay flow. * If source is a STRING the text will be rendered as plain text. For custom styling create an HTML file with proper styling per guidelines and use WebViewSource. * * {@link https://github.com/carbon-design-system/carbon-react-native/blob/main/example/src/Views/DocumentViewer.tsx | Example code} */ export declare class DocumentViewer extends React.Component<DocumentViewerProps> { private get androidViewType(); private get styles(); private get headerBar(); private get mainView(); render(): React.ReactNode; } //# sourceMappingURL=index.d.ts.map