UNPKG

@prosperitainova/dumbo-react-native

Version:
45 lines 2.29 kB
import React from 'react'; import { ViewProps, StyleProp, ViewStyle, ImageSourcePropType } from 'react-native'; export type GrantPermissiontypes = 'files' | 'camera' | 'notifications' | 'location'; /** Props for GrantPermission component */ export type GrantPermissionProps = { /** The type of permission. This will prefill image and style. You can override image for any other custom cases and leave this undefined. */ type?: GrantPermissiontypes; /** Title for view (usually "Grant access" or similar) */ title: string; /** Reasoning for needing permission (Ex: "In order for us to retrieve the content you intend to upload, we will need access to your photos. This will be used for upload purposes only.") */ reasoning: string; /** Additional info or reasoning to show (Ex: "Please allow APP_NAME to access your photos when you are prompted.") */ additionalReasoning?: string; /** Text to show for primary action (usually "Continue" or similar) */ continueText: string; /** Text to show for cancel action (usually "Cancel" or similar) */ cancelText: string; /** Custom image (override type image) */ customImage?: ImageSourcePropType; /** Custom image styles */ imageStyle?: StyleProp<ViewStyle>; /** Callback when flow finishes. Returns success variable indicating if user accepted or refused to move forward with permission flow */ resultsCallback: (result: boolean) => void; /** 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; }; /** * GrantPermission component for showing the grant device permission flow * * {@link https://github.com/carbon-design-system/carbon-react-native/blob/main/example/src/Views/GrantPermission.tsx | Example code} */ export declare class GrantPermission extends React.Component<GrantPermissionProps> { private resizeEvent; private get wideScreen(); private get styles(); private accept; private reject; private get imageSource(); componentWillUnmount(): void; componentDidMount(): void; render(): React.ReactNode; } //# sourceMappingURL=index.d.ts.map