Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ munge_underscores=true
enums=true
casting_syntax=as
experimental.pattern_matching=true
experimental.allow_variance_keywords=true

module.name_mapper='\(metro-[^/]*\)' -> '<PROJECT_ROOT>/packages/\1/src/index.js'

Expand Down
10 changes: 5 additions & 5 deletions packages/metro-file-map/src/flow-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ export type DuplicatesSet = Map<string, /* type */ number>;
export type DuplicatesIndex = Map<string, Map<string, DuplicatesSet>>;

export type FileMapPluginInitOptions<
+SerializableState,
+PerFileData = void,
out SerializableState,
out PerFileData = void,
> = Readonly<{
files: Readonly<{
fileIterator(
Expand Down Expand Up @@ -212,8 +212,8 @@ export type V8Serializable =
| Readonly<{[key: string]: V8Serializable}>;

export interface FileMapPlugin<
-SerializableState extends void | V8Serializable = void | V8Serializable,
-PerFileData extends void | V8Serializable = void | V8Serializable,
in SerializableState extends void | V8Serializable = void | V8Serializable,
in PerFileData extends void | V8Serializable = void | V8Serializable,
> {
+name: string;
initialize(
Expand Down Expand Up @@ -459,7 +459,7 @@ export interface FileSystemListener {
fileRemoved(canonicalPath: CanonicalPath, data: FileMetadata): void;
}

export interface ReadonlyFileSystemChanges<+T = FileMetadata> {
export interface ReadonlyFileSystemChanges<out T = FileMetadata> {
+addedDirectories: Iterable<CanonicalPath>;
+removedDirectories: Iterable<CanonicalPath>;

Expand Down
2 changes: 1 addition & 1 deletion packages/metro-file-map/src/plugins/FileDataPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export type FileDataPluginOptions = Readonly<{
* of lifecycle methods that subclasses can override as needed.
*/
export default class FileDataPlugin<
-PerFileData extends void | V8Serializable = void | V8Serializable,
in PerFileData extends void | V8Serializable = void | V8Serializable,
> implements FileMapPlugin<null, PerFileData>
{
+name: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/metro-resolver/src/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import type {TransformResultDependency} from 'metro/private/DeltaBundler/types';

export type Result<+TResolution, +TCandidates> =
export type Result<out TResolution, out TCandidates> =
| {+type: 'resolved', +resolution: TResolution}
| {+type: 'failed', +candidates: TCandidates};

Expand Down
Loading