Files
react-native/Libraries/Linking/NativeLinking.js
T
Eric Lewis 99899d008f Add spec for Linking (#24877)
Summary:
Part of #24875, adds a spec for linking.

## Changelog

[General] [Added] - TM Spec for Linking
Pull Request resolved: https://github.com/facebook/react-native/pull/24877

Differential Revision: D15374328

Pulled By: fkgozali

fbshipit-source-id: 4b86a75d58d275c0ddc864b4f3f1ec489b0b408b
2019-05-16 12:31:35 -07:00

38 lines
1019 B
JavaScript

/**
* 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 '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 === 'ios'
? TurboModuleRegistry.getEnforcing<Spec>('LinkingManager')
: TurboModuleRegistry.getEnforcing<Spec>('IntentAndroid'));