|
| 1 | +--- |
| 2 | +id: apis/AlertIOS |
| 3 | +title: AlertIOS |
| 4 | +wip: true |
| 5 | +--- |
| 6 | + |
| 7 | +```reason |
| 8 | +type button; |
| 9 | +[@bs.obj] |
| 10 | +external button: |
| 11 | + ( |
| 12 | + ~text: string=?, |
| 13 | + ~onPress: option(string) => unit=?, |
| 14 | + ~style: [@bs.string] [ | `default | `cancel | `destructive]=?, |
| 15 | + unit |
| 16 | + ) => |
| 17 | + button = |
| 18 | + ""; |
| 19 | +
|
| 20 | +[@bs.scope "AlertIOS"] [@bs.module "react-native"] |
| 21 | +external alert: |
| 22 | + (~title: string, ~message: string=?, ~buttons: array(button)=?, unit) => |
| 23 | + unit = |
| 24 | + "alert"; |
| 25 | +
|
| 26 | +[@bs.scope "AlertIOS"] [@bs.module "react-native"] |
| 27 | +external alertWithOKButton: |
| 28 | + (~title: string, ~message: string=?, ~callback: unit => unit=?, unit) => unit = |
| 29 | + "alert"; |
| 30 | +
|
| 31 | +[@bs.scope "AlertIOS"] [@bs.module "react-native"] |
| 32 | +external prompt: |
| 33 | + ( |
| 34 | + ~title: string, |
| 35 | + ~message: string=?, |
| 36 | + ~buttons: array(button)=?, |
| 37 | + ~_type: [@bs.string] [ |
| 38 | + | `default |
| 39 | + | [@bs.as "plain-text"] `plainText |
| 40 | + | [@bs.as "secure-text"] `secureText |
| 41 | + | [@bs.as "login-password"] `loginPassword |
| 42 | + ] |
| 43 | + =?, |
| 44 | + ~defaultValue: string=?, |
| 45 | + ~keyboardType: [@bs.string] [ |
| 46 | + | `default |
| 47 | + | [@bs.as "number-pad"] `numberPad |
| 48 | + | [@bs.as "decimal-pad"] `decimalPad |
| 49 | + | `numeric |
| 50 | + | [@bs.as "email-address"] `emailAddress |
| 51 | + | [@bs.as "phone-pad"] `phonePad |
| 52 | + | [@bs.as "ascii-capable"] `asciiCapable |
| 53 | + | [@bs.as "numbers-and-punctuation"] |
| 54 | + `numbersAndPunctuation |
| 55 | + | `url |
| 56 | + | [@bs.as "name-phone-pad"] `namePhonePad |
| 57 | + | `twitter |
| 58 | + | [@bs.as "web-search"] `webSearch |
| 59 | + | [@bs.as "visible-password"] `visiblePassword |
| 60 | + ] |
| 61 | + =?, |
| 62 | + unit |
| 63 | + ) => |
| 64 | + unit = |
| 65 | + "prompt"; |
| 66 | +
|
| 67 | +[@bs.scope "AlertIOS"] [@bs.module "react-native"] |
| 68 | +external promptWithOKButton: |
| 69 | + ( |
| 70 | + ~title: string, |
| 71 | + ~message: string=?, |
| 72 | + ~callback: string => unit=?, |
| 73 | + ~_type: [@bs.string] [ |
| 74 | + | `default |
| 75 | + | [@bs.as "plain-text"] `plainText |
| 76 | + | [@bs.as "secure-text"] `secureText |
| 77 | + | [@bs.as "login-password"] `loginPassword |
| 78 | + ] |
| 79 | + =?, |
| 80 | + ~defaultValue: string=?, |
| 81 | + ~keyboardType: [@bs.string] [ |
| 82 | + | `default |
| 83 | + | [@bs.as "number-pad"] `numberPad |
| 84 | + | [@bs.as "decimal-pad"] `decimalPad |
| 85 | + | `numeric |
| 86 | + | [@bs.as "email-address"] `emailAddress |
| 87 | + | [@bs.as "phone-pad"] `phonePad |
| 88 | + | [@bs.as "ascii-capable"] `asciiCapable |
| 89 | + | [@bs.as "numbers-and-punctuation"] |
| 90 | + `numbersAndPunctuation |
| 91 | + | `url |
| 92 | + | [@bs.as "name-phone-pad"] `namePhonePad |
| 93 | + | `twitter |
| 94 | + | [@bs.as "web-search"] `webSearch |
| 95 | + | [@bs.as "visible-password"] `visiblePassword |
| 96 | + ] |
| 97 | + =?, |
| 98 | + unit |
| 99 | + ) => |
| 100 | + unit = |
| 101 | + "prompt"; |
| 102 | +
|
| 103 | +``` |
0 commit comments