@react-native/compatibility-check
Version:
Check a React Native app's boundary between JS and Native for incompatibilities
100 lines (85 loc) • 3.16 kB
Flow
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
import type {
ComparisonResult,
MembersComparisonResult,
} from "./ComparisonResult";
import type {
CompleteTypeAnnotation,
NamedShape,
NativeModuleAliasMap,
NativeModuleEnumDeclaration,
NativeModuleEnumDeclarationWithMembers,
NativeModuleEnumMap,
NativeModuleEnumMember,
NativeModuleFunctionTypeAnnotation,
NativeModuleGenericObjectTypeAnnotation,
NativeModulePromiseTypeAnnotation,
NativeModuleUnionTypeAnnotation,
NumberLiteralTypeAnnotation,
StringLiteralTypeAnnotation,
StringLiteralUnionTypeAnnotation,
} from "@react-native/codegen/src/CodegenSchema";
declare export function compareTypes(
newerType: CompleteTypeAnnotation,
olderType: ?CompleteTypeAnnotation,
newerTypesReg: ?NativeModuleAliasMap,
olderTypesReg: ?NativeModuleAliasMap,
newerEnumMap: ?NativeModuleEnumMap,
olderEnumMap: ?NativeModuleEnumMap
): ComparisonResult;
declare export function compareTypeAnnotation(
originalNewerAnnotation: CompleteTypeAnnotation,
originalOlderAnnotation: CompleteTypeAnnotation
): ComparisonResult;
declare export function compareObjectTypes<T: CompleteTypeAnnotation>(
newerPropertyTypes: $ReadOnlyArray<NamedShape<T>>,
olderPropertyTypes: $ReadOnlyArray<NamedShape<T>>
): ComparisonResult;
declare export function compareEnumDeclarations(
newerDeclaration: NativeModuleEnumDeclaration,
olderDeclaration: NativeModuleEnumDeclaration
): ComparisonResult;
declare export function compareEnumDeclarationMemberArrays(
newer: Array<NativeModuleEnumMember>,
older: Array<NativeModuleEnumMember>
): MembersComparisonResult;
declare export function compareEnumDeclarationWithMembers(
newerDeclaration: NativeModuleEnumDeclarationWithMembers,
olderDeclaration: NativeModuleEnumDeclarationWithMembers
): ComparisonResult;
declare export function compareUnionTypes(
newerType: NativeModuleUnionTypeAnnotation,
olderType: NativeModuleUnionTypeAnnotation
): ComparisonResult;
declare export function comparePromiseTypes(
newerType: NativeModulePromiseTypeAnnotation,
olderType: NativeModulePromiseTypeAnnotation
): ComparisonResult;
declare export function compareGenericObjectTypes(
newerType: NativeModuleGenericObjectTypeAnnotation,
olderType: NativeModuleGenericObjectTypeAnnotation
): ComparisonResult;
declare export function compareNumberLiteralTypes(
newerType: NumberLiteralTypeAnnotation,
olderType: NumberLiteralTypeAnnotation
): ComparisonResult;
declare export function compareStringLiteralTypes(
newerType: StringLiteralTypeAnnotation,
olderType: StringLiteralTypeAnnotation
): ComparisonResult;
declare export function compareStringLiteralUnionTypes(
newerType: StringLiteralUnionTypeAnnotation,
olderType: StringLiteralUnionTypeAnnotation
): ComparisonResult;
declare export function compareFunctionTypes(
newerType: NativeModuleFunctionTypeAnnotation,
olderType: NativeModuleFunctionTypeAnnotation
): ComparisonResult;