@ant-design/react-native
Version:
基于蚂蚁金服移动设计规范的 React Native 组件库
35 lines (34 loc) • 1.17 kB
TypeScript
import React from 'react';
import { StyleProp, TextStyle, ViewStyle } from 'react-native';
import { ModalStyle } from './style/index';
export interface ModalPropsType {
animateAppear?: boolean;
animationDuration?: number;
animated?: boolean;
animationType?: 'none' | 'fade' | 'slide-up' | 'slide-down' | 'slide';
bodyStyle?: StyleProp<ViewStyle>;
children?: React.ReactNode;
closable?: boolean;
footer?: Action<TextStyle>[];
locale?: object;
maskClosable?: boolean;
modalType?: 'portal' | 'modal' | 'view';
onAnimationEnd?: (visible: boolean) => void;
onClose?: () => void;
operation?: boolean;
onRequestClose?: CallbackOnBackHandler;
popup?: boolean;
style?: StyleProp<ViewStyle>;
styles?: Partial<ModalStyle>;
title?: React.ReactNode;
transparent?: boolean;
visible: boolean;
}
export interface Action<T = TextStyle> {
text: string;
onPress?: () => void | Promise<any>;
style?: T | string;
}
export type Callback = (valueOrLogin: string, password?: string) => void;
export type CallbackOrActions<T> = Callback | Action<T>[];
export type CallbackOnBackHandler = () => boolean;