Skip to content
Open
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
6 changes: 4 additions & 2 deletions flow-typed/npm/shelljs_v0.x.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ declare interface $npm$shelljs$Env {
}

declare type $npm$shelljs$OptionsPoly<Flags extends string> = {
[keys: Flags]: boolean,
...Partial<Record<Flags, boolean>>,
...
};
declare interface $npm$shelljs$ExecThen {
Expand All @@ -50,7 +50,9 @@ declare type $npm$shelljs$SortOpts = $npm$shelljs$OptionsPoly<'-n' | '-r'>;
declare type $npm$shelljs$TestOpts =
'-b' | '-c' | '-d' | '-e' | '-f' | '-L' | '-p' | '-S';
declare type $npm$shelljs$TouchOpts = {
[key: '-a' | '-c' | '-m']: boolean,
'-a'?: boolean,
'-c'?: boolean,
'-m'?: boolean,
'-d'?: string,
'-r'?: string,
...
Expand Down
14 changes: 8 additions & 6 deletions packages/dev-middleware/src/inspector-proxy/CdpDebugLogging.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ function getCDPLogPrefix(destination: CDPMessageDestination): string {
}

export default class CdpDebugLogging {
#cdpMessagesLoggingBatchingFn: {
[key: CDPMessageDestination]: (message: string) => void,
} = {
#cdpMessagesLoggingBatchingFn: Record<
CDPMessageDestination,
(message: string) => void,
> = {
DebuggerToProxy: () => {},
ProxyToDebugger: () => {},
DeviceToProxy: () => {},
Expand All @@ -54,9 +55,10 @@ export default class CdpDebugLogging {
}

#initializeThrottledCDPMessageLogging(): void {
const batchingCounters: {
[key: CDPMessageDestination]: {count: number, size: number},
} = {
const batchingCounters: Record<
CDPMessageDestination,
{count: number, size: number},
> = {
DebuggerToProxy: {count: 0, size: 0},
ProxyToDebugger: {count: 0, size: 0},
DeviceToProxy: {count: 0, size: 0},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ type ReservedTypeMapping = {
readonly java: JavaImportInfo,
};

const RESERVED_TYPES: {
readonly [key: ReservedPrimitiveName]: ReservedTypeMapping,
} = {
const RESERVED_TYPES: Readonly<
Record<ReservedPrimitiveName, ReservedTypeMapping>,
> = {
ColorPrimitive: {
cpp: {
typeName: 'SharedColor',
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/scripts/ios-prebuild/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const platforms /*: ReadonlyArray<Platform> */ = [

// CI can't use commas in cache keys, so 'macOS,variant=Mac Catalyst' was creating troubles
// This map that converts from platforms to valid Xcodebuild destinations.
const platformToDestination /*: Readonly<{[key: Platform]: Destination}> */ = {
const platformToDestination /*: Readonly<Record<Platform, Destination>> */ = {
ios: 'iOS',
'ios-simulator': 'iOS Simulator',
'mac-catalyst': 'macOS,variant=Mac Catalyst',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import {

type ViewStyleProp = NonNullable<React.PropOf<View, 'style'>>;

const DISPLAY_STATUS_MAPPING: {[key: PlatformTestResultStatus]: string} = {
const DISPLAY_STATUS_MAPPING: Record<PlatformTestResultStatus, string> = {
PASS: 'Pass',
FAIL: 'Fail',
ERROR: 'Error',
Expand Down Expand Up @@ -497,10 +497,9 @@ const styles = StyleSheet.create({
},
});

const STATUS_TEXT_STYLE_MAPPING: {[key: PlatformTestResultStatus]: TextStyle} =
{
PASS: styles.passText,
FAIL: styles.failText,
ERROR: styles.errorText,
SKIPPED: styles.skippedText,
};
const STATUS_TEXT_STYLE_MAPPING: Record<PlatformTestResultStatus, TextStyle> = {
PASS: styles.passText,
FAIL: styles.failText,
ERROR: styles.errorText,
SKIPPED: styles.skippedText,
};
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const PREFETCH_DISTANCE = '500px';
const ITEM_COUNT = 50;
const MAX_MESSAGES = 50;

const MODE_EXPLANATIONS: {[mode: MarginMode]: string} = {
const MODE_EXPLANATIONS: Record<MarginMode, string> = {
rootMargin: `rootMargin: '${PREFETCH_DISTANCE} 0px' expands the viewport, but the items are still clipped by the ScrollView, so each one is only reported once it is actually visible. Too late to prefetch.`,
scrollMargin: `scrollMargin: '${PREFETCH_DISTANCE} 0px' expands the clipping area of the ScrollView, so each item is reported ${PREFETCH_DISTANCE} before it scrolls into view.`,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const BEHAVIORS: Array<KeyboardAvoidingBehavior> = [
'height',
];

const BEHAVIOR_DESCRIPTIONS: {[key: KeyboardAvoidingBehavior]: string} = {
const BEHAVIOR_DESCRIPTIONS: Record<KeyboardAvoidingBehavior, string> = {
padding: 'Sets bottom padding equal to the keyboard overlap.',
position: 'Offsets the content container up by the keyboard overlap.',
height: 'Shrinks the view height by the keyboard overlap.',
Expand Down
3 changes: 2 additions & 1 deletion packages/rn-tester/js/utils/testerStateUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export const initialNavigationState: RNTesterNavigationState = {

const filterEmptySections = (examplesList: ExamplesList): any => {
const filteredSections: {
[key: 'apis' | 'components']: Array<SectionData<RNTesterModuleInfo>>,
apis?: Array<SectionData<RNTesterModuleInfo>>,
components?: Array<SectionData<RNTesterModuleInfo>>,
} = {};
const sectionKeys = Object.keys(examplesList);

Expand Down
2 changes: 1 addition & 1 deletion scripts/releases/ios-prebuild/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import type {Dependency, Destination, Platform} from './types';

// CI can't use commas in cache keys, so 'macOS,variant=Mac Catalyst' was creating troubles
// This map that converts from platforms to valid Xcodebuild destinations.
const platformToDestination /*: Readonly<{[key: Platform]: Destination}> */ = {
const platformToDestination /*: Readonly<Record<Platform, Destination>> */ = {
ios: 'iOS',
'ios-simulator': 'iOS Simulator',
macos: 'macOS',
Expand Down
Loading