1239 |
1240 | const AUDIO_RECORDING: PermissionType
1241 | const CAMERA_ROLL: PermissionType
1242 | const CAMERA: PermissionType
1243 | const CONTACTS: PermissionType
1244 | const LOCATION: PermissionType
1245 | const NOTIFICATIONS: PermissionType
1246 | const REMOTE_NOTIFICATIONS: PermissionType
1247 | const SYSTEM_BRIGHTNESS: PermissionType
1248 | }
1249 |
1250 | /** Register Root Component. Useful when using function like react-redux connect for example. */
1251 | // TODO: verify if it's a good idea or not to use generics.
1252 | function registerRootComponent(component: React.Component
): React.Component
1253 |
1254 | namespace ScreenOrientation {
1255 | namespace Orientation {
1256 | /** All 4 possible orientations. */
1257 | const ALL: 'ALL'
1258 |
1259 | /** All but reverse portrait, could be all 4 orientations on certain Android devices. */
1260 | const ALL_BUT_UPSIDE_DOWN: 'ALL_BUT_UPSIDE_DOWN'
1261 |
1262 | /** Portrait orientation, could also be reverse portrait on certain Android devices. */
1263 | const PORTRAIT: 'PORTRAIT'
1264 |
1265 | /** Upside portrait only. */
1266 | const PORTRAIT_UP: 'PORTRAIT_UP'
1267 |
1268 | /** Upside down portrait only. */
1269 | const PORTRAIT_DOWN: 'PORTRAIT_DOWN'
1270 |
1271 | /** Any landscape orientation. */
1272 | const LANDSCAPE: 'LANDSCAPE'
1273 |
1274 | /** Left landscape only. */
1275 | const LANDSCAPE_LEFT: 'LANDSCAPE_LEFT'
1276 |
1277 | /** Right landscape only. */
1278 | const LANDSCAPE_RIGHT: 'LANDSCAPE_RIGHT'
1279 | }
1280 |
1281 | function allow(orientation: 'ALL' | 'ALL_BUT_UPSIDE_DOWN' | 'PORTRAIT' | 'PORTRAIT_UP' | 'PORTRAIT_DOWN' | 'LANDSCAPE' | 'LANDSCAPE_LEFT' | 'LANDSCAPE_RIGHT'): void
1282 | }
1283 |
1284 | // TODO: check that all these functions return void or not.
1285 | namespace Segment {
1286 | function initializeIOS(writeKey: string): void
1287 | function initializeAndroid(writeKey: string): void
1288 | function identify(userId: string): void
1289 | function identifyWithTraits(userId: string, traits: any): void
1290 | function track(event: string): void
1291 | function trackWithProperties(event: string, properties: any): void
1292 | function flush(): void
1293 | }
1294 |
1295 | namespace SQLite {
1296 | type Error = any
1297 |
1298 | interface Database {
1299 | transaction(
1300 | callback: (transaction: Transaction) => any,
1301 | error?: (error: Error) => any, // TODO def of error
1302 | success?: () => any
1303 | ): void
1304 | }
1305 |
1306 | interface Transaction {
1307 | executeSql(
1308 | sqlStatement: string,
1309 | arguments?: Array,
1310 | success?: (transaction: Transaction, resultSet: ResultSet) => any,
1311 | error?: (transaction: Transaction, error: Error) => any
1312 | ): any
1313 | }
1314 |
1315 | interface ResultSet {
1316 | insertId: number
1317 | rowAffected: number
1318 | rows: {
1319 | length: number;
1320 | item: (index: number) => any;
1321 | _array: Array