/** * 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 strict */ declare opaque type DeepRequiredArray<+T>: $ReadOnlyArray< DeepRequired<$NonMaybeType>, >; declare opaque type DeepRequiredObject<+T: interface {}>: Required<{ +[K in keyof T]: DeepRequired, }>; declare opaque type DeepRequired: T extends empty ? $FlowFixMe // If something can pass empty, it's already unsafe : T extends $ReadOnlyArray ? DeepRequiredArray : T extends (...$ReadOnlyArray) => mixed ? T : T extends interface {} ? DeepRequiredObject : $NonMaybeType; type UnboxDeepRequired = T extends DeepRequired ? V : T; /** * @see https://github.com/facebook/idx * * If you entered the file with the hope to understand why something doesn't * type check, you should stop, and migrate your code away from idx first. * idx is deprecated, and you should always use optional chaining instead. */ declare module.exports: ( prop: T1, accessor: (prop: $NonMaybeType>) => T2, ) => ?UnboxDeepRequired;