Skip to content

Commit aa47f0c

Browse files
Introduce TupleTypeAnnotation
Summary: TupleTypeAnnotation is added for parity with UnionTypeAnnotation to support future implementation. Currently limited to String and Number literals as per: https://docs.google.com/document/d/1pTBMOEIov5n5-0L9z925XPvGX1YxlmI6n6FJvd0oXtE/edit?tab=t.0#heading=h.fhe5py9plytd Differential Revision: D87383455
1 parent c1574fc commit aa47f0c

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

packages/react-native-codegen/src/CodegenSchema.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ export interface UnionTypeAnnotation<T> {
6868
readonly types: readonly T[];
6969
}
7070

71+
// TODO(T72031674): TupleTypeAnnotation is added for parity with UnionTypeAnnotation
72+
// to support future implementation. Currently limited to String and Number literals.
73+
export interface TupleTypeAnnotation {
74+
readonly type: 'TupleTypeAnnotation';
75+
readonly types: StringLiteralTypeAnnotation | NumberLiteralTypeAnnotation;
76+
}
77+
7178
export interface MixedTypeAnnotation {
7279
readonly type: 'MixedTypeAnnotation';
7380
}

packages/react-native-codegen/src/CodegenSchema.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@ export type UnionTypeAnnotation<+T> = $ReadOnly<{
7777
types: $ReadOnlyArray<T>,
7878
}>;
7979

80+
// TODO(T72031674): TupleTypeAnnotation is added for parity with UnionTypeAnnotation
81+
// to support future implementation. Currently limited to String and Number literals.
82+
export type TupleTypeAnnotation = $ReadOnly<{
83+
type: 'TupleTypeAnnotation',
84+
types: StringLiteralTypeAnnotation | NumberLiteralTypeAnnotation,
85+
}>;
86+
8087
export type MixedTypeAnnotation = $ReadOnly<{
8188
type: 'MixedTypeAnnotation',
8289
}>;

0 commit comments

Comments
 (0)