UNPKG

react-native-macos

Version:

[Microsoft Fork] A framework for building native apps using React

38 lines (31 loc) 1.08 kB
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow * @format */ 'use strict'; import type {TurboModule} from 'RCTExport'; import * as TurboModuleRegistry from 'TurboModuleRegistry'; import Platform from '../Utilities/Platform'; export interface Spec extends TurboModule { // Common interface +getInitialURL: () => Promise<string>; +canOpenURL: (url: string) => Promise<boolean>; +openURL: (url: string) => Promise<void>; +openSettings: () => Promise<void>; // Android only +sendIntent: ( action: string, extras: ?Array<{key: string, value: string | number | boolean}>, ) => Promise<void>; // Events +addListener: (eventName: string) => void; +removeListeners: (count: number) => void; } export default ((Platform.OS === 'android' ? TurboModuleRegistry.getEnforcing<Spec>('IntentAndroid') : TurboModuleRegistry.getEnforcing<Spec>('LinkingManager')): Spec);