mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
3a6327a5d9
Summary: Open source this ESLint rule so that we can lint our open source NativeModule specs. Changelog: [Internal] Reviewed By: shergin, cpojer Differential Revision: D23791748 fbshipit-source-id: e44444bc87eaa9dc9b7f2b3ed03151798a35e8a5
36 lines
915 B
JavaScript
36 lines
915 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 '../TurboModule/RCTExport';
|
|
import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry';
|
|
|
|
export type Args = {|
|
|
title?: string,
|
|
message?: string,
|
|
buttons?: Array<Object>, // TODO(T67565166): have a better type
|
|
type?: string,
|
|
defaultValue?: string,
|
|
cancelButtonKey?: string,
|
|
destructiveButtonKey?: string,
|
|
keyboardType?: string,
|
|
|};
|
|
|
|
export interface Spec extends TurboModule {
|
|
+alertWithArgs: (
|
|
// eslint-disable-next-line @react-native/codegen/react-native-modules
|
|
args: Args,
|
|
callback: (id: number, value: string) => void,
|
|
) => void;
|
|
}
|
|
|
|
export default (TurboModuleRegistry.get<Spec>('AlertManager'): ?Spec);
|