@react-native/compatibility-check
Version:
Check a React Native app's boundary between JS and Native for incompatibilities
112 lines (95 loc) • 3.57 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,
EnumMembersComparisonResult,
UnionMembersComparisonResult,
} from "./ComparisonResult";
import type {
BooleanLiteralTypeAnnotation,
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 extends 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>,
): EnumMembersComparisonResult;
declare export function compareUnionMemberArrays(
newer: Array<CompleteTypeAnnotation>,
older: Array<CompleteTypeAnnotation>,
): UnionMembersComparisonResult;
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 compareBooleanLiteralTypes(
newerType: BooleanLiteralTypeAnnotation,
olderType: BooleanLiteralTypeAnnotation,
): ComparisonResult;
declare export function compareStringLiteralUnionTypes(
newerType: StringLiteralUnionTypeAnnotation,
olderType: StringLiteralUnionTypeAnnotation,
): ComparisonResult;
declare export function compareFunctionTypes(
newerType: NativeModuleFunctionTypeAnnotation,
olderType: NativeModuleFunctionTypeAnnotation,
): ComparisonResult;