From bf75bcd274e6770fa6e34064d8ce3b2d7c57c929 Mon Sep 17 00:00:00 2001 From: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Date: Tue, 17 Sep 2019 02:37:58 -0700 Subject: [PATCH] Just run prettier (#38427) --- types/react-native/BatchedBridge.d.ts | 4 +- types/react-native/Devtools.d.ts | 6 +- types/react-native/LaunchScreen.d.ts | 10 +- types/react-native/globals.d.ts | 20 +- types/react-native/index.d.ts | 661 +++++++++++----------- types/react-native/legacy-properties.d.ts | 4 +- 6 files changed, 347 insertions(+), 358 deletions(-) diff --git a/types/react-native/BatchedBridge.d.ts b/types/react-native/BatchedBridge.d.ts index 0f1b02a0f4..ff7db0ed88 100644 --- a/types/react-native/BatchedBridge.d.ts +++ b/types/react-native/BatchedBridge.d.ts @@ -13,11 +13,11 @@ declare class MessageQueue { registerLazyCallableModule(name: string, factory: () => Object): void; } -declare module "react-native/Libraries/BatchedBridge/BatchedBridge" { +declare module 'react-native/Libraries/BatchedBridge/BatchedBridge' { const BatchedBridge: MessageQueue; export default BatchedBridge; } -declare module "react-native/Libraries/BatchedBridge/MessageQueue" { +declare module 'react-native/Libraries/BatchedBridge/MessageQueue' { export default MessageQueue; } diff --git a/types/react-native/Devtools.d.ts b/types/react-native/Devtools.d.ts index fab175c806..7dfbda6c48 100644 --- a/types/react-native/Devtools.d.ts +++ b/types/react-native/Devtools.d.ts @@ -1,4 +1,4 @@ -declare module "react-native/Libraries/Core/Devtools/parseErrorStack" { +declare module 'react-native/Libraries/Core/Devtools/parseErrorStack' { export type StackFrame = { file: string; methodName: string; @@ -13,8 +13,8 @@ declare module "react-native/Libraries/Core/Devtools/parseErrorStack" { export default function parseErrorStack(error: ExtendedError): StackFrame[]; } -declare module "react-native/Libraries/Core/Devtools/symbolicateStackTrace" { - import { StackFrame } from "react-native/Libraries/Core/Devtools/parseErrorStack"; +declare module 'react-native/Libraries/Core/Devtools/symbolicateStackTrace' { + import { StackFrame } from 'react-native/Libraries/Core/Devtools/parseErrorStack'; export default function symbolicateStackTrace(stack: ReadonlyArray): Promise; } diff --git a/types/react-native/LaunchScreen.d.ts b/types/react-native/LaunchScreen.d.ts index a3e93dfc6d..df7f97c61f 100644 --- a/types/react-native/LaunchScreen.d.ts +++ b/types/react-native/LaunchScreen.d.ts @@ -1,9 +1,9 @@ // Adds the JSX elements used in the launch screen. declare module 'react-native/Libraries/NewAppScreen' { - export const Header: any - export const LearnMoreLinks: any - export const Colors: any - export const DebugInstructions: any - export const ReloadInstructions: any + export const Header: any; + export const LearnMoreLinks: any; + export const Colors: any; + export const DebugInstructions: any; + export const ReloadInstructions: any; } diff --git a/types/react-native/globals.d.ts b/types/react-native/globals.d.ts index 319b9dd34a..80b3cb0267 100644 --- a/types/react-native/globals.d.ts +++ b/types/react-native/globals.d.ts @@ -135,9 +135,9 @@ declare var Response: { }; type HeadersInit_ = Headers | string[][] | { [key: string]: string }; -type RequestCredentials_ = "omit" | "same-origin" | "include"; -type RequestMode_ = "navigate" | "same-origin" | "no-cors" | "cors"; -type ResponseType_ = "basic" | "cors" | "default" | "error" | "opaque" | "opaqueredirect"; +type RequestCredentials_ = 'omit' | 'same-origin' | 'include'; +type RequestMode_ = 'navigate' | 'same-origin' | 'no-cors' | 'cors'; +type ResponseType_ = 'basic' | 'cors' | 'default' | 'error' | 'opaque' | 'opaqueredirect'; // // XMLHttpRequest @@ -182,12 +182,12 @@ interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget { readonly UNSENT: number; addEventListener( type: K, - listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any + listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, ): void; // addEventListener(type: string, listener: EventListenerOrEventListenerObject): void; removeEventListener( type: K, - listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any + listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, ): void; // removeEventListener(type: string, listener: EventListenerOrEventListenerObject): void; } @@ -222,12 +222,12 @@ interface XMLHttpRequestEventTarget { ontimeout: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null; addEventListener( type: K, - listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any + listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, ): void; // addEventListener(type: string, listener: EventListenerOrEventListenerObject): void; removeEventListener( type: K, - listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any + listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, ): void; // removeEventListener(type: string, listener: EventListenerOrEventListenerObject): void; } @@ -235,12 +235,12 @@ interface XMLHttpRequestEventTarget { interface XMLHttpRequestUpload extends EventTarget, XMLHttpRequestEventTarget { addEventListener( type: K, - listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any + listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, ): void; // addEventListener(type: string, listener: EventListenerOrEventListenerObject): void; removeEventListener( type: K, - listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any + listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, ): void; // removeEventListener(type: string, listener: EventListenerOrEventListenerObject): void; } @@ -250,7 +250,7 @@ declare var XMLHttpRequestUpload: { new (): XMLHttpRequestUpload; }; -declare type XMLHttpRequestResponseType = "" | "arraybuffer" | "blob" | "document" | "json" | "text"; +declare type XMLHttpRequestResponseType = '' | 'arraybuffer' | 'blob' | 'document' | 'json' | 'text'; /** * Based on definitions of lib.dom and lib.dom.iteralbe diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 1bb668029a..7200aec803 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -44,8 +44,8 @@ /// /// -import * as PropTypes from "prop-types"; -import * as React from "react"; +import * as PropTypes from 'prop-types'; +import * as React from 'react'; type Constructor = new (...args: any[]) => T; @@ -55,7 +55,7 @@ export type MeasureOnSuccessCallback = ( width: number, height: number, pageX: number, - pageY: number + pageY: number, ) => void; export type MeasureInWindowOnSuccessCallback = (x: number, y: number, width: number, height: number) => void; @@ -144,7 +144,7 @@ interface EmitterSubscription extends EventSubscription { emitter: EventEmitter, subscriber: EventSubscriptionVendor, listener: () => any, - context: any + context: any, ): EmitterSubscription; /** @@ -326,7 +326,7 @@ export interface NativeMethodsMixinStatic { measureLayout( relativeToNativeNode: number, onSuccess: MeasureLayoutOnSuccessCallback, - onFail: () => void /* currently unused */ + onFail: () => void /* currently unused */, ): void; /** @@ -543,7 +543,7 @@ export interface LayoutAnimationStatic { spring: (onAnimationDidEnd?: () => void) => void; } -type FlexAlignType = "flex-start" | "flex-end" | "center" | "stretch" | "baseline"; +type FlexAlignType = 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline'; /** * Flex Prop Types @@ -552,9 +552,9 @@ type FlexAlignType = "flex-start" | "flex-end" | "center" | "stretch" | "baselin * @see https://github.com/facebook/react-native/blob/master/Libraries/StyleSheet/LayoutPropTypes.js */ export interface FlexStyle { - alignContent?: "flex-start" | "flex-end" | "center" | "stretch" | "space-between" | "space-around"; + alignContent?: 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'space-between' | 'space-around'; alignItems?: FlexAlignType; - alignSelf?: "auto" | FlexAlignType; + alignSelf?: 'auto' | FlexAlignType; aspectRatio?: number; borderBottomWidth?: number; borderEndWidth?: number | string; @@ -564,16 +564,16 @@ export interface FlexStyle { borderTopWidth?: number; borderWidth?: number; bottom?: number | string; - display?: "none" | "flex"; + display?: 'none' | 'flex'; end?: number | string; flex?: number; flexBasis?: number | string; - flexDirection?: "row" | "column" | "row-reverse" | "column-reverse"; + flexDirection?: 'row' | 'column' | 'row-reverse' | 'column-reverse'; flexGrow?: number; flexShrink?: number; - flexWrap?: "wrap" | "nowrap" | "wrap-reverse"; + flexWrap?: 'wrap' | 'nowrap' | 'wrap-reverse'; height?: number | string; - justifyContent?: "flex-start" | "flex-end" | "center" | "space-between" | "space-around" | "space-evenly"; + justifyContent?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly'; left?: number | string; margin?: number | string; marginBottom?: number | string; @@ -588,7 +588,7 @@ export interface FlexStyle { maxWidth?: number | string; minHeight?: number | string; minWidth?: number | string; - overflow?: "visible" | "hidden" | "scroll"; + overflow?: 'visible' | 'hidden' | 'scroll'; padding?: number | string; paddingBottom?: number | string; paddingEnd?: number | string; @@ -598,7 +598,7 @@ export interface FlexStyle { paddingStart?: number | string; paddingTop?: number | string; paddingVertical?: number | string; - position?: "absolute" | "relative"; + position?: 'absolute' | 'relative'; right?: number | string; start?: number | string; top?: number | string; @@ -608,7 +608,7 @@ export interface FlexStyle { /** * @platform ios */ - direction?: "inherit" | "ltr" | "rtl"; + direction?: 'inherit' | 'ltr' | 'rtl'; } /** @@ -729,18 +729,18 @@ export interface LayoutChangeEvent { }; } -export type FontVariant = "small-caps" | "oldstyle-nums" | "lining-nums" | "tabular-nums" | "proportional-nums"; +export type FontVariant = 'small-caps' | 'oldstyle-nums' | 'lining-nums' | 'tabular-nums' | 'proportional-nums'; export interface TextStyleIOS extends ViewStyle { fontVariant?: FontVariant[]; letterSpacing?: number; textDecorationColor?: string; - textDecorationStyle?: "solid" | "double" | "dotted" | "dashed"; - textTransform?: "none" | "capitalize" | "uppercase" | "lowercase"; - writingDirection?: "auto" | "ltr" | "rtl"; + textDecorationStyle?: 'solid' | 'double' | 'dotted' | 'dashed'; + textTransform?: 'none' | 'capitalize' | 'uppercase' | 'lowercase'; + writingDirection?: 'auto' | 'ltr' | 'rtl'; } export interface TextStyleAndroid extends ViewStyle { - textAlignVertical?: "auto" | "top" | "bottom" | "center"; + textAlignVertical?: 'auto' | 'top' | 'bottom' | 'center'; includeFontPadding?: boolean; } @@ -749,18 +749,18 @@ export interface TextStyle extends TextStyleIOS, TextStyleAndroid, ViewStyle { color?: string; fontFamily?: string; fontSize?: number; - fontStyle?: "normal" | "italic"; + fontStyle?: 'normal' | 'italic'; /** * Specifies font weight. The values 'normal' and 'bold' are supported * for most fonts. Not all fonts have a variant for each of the numeric * values, in that case the closest one is chosen. */ - fontWeight?: "normal" | "bold" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900"; + fontWeight?: 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900'; letterSpacing?: number; lineHeight?: number; - textAlign?: "auto" | "left" | "right" | "center" | "justify"; - textDecorationLine?: "none" | "underline" | "line-through" | "underline line-through"; - textDecorationStyle?: "solid" | "double" | "dotted" | "dashed"; + textAlign?: 'auto' | 'left' | 'right' | 'center' | 'justify'; + textDecorationLine?: 'none' | 'underline' | 'line-through' | 'underline line-through'; + textDecorationStyle?: 'solid' | 'double' | 'dotted' | 'dashed'; textDecorationColor?: string; textShadowColor?: string; textShadowOffset?: { width: number; height: number }; @@ -801,7 +801,7 @@ export interface TextPropsAndroid { * Set text break strategy on Android API Level 23+ * default is `highQuality`. */ - textBreakStrategy?: "simple" | "highQuality" | "balanced"; + textBreakStrategy?: 'simple' | 'highQuality' | 'balanced'; } // https://facebook.github.io/react-native/docs/text.html#props @@ -829,13 +829,13 @@ export interface TextProps extends TextPropsIOS, TextPropsAndroid, Accessibility * * > `clip` is working only for iOS */ - ellipsizeMode?: "head" | "middle" | "tail" | "clip"; + ellipsizeMode?: 'head' | 'middle' | 'tail' | 'clip'; /** * Line Break mode. Works only with numberOfLines. * clip is working only for iOS */ - lineBreakMode?: "head" | "middle" | "tail" | "clip"; + lineBreakMode?: 'head' | 'middle' | 'tail' | 'clip'; /** * Used to truncate the text with an ellipsis after computing the text @@ -896,7 +896,7 @@ declare class TextComponent extends React.Component {} declare const TextBase: Constructor & typeof TextComponent; export class Text extends TextBase {} -type DataDetectorTypes = "phoneNumber" | "link" | "address" | "calendarEvent" | "none" | "all"; +type DataDetectorTypes = 'phoneNumber' | 'link' | 'address' | 'calendarEvent' | 'none' | 'all'; /** * DocumentSelectionState is responsible for maintaining selection information @@ -946,7 +946,7 @@ export interface TextInputIOSProps { * enum('never', 'while-editing', 'unless-editing', 'always') * When the clear button should appear on the right side of the text view */ - clearButtonMode?: "never" | "while-editing" | "unless-editing" | "always"; + clearButtonMode?: 'never' | 'while-editing' | 'unless-editing' | 'always'; /** * If true, clears the text field automatically when editing begins @@ -980,7 +980,7 @@ export interface TextInputIOSProps { /** * Determines the color of the keyboard. */ - keyboardAppearance?: "default" | "light" | "dark"; + keyboardAppearance?: 'default' | 'light' | 'dark'; /** * See DocumentSelectionState.js, some state that is responsible for maintaining selection information for a document @@ -1038,34 +1038,34 @@ export interface TextInputIOSProps { * */ textContentType?: - | "none" - | "URL" - | "addressCity" - | "addressCityAndState" - | "addressState" - | "countryName" - | "creditCardNumber" - | "emailAddress" - | "familyName" - | "fullStreetAddress" - | "givenName" - | "jobTitle" - | "location" - | "middleName" - | "name" - | "namePrefix" - | "nameSuffix" - | "nickname" - | "organizationName" - | "postalCode" - | "streetAddressLine1" - | "streetAddressLine2" - | "sublocality" - | "telephoneNumber" - | "username" - | "password" - | "newPassword" - | "oneTimeCode"; + | 'none' + | 'URL' + | 'addressCity' + | 'addressCityAndState' + | 'addressState' + | 'countryName' + | 'creditCardNumber' + | 'emailAddress' + | 'familyName' + | 'fullStreetAddress' + | 'givenName' + | 'jobTitle' + | 'location' + | 'middleName' + | 'name' + | 'namePrefix' + | 'nameSuffix' + | 'nickname' + | 'organizationName' + | 'postalCode' + | 'streetAddressLine1' + | 'streetAddressLine2' + | 'sublocality' + | 'telephoneNumber' + | 'username' + | 'password' + | 'newPassword' + | 'oneTimeCode'; /** * If false, scrolling of the text view will be disabled. The default value is true. Only works with multiline={true} @@ -1101,19 +1101,19 @@ export interface TextInputAndroidProps { * - `off` */ autoCompleteType?: - | "cc-csc" - | "cc-exp" - | "cc-exp-month" - | "cc-exp-year" - | "cc-number" - | "email" - | "name" - | "password" - | "postal-code" - | "street-address" - | "tel" - | "username" - | "off"; + | 'cc-csc' + | 'cc-exp' + | 'cc-exp-month' + | 'cc-exp-year' + | 'cc-number' + | 'email' + | 'name' + | 'password' + | 'postal-code' + | 'street-address' + | 'tel' + | 'username' + | 'off'; /** * When false, if there is a small amount of space available around a text input (e.g. landscape orientation on a phone), @@ -1149,7 +1149,7 @@ export interface TextInputAndroidProps { * Set text break strategy on Android API Level 23+, possible values are simple, highQuality, balanced * The default value is simple. */ - textBreakStrategy?: "simple" | "highQuality" | "balanced"; + textBreakStrategy?: 'simple' | 'highQuality' | 'balanced'; /** * The color of the textInput underline. @@ -1159,25 +1159,25 @@ export interface TextInputAndroidProps { /** * Vertically align text when `multiline` is set to true */ - textAlignVertical?: "auto" | "top" | "bottom" | "center"; + textAlignVertical?: 'auto' | 'top' | 'bottom' | 'center'; } -export type KeyboardType = "default" | "email-address" | "numeric" | "phone-pad"; +export type KeyboardType = 'default' | 'email-address' | 'numeric' | 'phone-pad'; export type KeyboardTypeIOS = - | "ascii-capable" - | "numbers-and-punctuation" - | "url" - | "number-pad" - | "name-phone-pad" - | "decimal-pad" - | "twitter" - | "web-search"; -export type KeyboardTypeAndroid = "visible-password"; + | 'ascii-capable' + | 'numbers-and-punctuation' + | 'url' + | 'number-pad' + | 'name-phone-pad' + | 'decimal-pad' + | 'twitter' + | 'web-search'; +export type KeyboardTypeAndroid = 'visible-password'; export type KeyboardTypeOptions = KeyboardType | KeyboardTypeAndroid | KeyboardTypeIOS; -export type ReturnKeyType = "done" | "go" | "next" | "search" | "send"; -export type ReturnKeyTypeAndroid = "none" | "previous"; -export type ReturnKeyTypeIOS = "default" | "google" | "join" | "route" | "yahoo" | "emergency-call"; +export type ReturnKeyType = 'done' | 'go' | 'next' | 'search' | 'send'; +export type ReturnKeyTypeAndroid = 'none' | 'previous'; +export type ReturnKeyTypeIOS = 'default' | 'google' | 'join' | 'route' | 'yahoo' | 'emergency-call'; export type ReturnKeyTypeOptions = ReturnKeyType | ReturnKeyTypeAndroid | ReturnKeyTypeIOS; export interface TargetedEvent { @@ -1264,7 +1264,7 @@ export interface TextInputProps extends ViewProps, TextInputIOSProps, TextInputA * * https://facebook.github.io/react-native/docs/textinput.html#autocapitalize */ - autoCapitalize?: "none" | "sentences" | "words" | "characters"; + autoCapitalize?: 'none' | 'sentences' | 'words' | 'characters'; /** * If false, disables auto-correct. @@ -1529,7 +1529,7 @@ export type ToolbarAndroidAction = { /** * show: when to show this action as an icon or hide it in the overflow menu: always, ifRoom or never */ - show?: "always" | "ifRoom" | "never"; + show?: 'always' | 'ifRoom' | 'never'; /** * showWithText: boolean, whether to show text alongside the icon or not @@ -1777,7 +1777,7 @@ export interface GestureResponderHandlers { * @see https://github.com/facebook/react-native/blob/master/Libraries/Components/View/ViewStylePropTypes.js */ export interface ViewStyle extends FlexStyle, ShadowStyleIOS, TransformsStyle { - backfaceVisibility?: "visible" | "hidden"; + backfaceVisibility?: 'visible' | 'hidden'; backgroundColor?: string; borderBottomColor?: string; borderBottomEndRadius?: number; @@ -1793,7 +1793,7 @@ export interface ViewStyle extends FlexStyle, ShadowStyleIOS, TransformsStyle { borderRightColor?: string; borderRightWidth?: number; borderStartColor?: string; - borderStyle?: "solid" | "dotted" | "dashed"; + borderStyle?: 'solid' | 'dotted' | 'dashed'; borderTopColor?: string; borderTopEndRadius?: number; borderTopLeftRadius?: number; @@ -2020,14 +2020,14 @@ export type AccessibilityActionEvent = NativeSyntheticEvent< // @deprecated: use AccessibilityState available in 0.60+ export type AccessibilityStates = - | "disabled" - | "selected" - | "checked" - | "unchecked" - | "busy" - | "expanded" - | "collapsed" - | "hasPopup"; + | 'disabled' + | 'selected' + | 'checked' + | 'unchecked' + | 'busy' + | 'expanded' + | 'collapsed' + | 'hasPopup'; export interface AccessibilityState { /** @@ -2041,7 +2041,7 @@ export interface AccessibilityState { /** * For items like Checkboxes and Toggle switches, reports their state to accessible tools */ - checked?: boolean | "mixed"; + checked?: boolean | 'mixed'; /** * When present, informs accessible tools if the element is busy */ @@ -2053,33 +2053,33 @@ export interface AccessibilityState { } export type AccessibilityRole = - | "none" - | "button" - | "link" - | "search" - | "image" - | "keyboardkey" - | "text" - | "adjustable" - | "imagebutton" - | "header" - | "summary" - | "alert" - | "checkbox" - | "combobox" - | "menu" - | "menubar" - | "menuitem" - | "progressbar" - | "radio" - | "radiogroup" - | "scrollbar" - | "spinbutton" - | "switch" - | "tab" - | "tablist" - | "timer" - | "toolbar"; + | 'none' + | 'button' + | 'link' + | 'search' + | 'image' + | 'keyboardkey' + | 'text' + | 'adjustable' + | 'imagebutton' + | 'header' + | 'summary' + | 'alert' + | 'checkbox' + | 'combobox' + | 'menu' + | 'menubar' + | 'menuitem' + | 'progressbar' + | 'radio' + | 'radiogroup' + | 'scrollbar' + | 'spinbutton' + | 'switch' + | 'tab' + | 'tablist' + | 'timer' + | 'toolbar'; export interface AccessibilityPropsAndroid { /** @@ -2089,7 +2089,7 @@ export interface AccessibilityPropsAndroid { * for any UI component. For instances, we support ‘button’, ‘radiobutton_checked’ and ‘radiobutton_unchecked’ and so on. * @platform android */ - accessibilityComponentType?: "none" | "button" | "radiobutton_checked" | "radiobutton_unchecked"; + accessibilityComponentType?: 'none' | 'button' | 'radiobutton_checked' | 'radiobutton_unchecked'; /** * Indicates to accessibility services whether the user should be notified when this view changes. @@ -2097,7 +2097,7 @@ export interface AccessibilityPropsAndroid { * See http://developer.android.com/reference/android/view/View.html#attr_android:accessibilityLiveRegion for references. * @platform android */ - accessibilityLiveRegion?: "none" | "polite" | "assertive"; + accessibilityLiveRegion?: 'none' | 'polite' | 'assertive'; /** * Controls how view is important for accessibility which is if it fires accessibility events @@ -2110,7 +2110,7 @@ export interface AccessibilityPropsAndroid { * 'no' - The view is not important for accessibility. * 'no-hide-descendants' - The view is not important for accessibility, nor are any of its descendant views. */ - importantForAccessibility?: "auto" | "yes" | "no" | "no-hide-descendants"; + importantForAccessibility?: 'auto' | 'yes' | 'no' | 'no-hide-descendants'; } export interface AccessibilityPropsIOS { @@ -2154,23 +2154,23 @@ export interface AccessibilityPropsIOS { } type AccessibilityTrait = - | "none" - | "button" - | "link" - | "header" - | "search" - | "image" - | "selected" - | "plays" - | "key" - | "text" - | "summary" - | "disabled" - | "frequentUpdates" - | "startsMedia" - | "adjustable" - | "allowsDirectInteraction" - | "pageTurn"; + | 'none' + | 'button' + | 'link' + | 'header' + | 'search' + | 'image' + | 'selected' + | 'plays' + | 'key' + | 'text' + | 'summary' + | 'disabled' + | 'frequentUpdates' + | 'startsMedia' + | 'adjustable' + | 'allowsDirectInteraction' + | 'pageTurn'; /** * @see https://facebook.github.io/react-native/docs/view.html#props @@ -2223,7 +2223,7 @@ export interface ViewProps * But since pointerEvents does not affect layout/appearance, and we are already deviating from the spec by adding additional modes, * we opt to not include pointerEvents on style. On some platforms, we would need to implement it as a className anyways. Using style or not is an implementation detail of the platform. */ - pointerEvents?: "box-none" | "none" | "box-only" | "auto"; + pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto'; /** * @@ -2315,14 +2315,14 @@ export interface ViewPagerAndroidProps extends ViewProps { * - settling, meaning that there was an interaction with the page scroller, and the * page scroller is now finishing it's closing or opening animation */ - onPageScrollStateChanged?: (state: "Idle" | "Dragging" | "Settling") => void; + onPageScrollStateChanged?: (state: 'Idle' | 'Dragging' | 'Settling') => void; /** * Determines whether the keyboard gets dismissed in response to a drag. * - 'none' (the default), drags do not dismiss the keyboard. * - 'on-drag', the keyboard is dismissed when a drag begins. */ - keyboardDismissMode?: "none" | "on-drag"; + keyboardDismissMode?: 'none' | 'on-drag'; /** * Blank space to show between pages. This is only visible while scrolling, pages are still @@ -2356,7 +2356,7 @@ declare const KeyboardAvoidingViewBase: Constructor & typeof Keyboar export class KeyboardAvoidingView extends KeyboardAvoidingViewBase {} export interface KeyboardAvoidingViewProps extends ViewProps { - behavior?: "height" | "position" | "padding"; + behavior?: 'height' | 'position' | 'padding'; /** * The style of the content container(View) when behavior is 'position'. @@ -2621,7 +2621,7 @@ export interface ActivityIndicatorProps extends ViewProps { * * enum('small', 'large') */ - size?: number | "small" | "large"; + size?: number | 'small' | 'large'; style?: StyleProp; } @@ -2660,7 +2660,7 @@ export interface ActivityIndicatorIOSProps extends ViewProps { * * enum('small', 'large') */ - size?: "small" | "large"; + size?: 'small' | 'large'; style?: StyleProp; } @@ -2698,7 +2698,7 @@ export interface DatePickerIOSProps extends ViewProps { * enum('date', 'time', 'datetime') * The date picker mode. */ - mode?: "date" | "time" | "datetime"; + mode?: 'date' | 'time' | 'datetime'; /** * Date change handler. @@ -2750,7 +2750,7 @@ export interface DrawerLayoutAndroidProps extends ViewProps { * not respond to gestures. The drawer may still be opened and * closed programmatically (openDrawer/closeDrawer). */ - drawerLockMode?: "unlocked" | "locked-closed" | "locked-open"; + drawerLockMode?: 'unlocked' | 'locked-closed' | 'locked-open'; /** * Specifies the side of the screen from which the drawer will slide in. @@ -2769,7 +2769,7 @@ export interface DrawerLayoutAndroidProps extends ViewProps { * - 'none' (the default), drags do not dismiss the keyboard. * - 'on-drag', the keyboard is dismissed when a drag begins. */ - keyboardDismissMode?: "none" | "on-drag"; + keyboardDismissMode?: 'none' | 'on-drag'; /** * Function called whenever the navigation view has been closed. @@ -2797,7 +2797,7 @@ export interface DrawerLayoutAndroidProps extends ViewProps { * navigation view, and the navigation view is now finishing * it's closing or opening animation */ - onDrawerStateChanged?: (event: "Idle" | "Dragging" | "Settling") => void; + onDrawerStateChanged?: (event: 'Idle' | 'Dragging' | 'Settling') => void; /** * The navigation view that will be rendered to the side of the @@ -2886,7 +2886,7 @@ export interface PickerPropsAndroid extends ViewProps { * * @platform android */ - mode?: "dialog" | "dropdown"; + mode?: 'dialog' | 'dropdown'; /** * Prompt string for this picker, used on Android in dialog mode as the title of the dialog. @@ -2975,7 +2975,7 @@ export interface ProgressBarAndroidProps extends ViewProps { SmallInverse LargeInverse */ - styleAttr?: "Horizontal" | "Normal" | "Small" | "Large" | "Inverse" | "SmallInverse" | "LargeInverse"; + styleAttr?: 'Horizontal' | 'Normal' | 'Small' | 'Large' | 'Inverse' | 'SmallInverse' | 'LargeInverse'; /** * If the progress bar will show indeterminate progress. @@ -3019,7 +3019,7 @@ export interface ProgressViewIOSProps extends ViewProps { /** * The progress bar style. */ - progressViewStyle?: "default" | "bar"; + progressViewStyle?: 'default' | 'bar'; /** * The progress value (between 0 and 1). @@ -3314,7 +3314,7 @@ export interface SwitchIOSProps extends ViewProps { */ export class SwitchIOS extends React.Component {} -export type ImageResizeMode = "cover" | "contain" | "stretch" | "repeat" | "center"; +export type ImageResizeMode = 'cover' | 'contain' | 'stretch' | 'repeat' | 'center'; /** * @see ImageResizeMode.js @@ -3364,7 +3364,7 @@ export interface ShadowStyleIOS { */ export interface ImageStyle extends FlexStyle, ShadowStyleIOS, TransformsStyle { resizeMode?: ImageResizeMode; - backfaceVisibility?: "visible" | "hidden"; + backfaceVisibility?: 'visible' | 'hidden'; borderBottomLeftRadius?: number; borderBottomRightRadius?: number; backgroundColor?: string; @@ -3373,7 +3373,7 @@ export interface ImageStyle extends FlexStyle, ShadowStyleIOS, TransformsStyle { borderRadius?: number; borderTopLeftRadius?: number; borderTopRightRadius?: number; - overflow?: "visible" | "hidden"; + overflow?: 'visible' | 'hidden'; overlayColor?: string; tintColor?: string; opacity?: number; @@ -3425,7 +3425,7 @@ export interface ImageURISource { * * @platform ios */ - cache?: "default" | "reload" | "force-cache" | "only-if-cached"; + cache?: 'default' | 'reload' | 'force-cache' | 'only-if-cached'; /** * `body` is the HTTP body to send with the request. This must be a valid * UTF-8 string, and will be sent exactly as specified, with no @@ -3498,7 +3498,7 @@ interface ImagePropsAndroid { * and produces higher quality images. This should be used if the image is smaller than the view. * It should also be used if the image is slightly bigger than the view. */ - resizeMethod?: "auto" | "resize" | "scale"; + resizeMethod?: 'auto' | 'resize' | 'scale'; /** * Duration of fade in animation in ms. Defaults to 300 @@ -3643,7 +3643,7 @@ export interface ImagePropsBase extends ImagePropsIOS, ImagePropsAndroid, Access * * @platform android */ - resizeMethod?: "auto" | "resize" | "scale"; + resizeMethod?: 'auto' | 'resize' | 'scale'; /** * The image source (either a remote URL or a local file resource). @@ -3688,7 +3688,7 @@ export class Image extends ImageBase { static getSize(uri: string, success: (width: number, height: number) => void, failure: (error: any) => void): any; static prefetch(url: string): any; static abortPrefetch?(requestId: number): void; - static queryCache?(urls: string[]): Promise<{[url: string]: "memory" | "disk" | "disk/memory"}>; + static queryCache?(urls: string[]): Promise<{ [url: string]: 'memory' | 'disk' | 'disk/memory' }>; /** * @see https://facebook.github.io/react-native/docs/image.html#resolveassetsource @@ -3709,7 +3709,7 @@ export class ImageBackground extends ImageBackgroundBase { getSize(uri: string, success: (width: number, height: number) => void, failure: (error: any) => void): any; prefetch(url: string): any; abortPrefetch?(requestId: number): void; - queryCache?(urls: string[]): Promise<{[url: string]: "memory" | "disk" | "disk/memory"}>; + queryCache?(urls: string[]): Promise<{ [url: string]: 'memory' | 'disk' | 'disk/memory' }>; } export interface ViewToken { @@ -3768,7 +3768,7 @@ export interface ListRenderItemInfo { separators: { highlight: () => void; unhighlight: () => void; - updateProps: (select: "leading" | "trailing", newProps: any) => void; + updateProps: (select: 'leading' | 'trailing', newProps: any) => void; }; } @@ -3818,7 +3818,7 @@ export interface FlatListProps extends VirtualizedListProps { * - false, deprecated, use 'never' instead * - true, deprecated, use 'always' instead */ - keyboardShouldPersistTaps?: boolean | "always" | "never" | "handled"; + keyboardShouldPersistTaps?: boolean | 'always' | 'never' | 'handled'; /** * For simplicity, data is just a plain array. If you want to use something else, @@ -4058,7 +4058,7 @@ export interface SectionListProps extends VirtualizedListWithoutRenderIte */ getItemLayout?: ( data: SectionListData[] | null, - index: number + index: number, ) => { length: number; offset: number; index: number }; /** @@ -4102,13 +4102,11 @@ export interface SectionListProps extends VirtualizedListWithoutRenderIte * Recommended action is to either compute your own offset and `scrollTo` it, or scroll as far * as possible and then try again after more items have been rendered. */ - onScrollToIndexFailed?: ( - info: { - index: number; - highestMeasuredFrameIndex: number; - averageItemLength: number; - } - ) => void; + onScrollToIndexFailed?: (info: { + index: number; + highestMeasuredFrameIndex: number; + averageItemLength: number; + }) => void; /** * Set this true while waiting for new data from a refresh. @@ -4240,7 +4238,7 @@ export interface VirtualizedListWithoutRenderItemProps extends ScrollView getItemLayout?: ( data: any, - index: number + index: number, ) => { length: number; offset: number; @@ -4297,13 +4295,11 @@ export interface VirtualizedListWithoutRenderItemProps extends ScrollView * Recommended action is to either compute your own offset and `scrollTo` it, or scroll as far * as possible and then try again after more items have been rendered. */ - onScrollToIndexFailed?: ( - info: { - index: number; - highestMeasuredFrameIndex: number; - averageItemLength: number; - } - ) => void; + onScrollToIndexFailed?: (info: { + index: number; + highestMeasuredFrameIndex: number; + averageItemLength: number; + }) => void; /** * Called when the viewability of rows changes, as defined by the @@ -4390,7 +4386,7 @@ export interface ListViewProps extends ScrollViewProps { */ onChangeVisibleRows?: ( visibleRows: Array<{ [sectionId: string]: { [rowID: string]: boolean } }>, - changedRows: Array<{ [sectionId: string]: { [rowID: string]: boolean } }> + changedRows: Array<{ [sectionId: string]: { [rowID: string]: boolean } }>, ) => void; /** @@ -4448,7 +4444,7 @@ export interface ListViewProps extends ScrollViewProps { rowData: any, sectionID: string | number, rowID: string | number, - highlightRow?: boolean + highlightRow?: boolean, ) => React.ReactElement; /** @@ -4477,7 +4473,7 @@ export interface ListViewProps extends ScrollViewProps { renderSeparator?: ( sectionID: string | number, rowID: string | number, - adjacentRowHighlighted?: boolean + adjacentRowHighlighted?: boolean, ) => React.ReactElement; /** @@ -4568,7 +4564,7 @@ export interface ModalBaseProps { * - `fade` fades into view * - `none` appears without an animation */ - animationType?: "none" | "slide" | "fade"; + animationType?: 'none' | 'slide' | 'fade'; /** * The `transparent` prop determines whether your modal will fill the entire view. * Setting this to `true` will render the modal over a transparent background. @@ -4593,14 +4589,14 @@ export interface ModalPropsIOS { /** * The `presentationStyle` determines the style of modal to show */ - presentationStyle?: "fullScreen" | "pageSheet" | "formSheet" | "overFullScreen"; + presentationStyle?: 'fullScreen' | 'pageSheet' | 'formSheet' | 'overFullScreen'; /** * The `supportedOrientations` prop allows the modal to be rotated to any of the specified orientations. * On iOS, the modal is still restricted by what's specified in your app's Info.plist's UISupportedInterfaceOrientations field. */ supportedOrientations?: Array< - "portrait" | "portrait-upside-down" | "landscape" | "landscape-left" | "landscape-right" + 'portrait' | 'portrait-upside-down' | 'landscape' | 'landscape-left' | 'landscape-right' >; /** @@ -4895,13 +4891,13 @@ interface BaseBackgroundPropType { } interface RippleBackgroundPropType extends BaseBackgroundPropType { - type: "RippleAndroid"; + type: 'RippleAndroid'; color?: number; borderless?: boolean; } interface ThemeAttributeBackgroundPropType extends BaseBackgroundPropType { - type: "ThemeAttrAndroid"; + type: 'ThemeAttrAndroid'; attribute: string; } @@ -5096,7 +5092,7 @@ export namespace StyleSheet { export const hairlineWidth: number; interface AbsoluteFillStyle { - position: "absolute"; + position: 'absolute'; left: 0; right: 0; top: 0; @@ -5249,7 +5245,7 @@ export interface ListViewDataSource { */ cloneWithRows( dataBlob: Array | { [key: string]: any }, - rowIdentities?: Array + rowIdentities?: Array, ): ListViewDataSource; /** @@ -5266,7 +5262,7 @@ export interface ListViewDataSource { cloneWithRowsAndSections( dataBlob: Array | { [key: string]: any }, sectionIdentities?: Array, - rowIdentities?: Array> + rowIdentities?: Array>, ): ListViewDataSource; getRowCount(): number; @@ -5364,18 +5360,18 @@ export interface TabBarIOSItemProps extends ViewProps { * enum('bookmarks', 'contacts', 'downloads', 'favorites', 'featured', 'history', 'more', 'most-recent', 'most-viewed', 'recents', 'search', 'top-rated') */ systemIcon?: - | "bookmarks" - | "contacts" - | "downloads" - | "favorites" - | "featured" - | "history" - | "more" - | "most-recent" - | "most-viewed" - | "recents" - | "search" - | "top-rated"; + | 'bookmarks' + | 'contacts' + | 'downloads' + | 'favorites' + | 'featured' + | 'history' + | 'more' + | 'most-recent' + | 'most-viewed' + | 'recents' + | 'search' + | 'top-rated'; /** * Text that appears under the icon. It is ignored when a system icon is defined. @@ -5403,7 +5399,7 @@ export interface TabBarIOSProps extends ViewProps { * this value defaults to `fill`, in a horizontally regular one (e.g. iPad) * it defaults to center. */ - itemPositioning?: "fill" | "center" | "auto"; + itemPositioning?: 'fill' | 'center' | 'auto'; /** * Color of the currently selected tab icon @@ -5487,7 +5483,7 @@ export interface PixelRatioStatic { /** * @see https://facebook.github.io/react-native/docs/platform-specific-code.html#content */ -export type PlatformOSType = "ios" | "android" | "macos" | "windows" | "web"; +export type PlatformOSType = 'ios' | 'android' | 'macos' | 'windows' | 'web'; interface PlatformStatic { isTV: boolean; @@ -5496,7 +5492,7 @@ interface PlatformStatic { /** * @see https://facebook.github.io/react-native/docs/platform-specific-code.html#content */ - select(specifics: { [platform in PlatformOSType | "default"]?: T }): T; + select(specifics: { [platform in PlatformOSType | 'default']?: T }): T; } interface PlatformIOSStatic extends PlatformStatic { @@ -5570,7 +5566,7 @@ export interface Dimensions { @param dim Name of dimension as defined when calling set. @returns Value for the dimension. */ - get(dim: "window" | "screen"): ScaledSize; + get(dim: 'window' | 'screen'): ScaledSize; /** * This should only be called from native code by sending the didUpdateDimensions event. @@ -5585,8 +5581,8 @@ export interface Dimensions { * @param handler the event handler */ addEventListener( - type: "change", - handler: ({ window, screen }: { window: ScaledSize; screen: ScaledSize }) => void + type: 'change', + handler: ({ window, screen }: { window: ScaledSize; screen: ScaledSize }) => void, ): void; /** @@ -5596,8 +5592,8 @@ export interface Dimensions { * @param handler the event handler */ removeEventListener( - type: "change", - handler: ({ window, screen }: { window: ScaledSize; screen: ScaledSize }) => void + type: 'change', + handler: ({ window, screen }: { window: ScaledSize; screen: ScaledSize }) => void, ): void; } @@ -5623,7 +5619,7 @@ export interface InteractionManagerStatic extends EventEmitterListener { * Returns a cancellable */ runAfterInteractions( - task?: (() => any) | SimpleTask | PromiseTask + task?: (() => any) | SimpleTask | PromiseTask, ): { then: (onfulfilled?: () => any, onrejected?: () => any) => Promise; done: (...args: any[]) => any; @@ -5822,7 +5818,7 @@ interface ScrollResponderMixin extends SubscribableMixin { scrollResponderScrollTo( x?: number | { x?: number; y?: number; animated?: boolean }, y?: number, - animated?: boolean + animated?: boolean, ): void; /** @@ -5833,7 +5829,7 @@ interface ScrollResponderMixin extends SubscribableMixin { */ scrollResponderZoomTo( rect: { x: number; y: number; width: number; height: number; animated?: boolean }, - animated?: boolean // deprecated, put this inside the rect argument instead + animated?: boolean, // deprecated, put this inside the rect argument instead ): void; /** @@ -5849,7 +5845,7 @@ interface ScrollResponderMixin extends SubscribableMixin { scrollResponderScrollNativeHandleToKeyboard( nodeHandle: any, additionalOffset?: number, - preventNegativeScrollOffset?: boolean + preventNegativeScrollOffset?: boolean, ): void; /** @@ -5975,7 +5971,7 @@ export interface ScrollViewPropsIOS { * This property specifies how the safe area insets are used to modify the content area of the scroll view. * The default value of this property must be 'automatic'. But the default value is 'never' until RN@0.51. */ - contentInsetAdjustmentBehavior?: "automatic" | "scrollableAxes" | "never" | "always"; + contentInsetAdjustmentBehavior?: 'automatic' | 'scrollableAxes' | 'never' | 'always'; /** * A floating-point number that determines how quickly the scroll view @@ -5983,7 +5979,7 @@ export interface ScrollViewPropsIOS { * - Normal: 0.998 (the default) * - Fast: 0.9 */ - decelerationRate?: "fast" | "normal" | number; + decelerationRate?: 'fast' | 'normal' | number; /** * When true the ScrollView will try to lock to only vertical or horizontal @@ -5999,7 +5995,7 @@ export interface ScrollViewPropsIOS { * - white, scroll indicator is white. This style is good against * a black content background. */ - indicatorStyle?: "default" | "black" | "white"; + indicatorStyle?: 'default' | 'black' | 'white'; /** * The maximum allowed zoom scale. The default value is 1.0. @@ -6085,7 +6081,7 @@ export interface ScrollViewPropsAndroid { * - 'always' - Always allow a user to over-scroll this view. * - 'never' - Never allow a user to over-scroll this view. */ - overScrollMode?: "auto" | "always" | "never"; + overScrollMode?: 'auto' | 'always' | 'never'; /** * Enables nested scrolling for Android API level 21+. Nested scrolling is supported by default on iOS. @@ -6131,7 +6127,7 @@ export interface ScrollViewProps extends ViewProps, ScrollViewPropsIOS, ScrollVi * and moves in synchrony with the touch; dragging upwards cancels the * dismissal. */ - keyboardDismissMode?: "none" | "interactive" | "on-drag"; + keyboardDismissMode?: 'none' | 'interactive' | 'on-drag'; /** * Determines when the keyboard should stay visible after a tap. @@ -6141,7 +6137,7 @@ export interface ScrollViewProps extends ViewProps, ScrollViewPropsIOS, ScrollVi * - false, deprecated, use 'never' instead * - true, deprecated, use 'always' instead */ - keyboardShouldPersistTaps?: boolean | "always" | "never" | "handled"; + keyboardShouldPersistTaps?: boolean | 'always' | 'never' | 'handled'; /** * Called when scrollable content view of the ScrollView changes. @@ -6224,7 +6220,7 @@ export interface ScrollViewProps extends ViewProps, ScrollViewPropsIOS, ScrollVi * - `center` will align the snap in the center * - `end` will align the snap at the right (horizontal) or bottom (vertical) */ - snapToAlignment?: "start" | "center" | "end"; + snapToAlignment?: 'start' | 'center' | 'end'; /** * When set, causes the scroll view to stop at multiples of the value of `snapToInterval`. @@ -6375,7 +6371,7 @@ export interface SwipeableListViewDataSource { cloneWithRowsAndSections( dataBlob: any, sectionIdentities?: Array, - rowIdentities?: Array> + rowIdentities?: Array>, ): SwipeableListViewDataSource; getDataSource(): ListViewDataSource; getOpenRowID(): string; @@ -6404,7 +6400,7 @@ export interface SwipeableListViewProps { rowData: any, sectionID: string | number, rowID: string | number, - highlightRow?: boolean + highlightRow?: boolean, ) => React.ReactElement; // Callback method to render the view that will be unveiled on swipe @@ -6494,7 +6490,7 @@ export interface ActionSheetIOSStatic { showShareActionSheetWithOptions: ( options: ShareActionSheetIOSOptions, failureCallback: (error: Error) => void, - successCallback: (success: boolean, method: string) => void + successCallback: (success: boolean, method: string) => void, ) => void; } @@ -6516,12 +6512,12 @@ export type ShareOptions = { }; export type ShareSharedAction = { - action: "sharedAction"; + action: 'sharedAction'; activityType?: string; }; export type ShareDismissedAction = { - action: "dismissedAction" + action: 'dismissedAction'; }; export type ShareAction = ShareSharedAction | ShareDismissedAction; @@ -6560,19 +6556,19 @@ export interface ShareStatic { * */ share(content: ShareContent, options?: ShareOptions): Promise; - sharedAction: "sharedAction"; - dismissedAction: "dismissedAction"; + sharedAction: 'sharedAction'; + dismissedAction: 'dismissedAction'; } type AccessibilityEventName = - "change" | // deprecated, maps to screenReaderChanged - "boldTextChanged" | // iOS-only Event - "grayscaleChanged" | // iOS-only Event - "invertColorsChanged" | // iOS-only Event - "reduceMotionChanged" | - "screenReaderChanged" | - "reduceTransparencyChanged" | // iOS-only Event - "announcementFinished"; // iOS-only Event + | 'change' // deprecated, maps to screenReaderChanged + | 'boldTextChanged' // iOS-only Event + | 'grayscaleChanged' // iOS-only Event + | 'invertColorsChanged' // iOS-only Event + | 'reduceMotionChanged' + | 'screenReaderChanged' + | 'reduceTransparencyChanged' // iOS-only Event + | 'announcementFinished'; // iOS-only Event type AccessibilityChangeEvent = boolean; @@ -6671,7 +6667,7 @@ export interface AccessibilityInfoStatic { export interface AlertButton { text?: string; onPress?: () => void; - style?: "default" | "cancel" | "destructive"; + style?: 'default' | 'cancel' | 'destructive'; } interface AlertOptions { @@ -6723,7 +6719,7 @@ export interface AlertStatic { alert: (title: string, message?: string, buttons?: AlertButton[], options?: AlertOptions) => void; } -export type AlertType = "default" | "plain-text" | "secure-text" | "login-password"; +export type AlertType = 'default' | 'plain-text' | 'secure-text' | 'login-password'; /** * AppStateIOS can tell you if the app is in the foreground or background, @@ -6741,8 +6737,8 @@ export type AlertType = "default" | "plain-text" | "secure-text" | "login-passwo * * @see https://facebook.github.io/react-native/docs/appstateios.html#content */ -export type AppStateEvent = "change" | "memoryWarning"; -export type AppStateStatus = "active" | "background" | "inactive"; +export type AppStateEvent = 'change' | 'memoryWarning'; +export type AppStateStatus = 'active' | 'background' | 'inactive'; export interface AppStateStatic { currentState: AppStateStatus; @@ -6809,7 +6805,7 @@ export interface AsyncStorageStatic { */ multiGet( keys: string[], - callback?: (errors?: Error[], result?: [string, string][]) => void + callback?: (errors?: Error[], result?: [string, string][]) => void, ): Promise<[string, string][]>; /** @@ -6833,7 +6829,7 @@ export interface AsyncStorageStatic { multiMerge(keyValuePairs: string[][], callback?: (errors?: Error[]) => void): Promise; } -export type BackPressEventName = "hardwareBackPress"; +export type BackPressEventName = 'hardwareBackPress'; /** * Detect hardware back button presses, and programmatically invoke the @@ -6862,8 +6858,8 @@ export interface ButtonProps { export class Button extends React.Component {} -export type CameraRollGroupType = "Album" | "All" | "Event" | "Faces" | "Library" | "PhotoStream" | "SavedPhotos"; -export type CameraRollAssetType = "All" | "Videos" | "Photos"; +export type CameraRollGroupType = 'Album' | 'All' | 'Event' | 'Faces' | 'Library' | 'PhotoStream' | 'SavedPhotos'; +export type CameraRollAssetType = 'All' | 'Videos' | 'Photos'; export interface CameraRollFetchParams { first: number; @@ -6967,7 +6963,7 @@ export interface CameraRollStatic { * * Returns a Promise which will resolve with the new URI. */ - saveToCameraRoll(tag: string, type?: "photo" | "video"): Promise; + saveToCameraRoll(tag: string, type?: 'photo' | 'video'): Promise; /** * Saves the photo or video to the camera roll / gallery. @@ -6983,7 +6979,7 @@ export interface CameraRollStatic { * * Returns a Promise which will resolve with the new URI. */ - saveToCameraRoll(tag: string, type?: "photo" | "video"): Promise; + saveToCameraRoll(tag: string, type?: 'photo' | 'video'): Promise; /** * Invokes callback with photo identifier objects from the local camera roll of the device matching shape defined by getPhotosReturnChecker. @@ -7033,7 +7029,7 @@ export interface DatePickerAndroidOpenOptions { date?: Date | number; minDate?: Date | number; maxDate?: Date | number; - mode?: "calendar" | "spinner" | "default"; + mode?: 'calendar' | 'spinner' | 'default'; } // Deduced from DatePickerAndroid.android.js @@ -7048,7 +7044,7 @@ export interface DatePickerAndroidDismissedAction { action: 'dismissedAction'; } -export type DatePickerAndroidOpenReturn = DatePickerAndroidDateSetAction | DatePickerAndroidDismissedAction +export type DatePickerAndroidOpenReturn = DatePickerAndroidDateSetAction | DatePickerAndroidDismissedAction; export interface DatePickerAndroidStatic { /** @@ -7254,32 +7250,32 @@ export interface Rationale { } export type Permission = - | "android.permission.READ_CALENDAR" - | "android.permission.WRITE_CALENDAR" - | "android.permission.CAMERA" - | "android.permission.READ_CONTACTS" - | "android.permission.WRITE_CONTACTS" - | "android.permission.GET_ACCOUNTS" - | "android.permission.ACCESS_FINE_LOCATION" - | "android.permission.ACCESS_COARSE_LOCATION" - | "android.permission.RECORD_AUDIO" - | "android.permission.READ_PHONE_STATE" - | "android.permission.CALL_PHONE" - | "android.permission.READ_CALL_LOG" - | "android.permission.WRITE_CALL_LOG" - | "com.android.voicemail.permission.ADD_VOICEMAIL" - | "android.permission.USE_SIP" - | "android.permission.PROCESS_OUTGOING_CALLS" - | "android.permission.BODY_SENSORS" - | "android.permission.SEND_SMS" - | "android.permission.RECEIVE_SMS" - | "android.permission.READ_SMS" - | "android.permission.RECEIVE_WAP_PUSH" - | "android.permission.RECEIVE_MMS" - | "android.permission.READ_EXTERNAL_STORAGE" - | "android.permission.WRITE_EXTERNAL_STORAGE"; + | 'android.permission.READ_CALENDAR' + | 'android.permission.WRITE_CALENDAR' + | 'android.permission.CAMERA' + | 'android.permission.READ_CONTACTS' + | 'android.permission.WRITE_CONTACTS' + | 'android.permission.GET_ACCOUNTS' + | 'android.permission.ACCESS_FINE_LOCATION' + | 'android.permission.ACCESS_COARSE_LOCATION' + | 'android.permission.RECORD_AUDIO' + | 'android.permission.READ_PHONE_STATE' + | 'android.permission.CALL_PHONE' + | 'android.permission.READ_CALL_LOG' + | 'android.permission.WRITE_CALL_LOG' + | 'com.android.voicemail.permission.ADD_VOICEMAIL' + | 'android.permission.USE_SIP' + | 'android.permission.PROCESS_OUTGOING_CALLS' + | 'android.permission.BODY_SENSORS' + | 'android.permission.SEND_SMS' + | 'android.permission.RECEIVE_SMS' + | 'android.permission.READ_SMS' + | 'android.permission.RECEIVE_WAP_PUSH' + | 'android.permission.RECEIVE_MMS' + | 'android.permission.READ_EXTERNAL_STORAGE' + | 'android.permission.WRITE_EXTERNAL_STORAGE'; -export type PermissionStatus = "granted" | "denied" | "never_ask_again"; +export type PermissionStatus = 'granted' | 'denied' | 'never_ask_again'; export interface PermissionsAndroidStatic { /** @@ -7385,7 +7381,7 @@ type PresentLocalNotificationDetails = { type ScheduleLocalNotificationDetails = { alertAction?: string; alertBody?: string; - alertTitle?: string + alertTitle?: string; applicationIconBadgeNumber?: number; category?: string; fireDate?: number | string; @@ -7395,12 +7391,12 @@ type ScheduleLocalNotificationDetails = { userInfo?: Object; }; -export type PushNotificationEventName = "notification" | "localNotification" | "register" | "registrationError"; +export type PushNotificationEventName = 'notification' | 'localNotification' | 'register' | 'registrationError'; type FetchResult = { - NewData: "UIBackgroundFetchResultNewData"; - NoData: "UIBackgroundFetchResultNoData"; - ResultFailed: "UIBackgroundFetchResultFailed"; + NewData: 'UIBackgroundFetchResultNewData'; + NoData: 'UIBackgroundFetchResultNoData'; + ResultFailed: 'UIBackgroundFetchResultFailed'; }; /** @@ -7470,8 +7466,8 @@ export interface PushNotificationIOSStatic { * The type MUST be 'notification' */ addEventListener( - type: "notification" | "localNotification", - handler: (notification: PushNotification) => void + type: 'notification' | 'localNotification', + handler: (notification: PushNotification) => void, ): void; /** @@ -7481,7 +7477,7 @@ export interface PushNotificationIOSStatic { * * The type MUST be 'register' */ - addEventListener(type: "register", handler: (deviceToken: string) => void): void; + addEventListener(type: 'register', handler: (deviceToken: string) => void): void; /** * Fired when the user fails to register for remote notifications. @@ -7492,8 +7488,8 @@ export interface PushNotificationIOSStatic { * The type MUST be 'registrationError' */ addEventListener( - type: "registrationError", - handler: (error: { message: string; code: number; details: any }) => void + type: 'registrationError', + handler: (error: { message: string; code: number; details: any }) => void, ): void; /** @@ -7505,7 +7501,7 @@ export interface PushNotificationIOSStatic { handler: | ((notification: PushNotification) => void) | ((deviceToken: string) => void) - | ((error: { message: string; code: number; details: any }) => void) + | ((error: { message: string; code: number; details: any }) => void), ): void; /** @@ -7558,13 +7554,13 @@ export interface PushNotificationIOSStatic { export interface SettingsStatic { get(key: string): any; set(settings: Object): void; - watchKeys(keys: string | Array, callback: (() => void)): number; + watchKeys(keys: string | Array, callback: () => void): number; clearWatch(watchId: number): void; } -export type StatusBarStyle = "default" | "light-content" | "dark-content"; +export type StatusBarStyle = 'default' | 'light-content' | 'dark-content'; -export type StatusBarAnimation = "none" | "fade" | "slide"; +export type StatusBarAnimation = 'none' | 'fade' | 'slide'; export interface StatusBarPropsIOS { /** @@ -7581,7 +7577,7 @@ export interface StatusBarPropsIOS { * The transition effect when showing and hiding the status bar using * the hidden prop. Defaults to 'fade'. */ - showHideTransition?: "fade" | "slide"; + showHideTransition?: 'fade' | 'slide'; } export interface StatusBarPropsAndroid { @@ -7664,7 +7660,7 @@ export interface TimePickerAndroidOpenOptions { hour?: number; minute?: number; is24Hour?: boolean; - mode?: "clock" | "spinner" | "default"; + mode?: 'clock' | 'spinner' | 'default'; } export interface TimePickerAndroidTimeSetAction { @@ -7779,13 +7775,13 @@ export interface UIManagerStatic { * @platform ios */ takeSnapshot: ( - view?: "window" | React.ReactElement | number, + view?: 'window' | React.ReactElement | number, options?: { width?: number; height?: number; - format?: "png" | "jpeg"; + format?: 'png' | 'jpeg'; quality?: number; - } + }, ) => Promise; /** @@ -7836,7 +7832,7 @@ export interface UIManagerStatic { node: number, relativeToNativeNode: number, onFail: () => void /* currently unused */, - onSuccess: MeasureLayoutOnSuccessCallback + onSuccess: MeasureLayoutOnSuccessCallback, ): void; /** @@ -7866,15 +7862,15 @@ export interface UIManagerStatic { showPopupMenu( node: number, items: string[], - error: () => void, /* currently unused */ - success: (item: string, index: number | undefined) => void + error: () => void /* currently unused */, + success: (item: string, index: number | undefined) => void, ): void; getViewManagerConfig: ( name: string, - ) => { - Commands: {[key: string]: number}; - }; + ) => { + Commands: { [key: string]: number }; + }; /** * Used to call a native view method from JavaScript @@ -7883,11 +7879,7 @@ export interface UIManagerStatic { * commandID - Id of the native method that should be called. * commandArgs - Args of the native method that we can pass from JS to native. */ - dispatchViewManagerCommand: ( - reactTag: number | null, - commandID: number, - commandArgs?: Array, - ) => void; + dispatchViewManagerCommand: (reactTag: number | null, commandID: number, commandArgs?: Array) => void; } export interface SwitchPropsIOS extends ViewProps { @@ -8045,12 +8037,12 @@ export namespace Animated { interpolate(config: InterpolationConfigType): AnimatedInterpolation; } - type ExtrapolateType = "extend" | "identity" | "clamp"; + type ExtrapolateType = 'extend' | 'identity' | 'clamp'; type InterpolationConfigType = { inputRange: number[]; outputRange: number[] | string[]; - easing?: ((input: number) => number); + easing?: (input: number) => number; extrapolate?: ExtrapolateType; extrapolateLeft?: ExtrapolateType; extrapolateRight?: ExtrapolateType; @@ -8389,12 +8381,12 @@ export interface ImagePickerIOSStatic { openCameraDialog( config: OpenCameraDialogOptions, successCallback: (args: ImagePickerResult) => void, - cancelCallback: (args: any[]) => void + cancelCallback: (args: any[]) => void, ): void; openSelectDialog( config: OpenSelectDialogOptions, successCallback: (args: ImagePickerResult) => void, - cancelCallback: (args: any[]) => void + cancelCallback: (args: any[]) => void, ): void; } @@ -8491,7 +8483,7 @@ interface ImageCropData { * (Optional) the resizing mode to use when scaling the image. If the * `displaySize` param is not specified, this has no effect. */ - resizeMode?: "contain" | "cover" | "stretch"; + resizeMode?: 'contain' | 'cover' | 'stretch'; } interface ImageEditorStatic { @@ -8509,7 +8501,7 @@ interface ImageEditorStatic { uri: string, cropData: ImageCropData, success: (uri: string) => void, - failure: (error: Object) => void + failure: (error: Object) => void, ): void; } @@ -8539,9 +8531,9 @@ export interface ARTClippingRectangleProps extends ARTNodeMixin { export interface ARTRenderableMixin extends ARTNodeMixin { fill?: string; stroke?: string; - strokeCap?: "butt" | "square" | "round"; + strokeCap?: 'butt' | 'square' | 'round'; strokeDash?: number[]; - strokeJoin?: "bevel" | "miter" | "round"; + strokeJoin?: 'bevel' | 'miter' | 'round'; strokeWidth?: number; } @@ -8581,19 +8573,14 @@ export interface ARTStatic { } export type KeyboardEventName = - | "keyboardWillShow" - | "keyboardDidShow" - | "keyboardWillHide" - | "keyboardDidHide" - | "keyboardWillChangeFrame" - | "keyboardDidChangeFrame"; + | 'keyboardWillShow' + | 'keyboardDidShow' + | 'keyboardWillHide' + | 'keyboardDidHide' + | 'keyboardWillChangeFrame' + | 'keyboardDidChangeFrame'; -export type KeyboardEventEasing = - | "easeIn" - | "easeInEaseOut" - | "easeOut" - | "linear" - | "keyboard"; +export type KeyboardEventEasing = 'easeIn' | 'easeInEaseOut' | 'easeOut' | 'linear' | 'keyboard'; type ScreenRect = { screenX: number; @@ -8614,10 +8601,7 @@ type KeyboardEventListener = (event: KeyboardEvent) => void; export interface KeyboardStatic extends NativeEventEmitter { dismiss: () => void; - addListener( - eventType: KeyboardEventName, - listener: KeyboardEventListener - ): EmitterSubscription; + addListener(eventType: KeyboardEventName, listener: KeyboardEventListener): EmitterSubscription; } ////////////////////////////////////////////////////////////////////////// @@ -8778,7 +8762,12 @@ interface NativeModulesStatic { * const MyModule = NativeModules.ModuleName */ export const NativeModules: NativeModulesStatic; -export const Platform: PlatformIOSStatic | PlatformAndroidStatic | PlatformWindowsOSStatic | PlatformMacOSStatic | PlatformWebStatic; +export const Platform: + | PlatformIOSStatic + | PlatformAndroidStatic + | PlatformWindowsOSStatic + | PlatformMacOSStatic + | PlatformWebStatic; export const PixelRatio: PixelRatioStatic; /** @@ -8795,7 +8784,7 @@ export const PixelRatio: PixelRatioStatic; export function requireNativeComponent(viewName: string): any; export function findNodeHandle( - componentOrHandle: null | number | React.Component | React.ComponentClass + componentOrHandle: null | number | React.Component | React.ComponentClass, ): null | number; export function processColor(color: any): number; diff --git a/types/react-native/legacy-properties.d.ts b/types/react-native/legacy-properties.d.ts index 318c9333b0..9b1475bb9e 100644 --- a/types/react-native/legacy-properties.d.ts +++ b/types/react-native/legacy-properties.d.ts @@ -63,9 +63,9 @@ import { StatusBarPropsAndroid, SwitchProps, SwitchPropsIOS, -} from "react-native"; +} from 'react-native'; -declare module "react-native" { +declare module 'react-native' { /* * Previously, props interfaces where named *Properties * They have been renamed to *Props to match React Native documentation