diff --git a/src/.eslintrc.js b/.eslintrc.js similarity index 80% rename from src/.eslintrc.js rename to .eslintrc.js index 1f2fa241d2..d3c4410c7c 100644 --- a/src/.eslintrc.js +++ b/.eslintrc.js @@ -1,7 +1,18 @@ -// @flow - module.exports = { parser: '@typescript-eslint/parser', + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + project: ['tsconfig.json'], + }, + overrides: [ + { + files: ['*.tsx'], + rules: { + '@typescript-eslint/strict-boolean-expressions': ['error', {allowString: false, allowNumber: false, allowNullableBoolean: true}], + }, + }, + ], extends: [ 'eslint:recommended', 'plugin:react/recommended', @@ -37,8 +48,9 @@ module.exports = { 'simple-import-sort/imports': 'error', 'spaced-comment': 1, 'no-unused-vars': 'off', - '@typescript-eslint/no-unused-vars': ['error', {argsIgnorePattern: '^_'}], - 'react/jsx-curly-brace-presence': ['warn', {props: 'never', children: 'never'}] + '@typescript-eslint/no-unused-vars': ['error', {argsIgnorePattern: '^_', varsIgnorePattern: '^_'}], + 'react/jsx-curly-brace-presence': ['warn', {props: 'never', children: 'never'}], + 'no-return-await': 'error', }, globals: { Buffer: false, diff --git a/.flowconfig b/.flowconfig deleted file mode 100644 index 5ba00d260d..0000000000 --- a/.flowconfig +++ /dev/null @@ -1,96 +0,0 @@ -[ignore] -; We fork some components by platform -.*/*[.]android.js - -; Ignore "BUCK" generated dirs -/\.buckd/ - -; Ignore polyfills -node_modules/react-native/Libraries/polyfills/.* - -; Flow doesn't support platforms -.*/Libraries/Utilities/LoadingView.js - -; Ignore findup (storybook dependency) -.*/node_modules/findup/test/.* - -; Ignore package jest-resolve/resolve tests -.*/node_modules/jest-resolve/node_modules/resolve/test/resolver/malformed_package_json/package.json - -[untyped] -.*/node_modules/@react-native-community/cli/.*/.* - -; Ignore @ledgerhq/react-native-hw-transport-ble -.*/node_modules/@ledgerhq/react-native-hw-transport-ble/lib/BleTransport.js.flow - -; Ignore @emurgo/react-native-haskell-shelley -.*/node_modules/@emurgo/react-native-haskell-shelley/index.js.flow - -; Ignore recompose -.*/node_modules/recompose/dist/Recompose.cjs.js.flow - -; Ignore react-native-linear-gradient (check if error goes away in newer version -; or just get rid of this dependency) -.*/node_modules/react-native-linear-gradient/common.js - -.*/node_modules/react-native/Libraries/LogBox/Data/LogBoxLog.js -.*/node_modules/react-native/Libraries/Interaction/TaskQueue.js - -[include] - -[libs] -node_modules/react-native/interface.js -node_modules/react-native/flow/ -flow/declarations/ - -[options] -include_warnings=true -emoji=true - -esproposal.optional_chaining=enable -esproposal.nullish_coalescing=enable - -module.file_ext=.js -module.file_ext=.json -module.file_ext=.ios.js - -munge_underscores=true - -module.name_mapper='^react-native/\(.*\)$' -> '/node_modules/react-native/\1' -module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '/node_modules/react-native/Libraries/Image/RelativeImageStub' - -module.file_ext=.js -module.file_ext=.jsx -module.file_ext=.json -module.file_ext=.md -module.file_ext=.native.js - -suppress_type=$FlowIssue -suppress_type=$FlowFixMe -suppress_type=$FlowFixMeProps -suppress_type=$FlowFixMeState - -server.max_workers=1 - -[lints] -sketchy-null-number=warn -sketchy-null-mixed=warn -sketchy-number=warn -nonstrict-import=warn -deprecated-type=warn -unnecessary-invariant=warn -signature-verification-failure=warn -deprecated-utility=error -unnecessary-optional-chain=warn - -[strict] -deprecated-type -nonstrict-import -sketchy-null -unclear-type -unsafe-getters-setters -untyped-import -untyped-type-import - -[version] -0.131.0 diff --git a/.github/pr-labeler.yml b/.github/pr-labeler.yml index 96585f9408..8d4461b1d5 100644 --- a/.github/pr-labeler.yml +++ b/.github/pr-labeler.yml @@ -1,4 +1,4 @@ -feature: ['feature/*', '\[feature\]', 'feature\-*'] -fix: ['fix/*', '\[fix\]', 'fix\-*'] -chore: ['chore/*', '\[chore\]', 'chore\-*'] -refactor: ['refactor/*', '\[refactor\]', 'refactor\-*'] +feature: ['feature/*', '\[feature\]', 'feature\-*', 'feature:'] +fix: ['fix/*', '\[fix\]', 'fix\-*', 'fix:'] +chore: ['chore/*', '\[chore\]', 'chore\-*', 'chore:'] +refactor: ['refactor/*', '\[refactor\]', 'refactor\-*', 'refactor:'] diff --git a/.github/workflows/pr-authoring.yml b/.github/workflows/pr-authoring.yml deleted file mode 100644 index 38cbd418db..0000000000 --- a/.github/workflows/pr-authoring.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: PR Authoring -on: - pull_request: - types: [opened] - -jobs: - assignAuthor: - runs-on: ubuntu-latest - steps: - - uses: samspills/assign-pr-to-author@v1.0 - if: github.event_name == 'pull_request' && github.event.action == 'opened' - with: - repo-token: '${{ secrets.GITHUB_TOKEN }}' diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 4a0ec5ad07..556ebe1404 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -3,7 +3,7 @@ name: PR Checks on: [push] jobs: - flow: + lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -12,8 +12,8 @@ jobs: node-version: '16.5.0' cache: 'yarn' - run: yarn install - - run: yarn flow - lint: + - run: yarn lint + test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -22,4 +22,4 @@ jobs: node-version: '16.5.0' cache: 'yarn' - run: yarn install - - run: yarn lint + - run: yarn test --ci --bail --silent diff --git a/.gitignore b/.gitignore index 4782be1031..d1582b3ad8 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ DerivedData *.xcuserstate *.d *.dia +.dependencygraph # Android/IntelliJ # @@ -110,3 +111,6 @@ coverage-ts #Test's data tests/app tests/artifacts + +coverage/ +.jest/ diff --git a/.husky/pre-commit b/.husky/pre-commit index e965ace0d2..f548fbf5da 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -2,5 +2,5 @@ . "$(dirname "$0")/_/husky.sh" npx lint-staged -yarn flow yarn tsc +yarn test --ci --bail --silent diff --git a/.prettierignore b/.prettierignore index 766968894d..e69de29bb2 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +0,0 @@ -translations -src/i18n \ No newline at end of file diff --git a/README.md b/README.md index baea5e60b6..c22f8cd9e4 100644 --- a/README.md +++ b/README.md @@ -8,29 +8,37 @@ Looking for the Yoroi Extension? See [here](https://github.com/Emurgo/yoroi-fron # Development -## Installation +## Installation Mac --- -**NOTE** +### Common instalation IOS/Android -The **Windows + WSL2 Ubuntu** is used in the instruction for building project for android devices.
The instruction is checked.
It should work for the Ubuntu also, but it is not checked. +- Install [nvm](https://github.com/nvm-sh/nvm#installing-and-updating) ---- +- Install node `16.5.0` -### iOS preparation +``` +nvm install 16.5.0 +nvm alias default 16.5.0 +``` ---- +- Install yarn: -- Install cocoapods and download ios dependencies: +``` +npm install -g yarn +``` + +- Install python `2.7.18`: -```shell -gem install cocoapods +``` +brew install pyenv +pyenv install 2.7.18 ``` - Install Rust: -```shell +``` curl https://sh.rustup.rs -sSf | sh rustup toolchain install 1.41.0 rustup install 1.41.0 @@ -38,13 +46,31 @@ rustup target add wasm32-unknown-unknown --toolchain 1.41.0 rustup default 1.41.0 ``` -- Make sure your Node.js version matches `v16.5.0`.
If you have `nvm` installed, you can just `nvm use`. +--- + +### iOS preparation + +- Recommended MacOS version: Catalina +- Recommended xcode version: `12.4` +- Recommended xcode command-line version: `12.4` + +- Install cocoapods version `1.11.3` and download ios dependencies: + +``` +brew install cocoapods@1.11.3 +``` + - Install rust build targets: -
`rustup target add aarch64-apple-ios armv7-apple-ios armv7s-apple-ios x86_64-apple-ios i386-apple-ios` -- Install cargo-lipo for building: -
`cargo install cargo-lipo` -- Install dependencies: -
`yarn install` + +``` +rustup target add aarch64-apple-ios armv7-apple-ios armv7s-apple-ios x86_64-apple-ios i386-apple-ios +``` + +- Install cargo-lipo version `3.1.1` for building: + +``` +cargo install --version 3.1.1 cargo-lipo +``` #### Additional configuration for MacOS Big Sur users @@ -52,6 +78,87 @@ MacOS Big Sur changed the default path of the system C linker, which breaks `car --- +### Android Preparation + +- Install last version of [Android Studio](https://developer.android.com/studio) and install the latest version of Android SDK Command-line tools and Android SDK Platform-Tools. It can be done from `Android Studio -> Appareance & Behavior -> System Settings -> Android SDK -> "SDK Tools" tab` after activating in this section `Show Package Details` + +- Add this to your .bashrc/.zshrc file: + +``` +export ANDROID_SDK_ROOT=$HOME/Library/Android/sdk +export PATH=$PATH:$ANDROID_SDK_ROOT/emulator +export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools +export PATH=$PATH:$ANDROID_SDK_ROOT/cmdline-tools/latest/bin +``` + +- Update the Android SDK: + +``` +sdkmanager "tools" +sdkmanager --update +sdkmanager --list +sdkmanager "build-tools;28.0.3" "platform-tools" "platforms;android-28" "tools" +sdkmanager --licenses +``` + +- Install the Android NDK: + +``` +sdkmanager --install "ndk;20.0.5594570" +``` + +- Install java 8: + +``` +brew tap adoptopenjdk/openjdk +brew install --cask adoptopenjdk8 +``` + +Existing users of Homebrew may encounter Error: Cask adoptopenjdk8 exists in multiple taps due to prior workarounds with different instructions. This can be solved by fully specifying the location with: + +``` +brew install --cask adoptopenjdk/openjdk/adoptopenjdk8 +``` + +- Install Rust packages: + +``` +rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android +``` + +- Install wasm-prkg: + +``` +curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh +``` + +- Install gradle: + +``` +brew install gradle +``` + +#### Optional + +- Create a virtual device from Android studio with the following specs: + + - Pixel 2 device + - System Image: + - Release name: R + - API level: 30 + - ABI: x86_64 + - Target: Android 11 (Google APIs) + +--- + +## Installation Windows + WSL2 Ubuntu / Ubuntu + +--- + +**NOTE** + +The **Windows + WSL2 Ubuntu** is used in the instruction for building project for android devices.
The instruction is checked.
It should work for the Ubuntu also, but it is not checked. + ### Android preparation --- @@ -149,33 +256,6 @@ sdkmanager --install "ndk;20.0.5594570" sudo apt install gradle -y ``` -- Clone the project - -```shell -cd ~ && mkdir Emurgo && cd Emurgo -git clone https://github.com/Emurgo/yoroi-mobile.git -cd yoroi-mobile -``` - -- Run the `nvm use` command -- Install `yarn`: - -```shell -npm install -g yarn -``` - -- Check that Yarn is installed: - -```shell -yarn --version -``` - -- Install dependencies: - -```shell -yarn install -``` - --- #### Windows preparation @@ -271,8 +351,18 @@ yarn start Make sure the rust targets for the platform you will work on (android/iOS) have been correctly installed with `rustup show`. Then: -1. `yarn setup_configs` - links libraries to ios testnet build configurations -1. When building on iOS: `cd ios && pod install` +1. Clone the project + +```shell +cd ~ && mkdir Emurgo && cd Emurgo +git clone https://github.com/Emurgo/yoroi-mobile.git +cd yoroi-mobile +``` + +2. Run the `nvm use` command +3. `yarn install` +4. `yarn setup_configs` - links libraries to ios testnet build configurations +5. When building on iOS: `cd ios && pod install` If these steps fail, try looking at the [android CLI](https://github.com/Emurgo/yoroi-mobile/blob/develop/.circleci/config.yml#L68) @@ -488,8 +578,6 @@ The imports should be in this order: Example: ```js -// @flow - // external libraries import React from 'react' import {compose} from 'redux' @@ -501,9 +589,6 @@ import Screen from '../../components/Screen' import AdaIcon from '../../assets/AdaIcon' import {confirmationsToAssuranceLevel, printAda} from '../../helpers/utils' -// styles -import styles from './TxDetails.style' - // types import type {TransactionType} from '../../types/HistoryTransaction' ``` diff --git a/__mocks__/react-native-svg.js b/__mocks__/react-native-svg.js new file mode 100644 index 0000000000..c6d5eee2de --- /dev/null +++ b/__mocks__/react-native-svg.js @@ -0,0 +1,3 @@ +const mockedModule = jest.mock('react-native-svg') + +module.exports = mockedModule \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index 1967146022..3cabf428b1 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -150,8 +150,8 @@ android { applicationId "com.emurgo" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 353 - versionName "4.7.17" + versionCode 355 + versionName "4.8.0" ndk { abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64" } diff --git a/android/app/src/dev/res/xml/network_security_config.xml b/android/app/src/dev/res/xml/network_security_config.xml index ccb07933df..abd5392f95 100644 --- a/android/app/src/dev/res/xml/network_security_config.xml +++ b/android/app/src/dev/res/xml/network_security_config.xml @@ -4,5 +4,6 @@ localhost 10.0.2.2 10.0.3.2 + 192.168.86.21 diff --git a/android/app/src/main/java/com/emurgo/MainActivity.java b/android/app/src/main/java/com/emurgo/MainActivity.java index e328a3dabb..de13322e9d 100644 --- a/android/app/src/main/java/com/emurgo/MainActivity.java +++ b/android/app/src/main/java/com/emurgo/MainActivity.java @@ -20,7 +20,7 @@ protected String getMainComponentName() { @Override protected void onCreate(Bundle savedInstanceState) { RNBootSplash.init(R.drawable.bootsplash, MainActivity.this); - super.onCreate(savedInstanceState); + super.onCreate(null); if (BuildConfig.FLAVOR.equals("mainnet")) { getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE); } diff --git a/android/gradle.properties b/android/gradle.properties index 6012ce0e18..c76799c13c 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -36,4 +36,4 @@ android.enableJetifier=true FLIPPER_VERSION=0.54.0 # Increases the sql lite limit default 6MB -AsyncStorage_db_size_in_MB=12 \ No newline at end of file +AsyncStorage_db_size_in_MB=32 diff --git a/babel.config.js b/babel.config.js index 910335127e..761fab59ea 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,12 +1,13 @@ module.exports = { - presets: ["module:metro-react-native-babel-preset"], - "plugins": [ + presets: ['module:metro-react-native-babel-preset'], + plugins: [ [ - "react-intl", + 'react-intl', { - "messagesDir": "./translations/messages/", - "extractSourceLocation": true - } - ] - ] + messagesDir: './translations/messages/', + extractSourceLocation: true, + }, + ], + '@babel/plugin-proposal-export-namespace-from', + ], } diff --git a/flow-typed/npm/@react-native-community/clipboard_v1.5.1.js b/flow-typed/npm/@react-native-community/clipboard_v1.5.1.js deleted file mode 100644 index fcf3e9c4b6..0000000000 --- a/flow-typed/npm/@react-native-community/clipboard_v1.5.1.js +++ /dev/null @@ -1,50 +0,0 @@ -/** - * `Clipboard` gives you an interface for setting and getting content from Clipboard on both iOS and Android - */ -declare module '@react-native-community/clipboard' { - declare export default { - /** - * Get content of string type, this method returns a `Promise`, - * so you can use following code to get clipboard content - * ```javascript - * async _getContent() { - * var content = await Clipboard.getString(); - * } - * ``` - */ - getString(): Promise, - /** - * Set content of string type. You can use following code to set clipboard content - * ```javascript - * _setContent() { - * Clipboard.setString('hello world'); - * } - * ``` - * @param the content to be stored in the clipboard. - */ - setString(content: string): void, - - /** - * Returns whether the clipboard has content or is empty. - * This method returns a `Promise`, so you can use following code to get clipboard content - * ```javascript - * async _hasContent() { - * var hasContent = await Clipboard.hasString(); - * } - * ``` - */ - hasString(): Promise, - - /** - * (IOS Only) - * Returns whether the clipboard has content or is empty. - * This method returns a `Promise`, so you can use following code to get clipboard content - * ```javascript - * async _hasContent() { - * var hasContent = await Clipboard.hasString(); - * } - * ``` - */ - hasURL(): Promise, - } -} diff --git a/flow-typed/npm/@react-navigation/bottom-tabs_v5.x.x.js b/flow-typed/npm/@react-navigation/bottom-tabs_v5.x.x.js deleted file mode 100644 index b41cb329dc..0000000000 --- a/flow-typed/npm/@react-navigation/bottom-tabs_v5.x.x.js +++ /dev/null @@ -1,2074 +0,0 @@ -// flow-typed signature: 0e1afa527faab379886b48a48c7993bb -// flow-typed version: 510a06cce0/@react-navigation/bottom-tabs_v5.x.x/flow_>=v0.104.x - -declare module '@react-navigation/bottom-tabs' { - - //--------------------------------------------------------------------------- - // SECTION 1: IDENTICAL TYPE DEFINITIONS - // This section is identical across all React Navigation libdefs and contains - // shared definitions. We wish we could make it DRY and import from a shared - // definition, but that isn't yet possible. - //--------------------------------------------------------------------------- - - /** - * We start with some definitions that we have copy-pasted from React Native - * source files. - */ - - // This is a bastardization of the true StyleObj type located in - // react-native/Libraries/StyleSheet/StyleSheetTypes. We unfortunately can't - // import that here, and it's too lengthy (and consequently too brittle) to - // copy-paste here either. - declare type StyleObj = - | null - | void - | number - | false - | '' - | $ReadOnlyArray - | { [name: string]: any, ... }; - declare type ViewStyleProp = StyleObj; - declare type TextStyleProp = StyleObj; - declare type AnimatedViewStyleProp = StyleObj; - declare type AnimatedTextStyleProp = StyleObj; - - // Vaguely copied from - // react-native/Libraries/Animated/src/animations/Animation.js - declare type EndResult = { finished: boolean, ... }; - declare type EndCallback = (result: EndResult) => void; - declare interface Animation { - start( - fromValue: number, - onUpdate: (value: number) => void, - onEnd: ?EndCallback, - previousAnimation: ?Animation, - animatedValue: AnimatedValue, - ): void; - stop(): void; - } - declare type AnimationConfig = { - isInteraction?: boolean, - useNativeDriver: boolean, - onComplete?: ?EndCallback, - iterations?: number, - ... - }; - - // Vaguely copied from - // react-native/Libraries/Animated/src/nodes/AnimatedTracking.js - declare interface AnimatedTracking { - constructor( - value: AnimatedValue, - parent: any, - animationClass: any, - animationConfig: Object, - callback?: ?EndCallback, - ): void; - update(): void; - } - - // Vaguely copied from - // react-native/Libraries/Animated/src/nodes/AnimatedValue.js - declare type ValueListenerCallback = (state: { value: number, ... }) => void; - declare interface AnimatedValue { - constructor(value: number): void; - setValue(value: number): void; - setOffset(offset: number): void; - flattenOffset(): void; - extractOffset(): void; - addListener(callback: ValueListenerCallback): string; - removeListener(id: string): void; - removeAllListeners(): void; - stopAnimation(callback?: ?(value: number) => void): void; - resetAnimation(callback?: ?(value: number) => void): void; - interpolate(config: InterpolationConfigType): AnimatedInterpolation; - animate(animation: Animation, callback: ?EndCallback): void; - stopTracking(): void; - track(tracking: AnimatedTracking): void; - } - - // Copied from - // react-native/Libraries/Animated/src/animations/TimingAnimation.js - declare type TimingAnimationConfigSingle = AnimationConfig & { - toValue: number | AnimatedValue, - easing?: (value: number) => number, - duration?: number, - delay?: number, - ... - }; - - // Copied from - // react-native/Libraries/Animated/src/animations/SpringAnimation.js - declare type SpringAnimationConfigSingle = AnimationConfig & { - toValue: number | AnimatedValue, - overshootClamping?: boolean, - restDisplacementThreshold?: number, - restSpeedThreshold?: number, - velocity?: number, - bounciness?: number, - speed?: number, - tension?: number, - friction?: number, - stiffness?: number, - damping?: number, - mass?: number, - delay?: number, - ... - }; - - // Copied from react-native/Libraries/Types/CoreEventTypes.js - declare type SyntheticEvent = $ReadOnly<{| - bubbles: ?boolean, - cancelable: ?boolean, - currentTarget: number, - defaultPrevented: ?boolean, - dispatchConfig: $ReadOnly<{| - registrationName: string, - |}>, - eventPhase: ?number, - preventDefault: () => void, - isDefaultPrevented: () => boolean, - stopPropagation: () => void, - isPropagationStopped: () => boolean, - isTrusted: ?boolean, - nativeEvent: T, - persist: () => void, - target: ?number, - timeStamp: number, - type: ?string, - |}>; - declare type Layout = $ReadOnly<{| - x: number, - y: number, - width: number, - height: number, - |}>; - declare type LayoutEvent = SyntheticEvent< - $ReadOnly<{| - layout: Layout, - |}>, - >; - declare type BlurEvent = SyntheticEvent< - $ReadOnly<{| - target: number, - |}>, - >; - declare type FocusEvent = SyntheticEvent< - $ReadOnly<{| - target: number, - |}>, - >; - declare type ResponderSyntheticEvent = $ReadOnly<{| - ...SyntheticEvent, - touchHistory: $ReadOnly<{| - indexOfSingleActiveTouch: number, - mostRecentTimeStamp: number, - numberActiveTouches: number, - touchBank: $ReadOnlyArray< - $ReadOnly<{| - touchActive: boolean, - startPageX: number, - startPageY: number, - startTimeStamp: number, - currentPageX: number, - currentPageY: number, - currentTimeStamp: number, - previousPageX: number, - previousPageY: number, - previousTimeStamp: number, - |}>, - >, - |}>, - |}>; - declare type PressEvent = ResponderSyntheticEvent< - $ReadOnly<{| - changedTouches: $ReadOnlyArray<$PropertyType>, - force: number, - identifier: number, - locationX: number, - locationY: number, - pageX: number, - pageY: number, - target: ?number, - timestamp: number, - touches: $ReadOnlyArray<$PropertyType>, - |}>, - >; - - // Vaguely copied from - // react-native/Libraries/Animated/src/nodes/AnimatedInterpolation.js - declare type ExtrapolateType = 'extend' | 'identity' | 'clamp'; - declare type InterpolationConfigType = { - inputRange: Array, - outputRange: Array | Array, - easing?: (input: number) => number, - extrapolate?: ExtrapolateType, - extrapolateLeft?: ExtrapolateType, - extrapolateRight?: ExtrapolateType, - ... - }; - declare interface AnimatedInterpolation { - interpolate(config: InterpolationConfigType): AnimatedInterpolation; - } - - // Copied from react-native/Libraries/Components/View/ViewAccessibility.js - declare 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'; - declare type AccessibilityActionInfo = $ReadOnly<{ - name: string, - label?: string, - ... - }>; - declare type AccessibilityActionEvent = SyntheticEvent< - $ReadOnly<{actionName: string, ...}>, - >; - declare type AccessibilityState = { - disabled?: boolean, - selected?: boolean, - checked?: ?boolean | 'mixed', - busy?: boolean, - expanded?: boolean, - ... - }; - declare type AccessibilityValue = $ReadOnly<{| - min?: number, - max?: number, - now?: number, - text?: string, - |}>; - - // Copied from - // react-native/Libraries/Components/Touchable/TouchableWithoutFeedback.js - declare type Stringish = string; - declare type EdgeInsetsProp = $ReadOnly<$Partial>; - declare type TouchableWithoutFeedbackProps = $ReadOnly<{| - accessibilityActions?: ?$ReadOnlyArray, - accessibilityElementsHidden?: ?boolean, - accessibilityHint?: ?Stringish, - accessibilityIgnoresInvertColors?: ?boolean, - accessibilityLabel?: ?Stringish, - accessibilityLiveRegion?: ?('none' | 'polite' | 'assertive'), - accessibilityRole?: ?AccessibilityRole, - accessibilityState?: ?AccessibilityState, - accessibilityValue?: ?AccessibilityValue, - accessibilityViewIsModal?: ?boolean, - accessible?: ?boolean, - children?: ?React$Node, - delayLongPress?: ?number, - delayPressIn?: ?number, - delayPressOut?: ?number, - disabled?: ?boolean, - focusable?: ?boolean, - hitSlop?: ?EdgeInsetsProp, - importantForAccessibility?: ?('auto' | 'yes' | 'no' | 'no-hide-descendants'), - nativeID?: ?string, - onAccessibilityAction?: ?(event: AccessibilityActionEvent) => mixed, - onBlur?: ?(event: BlurEvent) => mixed, - onFocus?: ?(event: FocusEvent) => mixed, - onLayout?: ?(event: LayoutEvent) => mixed, - onLongPress?: ?(event: PressEvent) => mixed, - onPress?: ?(event: PressEvent) => mixed, - onPressIn?: ?(event: PressEvent) => mixed, - onPressOut?: ?(event: PressEvent) => mixed, - pressRetentionOffset?: ?EdgeInsetsProp, - rejectResponderTermination?: ?boolean, - testID?: ?string, - touchSoundDisabled?: ?boolean, - |}>; - - // Copied from react-native/Libraries/Image/ImageSource.js - declare type ImageURISource = $ReadOnly<{ - uri?: ?string, - bundle?: ?string, - method?: ?string, - headers?: ?Object, - body?: ?string, - cache?: ?('default' | 'reload' | 'force-cache' | 'only-if-cached'), - width?: ?number, - height?: ?number, - scale?: ?number, - ... - }>; - - /** - * The following is copied from react-native-gesture-handler's libdef - */ - - declare type $EventHandlers = {| - onGestureEvent?: ($Event) => mixed, - onHandlerStateChange?: ($Event) => mixed, - onBegan?: ($Event) => mixed, - onFailed?: ($Event) => mixed, - onCancelled?: ($Event) => mixed, - onActivated?: ($Event) => mixed, - onEnded?: ($Event) => mixed, - |}; - - declare type HitSlop = - | number - | {| - left?: number, - top?: number, - right?: number, - bottom?: number, - vertical?: number, - horizontal?: number, - width?: number, - height?: number, - |} - | {| - width: number, - left: number, - |} - | {| - width: number, - right: number, - |} - | {| - height: number, - top: number, - |} - | {| - height: number, - bottom: number, - |}; - - declare type $GestureHandlerProps< - AdditionalProps: {...}, - ExtraEventsProps: {...} - > = $ReadOnly<{| - ...$Exact, - ...$EventHandlers, - id?: string, - enabled?: boolean, - waitFor?: React$Ref | Array>, - simultaneousHandlers?: React$Ref | Array>, - shouldCancelWhenOutside?: boolean, - minPointers?: number, - hitSlop?: HitSlop, - children?: React$Node, - |}>; - - declare type PanGestureHandlerProps = $GestureHandlerProps< - { - activeOffsetY?: number | [number, number], - activeOffsetX?: number | [number, number], - failOffsetY?: number | [number, number], - failOffsetX?: number | [number, number], - minDist?: number, - minVelocity?: number, - minVelocityX?: number, - minVelocityY?: number, - minPointers?: number, - maxPointers?: number, - avgTouches?: boolean, - ... - }, - { - x: number, - y: number, - absoluteX: number, - absoluteY: number, - translationX: number, - translationY: number, - velocityX: number, - velocityY: number, - ... - } - >; - - /** - * MAGIC - */ - - declare type $If = $Call< - ((true, Then, Else) => Then) & ((false, Then, Else) => Else), - Test, - Then, - Else, - >; - declare type $IsA = $Call< - (Y => true) & (mixed => false), - X, - >; - declare type $IsUndefined = $IsA; - - declare type $Partial = $ReadOnly<$Rest>; - - /** - * Actions, state, etc. - */ - - declare export type ScreenParams = { +[key: string]: mixed, ... }; - - declare export type BackAction = {| - +type: 'GO_BACK', - +source?: string, - +target?: string, - |}; - declare export type NavigateAction = {| - +type: 'NAVIGATE', - +payload: - | {| +key: string, +params?: ScreenParams |} - | {| +name: string, +key?: string, +params?: ScreenParams |}, - +source?: string, - +target?: string, - |}; - declare export type ResetAction = {| - +type: 'RESET', - +payload: StaleNavigationState, - +source?: string, - +target?: string, - |}; - declare export type SetParamsAction = {| - +type: 'SET_PARAMS', - +payload: {| +params?: ScreenParams |}, - +source?: string, - +target?: string, - |}; - declare export type CommonAction = - | BackAction - | NavigateAction - | ResetAction - | SetParamsAction; - - declare type NavigateActionCreator = {| - (routeName: string, params?: ScreenParams): NavigateAction, - ( - | {| +key: string, +params?: ScreenParams |} - | {| +name: string, +key?: string, +params?: ScreenParams |}, - ): NavigateAction, - |}; - declare export type CommonActionsType = {| - +navigate: NavigateActionCreator, - +goBack: () => BackAction, - +reset: (state: PossiblyStaleNavigationState) => ResetAction, - +setParams: (params: ScreenParams) => SetParamsAction, - |}; - - declare export type GenericNavigationAction = {| - +type: string, - +payload?: { +[key: string]: mixed, ... }, - +source?: string, - +target?: string, - |}; - - declare export type LeafRoute = {| - +key: string, - +name: RouteName, - +params?: ScreenParams, - |}; - declare export type StateRoute = {| - ...LeafRoute, - +state: NavigationState | StaleNavigationState, - |}; - declare export type Route = - | LeafRoute - | StateRoute; - - declare export type NavigationState = {| - +key: string, - +index: number, - +routeNames: $ReadOnlyArray, - +history?: $ReadOnlyArray, - +routes: $ReadOnlyArray>, - +type: string, - +stale: false, - |}; - - declare export type StaleLeafRoute = {| - +key?: string, - +name: RouteName, - +params?: ScreenParams, - |}; - declare export type StaleStateRoute = {| - ...StaleLeafRoute, - +state: StaleNavigationState, - |}; - declare export type StaleRoute = - | StaleLeafRoute - | StaleStateRoute; - declare export type StaleNavigationState = {| - // It's possible to pass React Nav a StaleNavigationState with an undefined - // index, but React Nav will always return one with the index set. This is - // the same as for the type property below, but in the case of index we tend - // to rely on it being set more... - +index: number, - +history?: $ReadOnlyArray, - +routes: $ReadOnlyArray>, - +type?: string, - +stale?: true, - |}; - - declare export type PossiblyStaleNavigationState = - | NavigationState - | StaleNavigationState; - declare export type PossiblyStaleRoute = - | Route - | StaleRoute; - - /** - * Routers - */ - - declare type ActionCreators< - State: NavigationState, - Action: GenericNavigationAction, - > = { - +[key: string]: (...args: any) => (Action | State => Action), - ... - }; - - declare export type DefaultRouterOptions = { - +initialRouteName?: string, - ... - }; - - declare export type RouterFactory< - State: NavigationState, - Action: GenericNavigationAction, - RouterOptions: DefaultRouterOptions, - > = (options: RouterOptions) => Router; - - declare export type ParamListBase = { +[key: string]: ?ScreenParams, ... }; - - declare export type RouterConfigOptions = {| - +routeNames: $ReadOnlyArray, - +routeParamList: ParamListBase, - |}; - - declare export type Router< - State: NavigationState, - Action: GenericNavigationAction, - > = {| - +type: $PropertyType, - +getInitialState: (options: RouterConfigOptions) => State, - +getRehydratedState: ( - partialState: PossibleStaleNavigationState, - options: RouterConfigOptions, - ) => State, - +getStateForRouteNamesChange: ( - state: State, - options: RouterConfigOptions, - ) => State, - +getStateForRouteFocus: (state: State, key: string) => State, - +getStateForAction: ( - state: State, - action: Action, - options: RouterConfigOptions, - ) => ?PossiblyStaleNavigationState; - +shouldActionChangeFocus: (action: GenericNavigationAction) => boolean, - +actionCreators?: ActionCreators, - |}; - - /** - * Stack actions and router - */ - - declare export type StackNavigationState = {| - ...NavigationState, - +type: 'stack', - |}; - - declare export type ReplaceAction = {| - +type: 'REPLACE', - +payload: {| +name: string, +key?: ?string, +params?: ScreenParams |}, - +source?: string, - +target?: string, - |}; - declare export type PushAction = {| - +type: 'PUSH', - +payload: {| +name: string, +key?: ?string, +params?: ScreenParams |}, - +source?: string, - +target?: string, - |}; - declare export type PopAction = {| - +type: 'POP', - +payload: {| +count: number |}, - +source?: string, - +target?: string, - |}; - declare export type PopToTopAction = {| - +type: 'POP_TO_TOP', - +source?: string, - +target?: string, - |}; - declare export type StackAction = - | CommonAction - | ReplaceAction - | PushAction - | PopAction - | PopToTopAction; - - declare export type StackActionsType = {| - +replace: (routeName: string, params?: ScreenParams) => ReplaceAction, - +push: (routeName: string, params?: ScreenParams) => PushAction, - +pop: (count?: number) => PopAction, - +popToTop: () => PopToTopAction, - |}; - - declare export type StackRouterOptions = $Exact; - - /** - * Tab actions and router - */ - - declare export type TabNavigationState = {| - ...NavigationState, - +type: 'tab', - +history: $ReadOnlyArray<{| type: 'route', key: string |}>, - |}; - - declare export type JumpToAction = {| - +type: 'JUMP_TO', - +payload: {| +name: string, +params?: ScreenParams |}, - +source?: string, - +target?: string, - |}; - declare export type TabAction = - | CommonAction - | JumpToAction; - - declare export type TabActionsType = {| - +jumpTo: string => JumpToAction, - |}; - - declare export type TabRouterOptions = {| - ...$Exact, - +backBehavior?: 'initialRoute' | 'order' | 'history' | 'none', - |}; - - /** - * Drawer actions and router - */ - - declare type DrawerHistoryEntry = - | {| +type: 'route', +key: string |} - | {| +type: 'drawer' |}; - declare export type DrawerNavigationState = {| - ...NavigationState, - +type: 'drawer', - +history: $ReadOnlyArray, - |}; - - declare export type OpenDrawerAction = {| - +type: 'OPEN_DRAWER', - +source?: string, - +target?: string, - |}; - declare export type CloseDrawerAction = {| - +type: 'CLOSE_DRAWER', - +source?: string, - +target?: string, - |}; - declare export type ToggleDrawerAction = {| - +type: 'TOGGLE_DRAWER', - +source?: string, - +target?: string, - |}; - declare export type DrawerAction = - | TabAction - | OpenDrawerAction - | CloseDrawerAction - | ToggleDrawerAction; - - declare export type DrawerActionsType = {| - ...TabActionsType, - +openDrawer: () => OpenDrawerAction, - +closeDrawer: () => CloseDrawerAction, - +toggleDrawer: () => ToggleDrawerAction, - |}; - - declare export type DrawerRouterOptions = {| - ...TabRouterOptions, - +openByDefault?: boolean, - |}; - - /** - * Events - */ - - declare export type EventMapBase = { - +[name: string]: {| - +data?: mixed, - +canPreventDefault?: boolean, - |}, - ... - }; - declare type EventPreventDefaultProperties = $If< - Test, - {| +defaultPrevented: boolean, +preventDefault: () => void |}, - {| |}, - >; - declare type EventDataProperties = $If< - $IsUndefined, - {| |}, - {| +data: Data |}, - >; - declare type EventArg< - EventName: string, - CanPreventDefault: ?boolean = false, - Data = void, - > = {| - ...EventPreventDefaultProperties, - ...EventDataProperties, - +type: EventName, - +target?: string, - |}; - declare type GlobalEventMap = {| - +state: {| +data: {| +state: State |}, +canPreventDefault: false |}, - |}; - declare type EventMapCore = {| - ...GlobalEventMap, - +focus: {| +data: void, +canPreventDefault: false |}, - +blur: {| +data: void, +canPreventDefault: false |}, - +beforeRemove: {| - +data: {| +action: GenericNavigationAction |}, - +canPreventDefault: true, - |}, - |}; - declare type EventListenerCallback< - EventName: string, - State: PossiblyStaleNavigationState = NavigationState, - EventMap: EventMapBase = EventMapCore, - > = (e: EventArg< - EventName, - $PropertyType< - $ElementType< - {| ...EventMap, ...EventMapCore |}, - EventName, - >, - 'canPreventDefault', - >, - $PropertyType< - $ElementType< - {| ...EventMap, ...EventMapCore |}, - EventName, - >, - 'data', - >, - >) => mixed; - - /** - * Navigation prop - */ - - declare export type SimpleNavigate = - >( - routeName: DestinationRouteName, - params: $ElementType, - ) => void; - - declare export type Navigate = - & SimpleNavigate - & >( - route: - | {| - key: string, - params?: $ElementType, - |} - | {| - name: DestinationRouteName, - key?: string, - params?: $ElementType, - |}, - ) => void; - - declare type NavigationHelpers< - ParamList: ParamListBase, - State: PossiblyStaleNavigationState = PossiblyStaleNavigationState, - EventMap: EventMapBase = EventMapCore, - > = { - +navigate: Navigate, - +dispatch: ( - action: - | GenericNavigationAction - | (State => GenericNavigationAction), - ) => void, - +reset: PossiblyStaleNavigationState => void, - +goBack: () => void, - +isFocused: () => boolean, - +canGoBack: () => boolean, - +dangerouslyGetParent: >() => ?Parent, - +dangerouslyGetState: () => NavigationState, - +addListener: |}, - >>( - name: EventName, - callback: EventListenerCallback, - ) => () => void, - +removeListener: |}, - >>( - name: EventName, - callback: EventListenerCallback, - ) => void, - ... - }; - - declare export type NavigationProp< - ParamList: ParamListBase, - RouteName: $Keys = $Keys, - State: PossiblyStaleNavigationState = PossiblyStaleNavigationState, - ScreenOptions: {...} = {...}, - EventMap: EventMapBase = EventMapCore, - > = { - ...$Exact>, - +setOptions: (options: $Partial) => void, - +setParams: ( - params: $If< - $IsUndefined<$ElementType>, - empty, - $Partial<$NonMaybeType<$ElementType>>, - >, - ) => void, - ... - }; - - /** - * CreateNavigator - */ - - declare export type RouteProp< - ParamList: ParamListBase, - RouteName: $Keys, - > = {| - ...LeafRoute, - +params: $ElementType, - |}; - - declare export type ScreenListeners< - EventMap: EventMapBase = EventMapCore, - State: NavigationState = NavigationState, - > = $ObjMapi< - {| [name: $Keys]: empty |}, - >(K, empty) => EventListenerCallback, - >; - - declare type BaseScreenProps< - ParamList: ParamListBase, - NavProp, - RouteName: $Keys = $Keys, - State: NavigationState = NavigationState, - ScreenOptions: {...} = {...}, - EventMap: EventMapBase = EventMapCore, - > = {| - +name: RouteName, - +options?: - | ScreenOptions - | ({| - route: RouteProp, - navigation: NavProp, - |}) => ScreenOptions, - +listeners?: - | ScreenListeners - | ({| - route: RouteProp, - navigation: NavProp, - |}) => ScreenListeners, - +initialParams?: $Partial<$ElementType>, - |}; - - declare export type ScreenProps< - ParamList: ParamListBase, - NavProp, - RouteName: $Keys = $Keys, - State: NavigationState = NavigationState, - ScreenOptions: {...} = {...}, - EventMap: EventMapBase = EventMapCore, - > = - | {| - ...BaseScreenProps< - ParamList, - NavProp, - RouteName, - State, - ScreenOptions, - EventMap, - >, - +component: React$ComponentType<{| - route: RouteProp, - navigation: NavProp, - |}>, - |} - | {| - ...BaseScreenProps< - ParamList, - NavProp, - RouteName, - State, - ScreenOptions, - EventMap, - >, - +children: ({| - route: RouteProp, - navigation: NavProp, - |}) => React$Node, - |}; - - declare export type ScreenComponent< - GlobalParamList: ParamListBase, - ParamList: ParamListBase, - State: NavigationState = NavigationState, - ScreenOptions: {...} = {...}, - EventMap: EventMapBase = EventMapCore, - > = < - RouteName: $Keys, - NavProp: NavigationProp< - GlobalParamList, - RouteName, - State, - ScreenOptions, - EventMap, - >, - >(props: ScreenProps< - ParamList, - NavProp, - RouteName, - State, - ScreenOptions, - EventMap, - >) => React$Node; - - declare type ScreenOptionsProp = {| - +screenOptions?: - | ScreenOptions - | ({| route: LeafRoute<>, navigation: NavProp |}) => ScreenOptions, - |}; - declare export type ExtraNavigatorPropsBase = { - ...$Exact, - +children?: React$Node, - ... - }; - declare export type NavigatorPropsBase = { - ...$Exact, - ...ScreenOptionsProp, - ... - }; - - declare export type CreateNavigator< - State: NavigationState, - ScreenOptions: {...}, - EventMap: EventMapBase, - ExtraNavigatorProps: ExtraNavigatorPropsBase, - > = < - GlobalParamList: ParamListBase, - ParamList: ParamListBase, - NavProp: NavigationHelpers< - GlobalParamList, - State, - EventMap, - >, - >() => {| - +Screen: ScreenComponent< - GlobalParamList, - ParamList, - State, - ScreenOptions, - EventMap, - >, - +Navigator: React$ComponentType<{| - ...$Exact, - ...ScreenOptionsProp, - |}>, - |}; - - declare export type CreateNavigatorFactory = < - State: NavigationState, - ScreenOptions: {...}, - EventMap: EventMapBase, - NavProp: NavigationHelpers< - ParamListBase, - State, - EventMap, - >, - ExtraNavigatorProps: ExtraNavigatorPropsBase, - >( - navigator: React$ComponentType<{| - ...$Exact, - ...ScreenOptionsProp, - |}>, - ) => CreateNavigator; - - /** - * useNavigationBuilder - */ - - declare export type Descriptor< - NavProp, - ScreenOptions: {...} = {...}, - > = {| - +render: () => React$Node, - +options: $ReadOnly, - +navigation: NavProp, - |}; - - declare export type UseNavigationBuilder = < - State: NavigationState, - Action: GenericNavigationAction, - ScreenOptions: {...}, - RouterOptions: DefaultRouterOptions, - NavProp, - >( - routerFactory: RouterFactory, - options: {| - ...$Exact, - ...ScreenOptionsProp, - +children?: React$Node, - |}, - ) => {| - +state: State, - +descriptors: {| +[key: string]: Descriptor |}, - +navigation: NavProp, - |}; - - /** - * EdgeInsets - */ - - declare type EdgeInsets = {| - +top: number, - +right: number, - +bottom: number, - +left: number, - |}; - - /** - * TransitionPreset - */ - - declare export type TransitionSpec = - | {| - animation: 'spring', - config: $Diff< - SpringAnimationConfigSingle, - { toValue: number | AnimatedValue, ... }, - >, - |} - | {| - animation: 'timing', - config: $Diff< - TimingAnimationConfigSingle, - { toValue: number | AnimatedValue, ... }, - >, - |}; - - declare export type StackCardInterpolationProps = {| - +current: {| - +progress: AnimatedInterpolation, - |}, - +next?: {| - +progress: AnimatedInterpolation, - |}, - +index: number, - +closing: AnimatedInterpolation, - +swiping: AnimatedInterpolation, - +inverted: AnimatedInterpolation, - +layouts: {| - +screen: {| +width: number, +height: number |}, - |}, - +insets: EdgeInsets, - |}; - declare export type StackCardInterpolatedStyle = {| - containerStyle?: AnimatedViewStyleProp, - cardStyle?: AnimatedViewStyleProp, - overlayStyle?: AnimatedViewStyleProp, - shadowStyle?: AnimatedViewStyleProp, - |}; - declare export type StackCardStyleInterpolator = ( - props: StackCardInterpolationProps, - ) => StackCardInterpolatedStyle; - - declare export type StackHeaderInterpolationProps = {| - +current: {| - +progress: AnimatedInterpolation, - |}, - +next?: {| - +progress: AnimatedInterpolation, - |}, - +layouts: {| - +header: {| +width: number, +height: number |}, - +screen: {| +width: number, +height: number |}, - +title?: {| +width: number, +height: number |}, - +leftLabel?: {| +width: number, +height: number |}, - |}, - |}; - declare export type StackHeaderInterpolatedStyle = {| - leftLabelStyle?: AnimatedViewStyleProp, - leftButtonStyle?: AnimatedViewStyleProp, - rightButtonStyle?: AnimatedViewStyleProp, - titleStyle?: AnimatedViewStyleProp, - backgroundStyle?: AnimatedViewStyleProp, - |}; - declare export type StackHeaderStyleInterpolator = ( - props: StackHeaderInterpolationProps, - ) => StackHeaderInterpolatedStyle; - - declare type GestureDirection = - | 'horizontal' - | 'horizontal-inverted' - | 'vertical' - | 'vertical-inverted'; - - declare export type TransitionPreset = {| - +gestureDirection: GestureDirection, - +transitionSpec: {| - +open: TransitionSpec, - +close: TransitionSpec, - |}, - +cardStyleInterpolator: StackCardStyleInterpolator, - +headerStyleInterpolator: StackHeaderStyleInterpolator, - |}; - - /** - * Stack options - */ - - declare export type StackDescriptor = Descriptor< - StackNavigationProp<>, - StackOptions, - >; - - declare type Scene = {| - +route: T, - +descriptor: StackDescriptor, - +progress: {| - +current: AnimatedInterpolation, - +next?: AnimatedInterpolation, - +previous?: AnimatedInterpolation, - |}, - |}; - - declare export type StackHeaderProps = {| - +mode: 'float' | 'screen', - +layout: {| +width: number, +height: number |}, - +insets: EdgeInsets, - +scene: Scene>, - +previous?: Scene>, - +navigation: StackNavigationProp, - +styleInterpolator: StackHeaderStyleInterpolator, - |}; - - declare export type StackHeaderLeftButtonProps = $Partial<{| - +onPress: (() => void), - +pressColorAndroid: string; - +backImage: (props: {| tintColor: string |}) => React$Node, - +tintColor: string, - +label: string, - +truncatedLabel: string, - +labelVisible: boolean, - +labelStyle: AnimatedTextStyleProp, - +allowFontScaling: boolean, - +onLabelLayout: LayoutEvent => void, - +screenLayout: {| +width: number, +height: number |}, - +titleLayout: {| +width: number, +height: number |}, - +canGoBack: boolean, - |}>; - - declare type StackHeaderTitleInputBase = { - +onLayout: LayoutEvent => void, - +children: string, - +allowFontScaling: ?boolean, - +tintColor: ?string, - +style: ?AnimatedTextStyleProp, - ... - }; - - declare export type StackHeaderTitleInputProps = - $Exact; - - declare export type StackOptions = $Partial<{| - +title: string, - +header: StackHeaderProps => React$Node, - +headerShown: boolean, - +cardShadowEnabled: boolean, - +cardOverlayEnabled: boolean, - +cardOverlay: {| style: ViewStyleProp |} => React$Node, - +cardStyle: ViewStyleProp, - +animationEnabled: boolean, - +animationTypeForReplace: 'push' | 'pop', - +gestureEnabled: boolean, - +gestureResponseDistance: {| vertical?: number, horizontal?: number |}, - +gestureVelocityImpact: number, - +safeAreaInsets: $Partial, - // Transition - ...TransitionPreset, - // Header - +headerTitle: string | (StackHeaderTitleInputProps => React$Node), - +headerTitleAlign: 'left' | 'center', - +headerTitleStyle: AnimatedTextStyleProp, - +headerTitleContainerStyle: ViewStyleProp, - +headerTintColor: string, - +headerTitleAllowFontScaling: boolean, - +headerBackAllowFontScaling: boolean, - +headerBackTitle: string | null, - +headerBackTitleStyle: TextStyleProp, - +headerBackTitleVisible: boolean, - +headerTruncatedBackTitle: string, - +headerLeft: StackHeaderLeftButtonProps => React$Node, - +headerLeftContainerStyle: ViewStyleProp, - +headerRight: {| tintColor?: string |} => React$Node, - +headerRightContainerStyle: ViewStyleProp, - +headerBackImage: $PropertyType, - +headerPressColorAndroid: string, - +headerBackground: ({| style: ViewStyleProp |}) => React$Node, - +headerStyle: ViewStyleProp, - +headerTransparent: boolean, - +headerStatusBarHeight: number, - |}>; - - /** - * Stack navigation prop - */ - - declare export type StackNavigationEventMap = {| - ...EventMapCore, - +transitionStart: {| - +data: {| +closing: boolean |}, - +canPreventDefault: false, - |}, - +transitionEnd: {| - +data: {| +closing: boolean |}, - +canPreventDefault: false, - |}, - +gestureStart: {| +data: void, +canPreventDefault: false |}, - +gestureEnd: {| +data: void, +canPreventDefault: false |}, - +gestureCancel: {| +data: void, +canPreventDefault: false |}, - |}; - - declare type InexactStackNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = StackOptions, - EventMap: EventMapBase = StackNavigationEventMap, - > = { - ...$Exact>, - +replace: SimpleNavigate, - +push: SimpleNavigate, - +pop: (count?: number) => void, - +popToTop: () => void, - ... - }; - - declare export type StackNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = StackOptions, - EventMap: EventMapBase = StackNavigationEventMap, - > = $Exact>; - - /** - * Miscellaneous stack exports - */ - - declare type StackNavigationConfig = {| - +mode?: 'card' | 'modal', - +headerMode?: 'float' | 'screen' | 'none', - +keyboardHandlingEnabled?: boolean, - +detachInactiveScreens?: boolean, - |}; - - declare export type ExtraStackNavigatorProps = {| - ...$Exact, - ...StackRouterOptions, - ...StackNavigationConfig, - |}; - - declare export type StackNavigatorProps< - NavProp: InexactStackNavigationProp<> = StackNavigationProp<>, - > = {| - ...ExtraStackNavigatorProps, - ...ScreenOptionsProp, - |}; - - /** - * Bottom tab options - */ - - declare export type BottomTabBarButtonProps = {| - ...$Diff< - TouchableWithoutFeedbackProps, - {| onPress?: ?(event: PressEvent) => mixed |}, - >, - +to?: string, - +children: React$Node, - +onPress?: (MouseEvent | PressEvent) => void, - |}; - - declare export type TabBarVisibilityAnimationConfig = - | {| - +animation: 'spring', - +config?: $Diff< - SpringAnimationConfigSingle, - { toValue: number | AnimatedValue, useNativeDriver: boolean, ... }, - >, - |} - | {| - +animation: 'timing', - +config?: $Diff< - TimingAnimationConfigSingle, - { toValue: number | AnimatedValue, useNativeDriver: boolean, ... }, - >, - |}; - - declare export type BottomTabOptions = $Partial<{| - +title: string, - +tabBarLabel: - | string - | ({| focused: boolean, color: string |}) => React$Node, - +tabBarIcon: ({| - focused: boolean, - color: string, - size: number, - |}) => React$Node, - +tabBarBadge: number | string, - +tabBarBadgeStyle: TextStyleProp, - +tabBarAccessibilityLabel: string, - +tabBarTestID: string, - +tabBarVisible: boolean, - +tabBarVisibilityAnimationConfig: $Partial<{| - +show: TabBarVisibilityAnimationConfig, - +hide: TabBarVisibilityAnimationConfig, - |}>, - +tabBarButton: BottomTabBarButtonProps => React$Node, - +unmountOnBlur: boolean, - |}>; - - /** - * Bottom tab navigation prop - */ - - declare export type BottomTabNavigationEventMap = {| - ...EventMapCore, - +tabPress: {| +data: void, +canPreventDefault: true |}, - +tabLongPress: {| +data: void, +canPreventDefault: false |}, - |}; - - declare type InexactTabNavigationProp< - ParamList: ParamListBase, - RouteName: $Keys, - Options: {...}, - EventMap: EventMapBase, - > = { - ...$Exact>, - +jumpTo: SimpleNavigate, - ... - }; - - declare export type InexactBottomTabNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = BottomTabOptions, - EventMap: EventMapBase = BottomTabNavigationEventMap, - > = InexactTabNavigationProp< - ParamList, - RouteName, - Options, - EventMap, - >; - - declare export type BottomTabNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = BottomTabOptions, - EventMap: EventMapBase = BottomTabNavigationEventMap, - > = $Exact>; - - /** - * Miscellaneous bottom tab exports - */ - - declare export type BottomTabDescriptor = Descriptor< - BottomTabNavigationProp<>, - BottomTabOptions, - >; - - declare export type BottomTabBarOptions = $Partial<{| - +keyboardHidesTabBar: boolean, - +activeTintColor: string, - +inactiveTintColor: string, - +activeBackgroundColor: string, - +inactiveBackgroundColor: string, - +allowFontScaling: boolean, - +showLabel: boolean, - +showIcon: boolean, - +labelStyle: TextStyleProp, - +iconStyle: TextStyleProp, - +tabStyle: ViewStyleProp, - +labelPosition: 'beside-icon' | 'below-icon', - +adaptive: boolean, - +safeAreaInsets: $Partial, - +style: ViewStyleProp, - |}>; - - declare type BottomTabNavigationBuilderResult = {| - +state: TabNavigationState, - +navigation: BottomTabNavigationProp<>, - +descriptors: {| +[key: string]: BottomTabDescriptor |}, - |}; - - declare export type BottomTabBarProps = {| - ...BottomTabBarOptions, - ...BottomTabNavigationBuilderResult, - |} - - declare type BottomTabNavigationConfig = {| - +lazy?: boolean, - +tabBar?: BottomTabBarProps => React$Node, - +tabBarOptions?: BottomTabBarOptions, - +detachInactiveScreens?: boolean, - |}; - - declare export type ExtraBottomTabNavigatorProps = {| - ...$Exact, - ...TabRouterOptions, - ...BottomTabNavigationConfig, - |}; - - declare export type BottomTabNavigatorProps< - NavProp: InexactBottomTabNavigationProp<> = BottomTabNavigationProp<>, - > = {| - ...ExtraBottomTabNavigatorProps, - ...ScreenOptionsProp, - |}; - - /** - * Material bottom tab options - */ - - declare export type MaterialBottomTabOptions = $Partial<{| - +title: string, - +tabBarColor: string, - +tabBarLabel: string, - +tabBarIcon: - | string - | ({| +focused: boolean, +color: string |}) => React$Node, - +tabBarBadge: boolean | number | string, - +tabBarAccessibilityLabel: string, - +tabBarTestID: string, - |}>; - - /** - * Material bottom tab navigation prop - */ - - declare export type MaterialBottomTabNavigationEventMap = {| - ...EventMapCore, - +tabPress: {| +data: void, +canPreventDefault: true |}, - |}; - - declare export type InexactMaterialBottomTabNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = MaterialBottomTabOptions, - EventMap: EventMapBase = MaterialBottomTabNavigationEventMap, - > = InexactTabNavigationProp< - ParamList, - RouteName, - Options, - EventMap, - >; - - declare export type MaterialBottomTabNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = MaterialBottomTabOptions, - EventMap: EventMapBase = MaterialBottomTabNavigationEventMap, - > = $Exact>; - - /** - * Miscellaneous material bottom tab exports - */ - - declare export type PaperFont = {| - +fontFamily: string, - +fontWeight?: - | 'normal' - | 'bold' - | '100' - | '200' - | '300' - | '400' - | '500' - | '600' - | '700' - | '800' - | '900', - |}; - - declare export type PaperFonts = {| - +regular: Font, - +medium: Font, - +light: Font, - +thin: Font, - |}; - - declare export type PaperTheme = {| - +dark: boolean, - +mode?: 'adaptive' | 'exact', - +roundness: number, - +colors: {| - +primary: string, - +background: string, - +surface: string, - +accent: string, - +error: string, - +text: string, - +onSurface: string, - +onBackground: string, - +disabled: string, - +placeholder: string, - +backdrop: string, - +notification: string, - |}, - +fonts: PaperFonts, - +animation: {| - +scale: number, - |}, - |}; - - declare export type PaperRoute = {| - +key: string, - +title?: string, - +icon?: any, - +badge?: string | number | boolean, - +color?: string, - +accessibilityLabel?: string, - +testID?: string, - |}; - - declare export type PaperTouchableProps = {| - ...TouchableWithoutFeedbackProps, - +key: string, - +route: PaperRoute, - +children: React$Node, - +borderless?: boolean, - +centered?: boolean, - +rippleColor?: string, - |}; - - declare export type MaterialBottomTabNavigationConfig = {| - +shifting?: boolean, - +labeled?: boolean, - +renderTouchable?: PaperTouchableProps => React$Node, - +activeColor?: string, - +inactiveColor?: string, - +sceneAnimationEnabled?: boolean, - +keyboardHidesNavigationBar?: boolean, - +barStyle?: ViewStyleProp, - +style?: ViewStyleProp, - +theme?: PaperTheme, - |}; - - declare export type ExtraMaterialBottomTabNavigatorProps = {| - ...$Exact, - ...TabRouterOptions, - ...MaterialBottomTabNavigationConfig, - |}; - - declare export type MaterialBottomTabNavigatorProps< - NavProp: InexactMaterialBottomTabNavigationProp<> = - MaterialBottomTabNavigationProp<>, - > = {| - ...ExtraMaterialBottomTabNavigatorProps, - ...ScreenOptionsProp, - |}; - - /** - * Material top tab options - */ - - declare export type MaterialTopTabOptions = $Partial<{| - +title: string, - +tabBarLabel: - | string - | ({| +focused: boolean, +color: string |}) => React$Node, - +tabBarIcon: ({| +focused: boolean, +color: string |}) => React$Node, - +tabBarAccessibilityLabel: string, - +tabBarTestID: string, - |}>; - - /** - * Material top tab navigation prop - */ - - declare export type MaterialTopTabNavigationEventMap = {| - ...EventMapCore, - +tabPress: {| +data: void, +canPreventDefault: true |}, - +tabLongPress: {| +data: void, +canPreventDefault: false |}, - +swipeStart: {| +data: void, +canPreventDefault: false |}, - +swipeEnd: {| +data: void, +canPreventDefault: false |}, - |}; - - declare export type InexactMaterialTopTabNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = MaterialTopTabOptions, - EventMap: EventMapBase = MaterialTopTabNavigationEventMap, - > = InexactTabNavigationProp< - ParamList, - RouteName, - Options, - EventMap, - >; - - declare export type MaterialTopTabNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = MaterialTopTabOptions, - EventMap: EventMapBase = MaterialTopTabNavigationEventMap, - > = $Exact>; - - /** - * Miscellaneous material top tab exports - */ - - declare type MaterialTopTabPagerCommonProps = {| - +keyboardDismissMode: 'none' | 'on-drag' | 'auto', - +swipeEnabled: boolean, - +swipeVelocityImpact?: number, - +springVelocityScale?: number, - +springConfig: $Partial<{| - +damping: number, - +mass: number, - +stiffness: number, - +restSpeedThreshold: number, - +restDisplacementThreshold: number, - |}>, - +timingConfig: $Partial<{| - +duration: number, - |}>, - |}; - - declare export type MaterialTopTabPagerProps = {| - ...MaterialTopTabPagerCommonProps, - +onSwipeStart?: () => void, - +onSwipeEnd?: () => void, - +onIndexChange: (index: number) => void, - +navigationState: TabNavigationState, - +layout: {| +width: number, +height: number |}, - +removeClippedSubviews: boolean, - +children: ({| - +addListener: (type: 'enter', listener: number => void) => void, - +removeListener: (type: 'enter', listener: number => void) => void, - +position: any, // Reanimated.Node - +render: React$Node => React$Node, - +jumpTo: string => void, - |}) => React$Node, - +gestureHandlerProps: PanGestureHandlerProps, - |}; - - declare export type MaterialTopTabBarIndicatorProps = {| - +navigationState: TabNavigationState, - +width: string, - +style?: ViewStyleProp, - +getTabWidth: number => number, - |}; - - declare export type MaterialTopTabBarOptions = $Partial<{| - +scrollEnabled: boolean, - +bounces: boolean, - +pressColor: string, - +pressOpacity: number, - +getAccessible: ({| +route: Route<> |}) => boolean, - +renderBadge: ({| +route: Route<> |}) => React$Node, - +renderIndicator: MaterialTopTabBarIndicatorProps => React$Node, - +tabStyle: ViewStyleProp, - +indicatorStyle: ViewStyleProp, - +indicatorContainerStyle: ViewStyleProp, - +labelStyle: TextStyleProp, - +contentContainerStyle: ViewStyleProp, - +style: ViewStyleProp, - +activeTintColor: string, - +inactiveTintColor: string, - +iconStyle: ViewStyleProp, - +labelStyle: TextStyleProp, - +showLabel: boolean, - +showIcon: boolean, - +allowFontScaling: boolean, - |}>; - - declare export type MaterialTopTabDescriptor = Descriptor< - MaterialBottomTabNavigationProp<>, - MaterialBottomTabOptions, - >; - - declare type MaterialTopTabNavigationBuilderResult = {| - +state: TabNavigationState, - +navigation: MaterialTopTabNavigationProp<>, - +descriptors: {| +[key: string]: MaterialTopTabDescriptor |}, - |}; - - declare export type MaterialTopTabBarProps = {| - ...MaterialTopTabBarOptions, - ...MaterialTopTabNavigationBuilderResult, - +layout: {| +width: number, +height: number |}, - +position: any, // Reanimated.Node - +jumpTo: string => void, - |}; - - declare export type MaterialTopTabNavigationConfig = {| - ...$Partial, - +position?: any, // Reanimated.Value - +tabBarPosition?: 'top' | 'bottom', - +initialLayout?: $Partial<{| +width: number, +height: number |}>, - +lazy?: boolean, - +lazyPreloadDistance?: number, - +removeClippedSubviews?: boolean, - +sceneContainerStyle?: ViewStyleProp, - +style?: ViewStyleProp, - +gestureHandlerProps?: PanGestureHandlerProps, - +pager?: MaterialTopTabPagerProps => React$Node, - +lazyPlaceholder?: ({| +route: Route<> |}) => React$Node, - +tabBar?: MaterialTopTabBarProps => React$Node, - +tabBarOptions?: MaterialTopTabBarOptions, - |}; - - declare export type ExtraMaterialTopTabNavigatorProps = {| - ...$Exact, - ...TabRouterOptions, - ...MaterialTopTabNavigationConfig, - |}; - - declare export type MaterialTopTabNavigatorProps< - NavProp: InexactMaterialTopTabNavigationProp<> = - MaterialTopTabNavigationProp<>, - > = {| - ...ExtraMaterialTopTabNavigatorProps, - ...ScreenOptionsProp, - |}; - - /** - * Drawer options - */ - - declare export type DrawerOptions = $Partial<{| - title: string, - drawerLabel: - | string - | ({| +color: string, +focused: boolean |}) => React$Node, - drawerIcon: ({| - +color: string, - +size: number, - +focused: boolean, - |}) => React$Node, - gestureEnabled: boolean, - swipeEnabled: boolean, - unmountOnBlur: boolean, - |}>; - - /** - * Drawer navigation prop - */ - - declare export type DrawerNavigationEventMap = {| - ...EventMapCore, - +drawerOpen: {| +data: void, +canPreventDefault: false |}, - +drawerClose: {| +data: void, +canPreventDefault: false |}, - |}; - - declare export type InexactDrawerNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = DrawerOptions, - EventMap: EventMapBase = DrawerNavigationEventMap, - > = { - ...$Exact>, - +jumpTo: SimpleNavigate, - +openDrawer: () => void, - +closeDrawer: () => void, - +toggleDrawer: () => void, - ... - }; - - declare export type DrawerNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = DrawerOptions, - EventMap: EventMapBase = DrawerNavigationEventMap, - > = $Exact>; - - /** - * Miscellaneous drawer exports - */ - - declare export type DrawerDescriptor = Descriptor< - DrawerNavigationProp<>, - DrawerOptions, - >; - - declare export type DrawerItemListBaseOptions = $Partial<{| - +activeTintColor: string, - +activeBackgroundColor: string, - +inactiveTintColor: string, - +inactiveBackgroundColor: string, - +itemStyle: ViewStyleProp, - +labelStyle: TextStyleProp, - |}>; - - declare export type DrawerContentOptions = $Partial<{| - ...DrawerItemListBaseOptions, - +contentContainerStyle: ViewStyleProp, - +style: ViewStyleProp, - |}>; - - declare type DrawerNavigationBuilderResult = {| - +state: DrawerNavigationState, - +navigation: DrawerNavigationProp<>, - +descriptors: {| +[key: string]: DrawerDescriptor |}, - |}; - - declare export type DrawerContentProps = {| - ...DrawerContentOptions, - ...DrawerNavigationBuilderResult, - +progress: any, // Reanimated.Node - |}; - - declare export type DrawerNavigationConfig = {| - +drawerPosition?: 'left' | 'right', - +drawerType?: 'front' | 'back' | 'slide' | 'permanent', - +edgeWidth?: number, - +hideStatusBar?: boolean, - +keyboardDismissMode?: 'on-drag' | 'none', - +minSwipeDistance?: number, - +overlayColor?: string, - +statusBarAnimation?: 'slide' | 'none' | 'fade', - +gestureHandlerProps?: PanGestureHandlerProps, - +lazy?: boolean, - +drawerContent?: DrawerContentProps => React$Node, - +drawerContentOptions?: DrawerContentOptions, - +sceneContainerStyle?: ViewStyleProp, - +drawerStyle?: ViewStyleProp, - +detachInactiveScreens?: boolean, - |}; - - declare export type ExtraDrawerNavigatorProps = {| - ...$Exact, - ...DrawerRouterOptions, - ...DrawerNavigationConfig, - |}; - - declare export type DrawerNavigatorProps< - NavProp: InexactDrawerNavigationProp<> = DrawerNavigationProp<>, - > = {| - ...ExtraDrawerNavigatorProps, - ...ScreenOptionsProp, - |}; - - /** - * BaseNavigationContainer - */ - - declare export type BaseNavigationContainerProps = {| - +children: React$Node, - +initialState?: PossiblyStaleNavigationState, - +onStateChange?: (state: ?PossiblyStaleNavigationState) => void, - +independent?: boolean, - |}; - - declare export type ContainerEventMap = {| - ...GlobalEventMap, - +options: {| - +data: {| +options: { +[key: string]: mixed, ... } |}, - +canPreventDefault: false, - |}, - +__unsafe_action__: {| - +data: {| - +action: GenericNavigationAction, - +noop: boolean, - |}, - +canPreventDefault: false, - |}, - |}; - - declare export type BaseNavigationContainerInterface = {| - ...$Exact>, - +setParams: (params: ScreenParams) => void, - +resetRoot: (state?: ?PossiblyStaleNavigationState) => void, - +getRootState: () => PossiblyStaleNavigationState, - |}; - - /** - * State utils - */ - - declare export type GetStateFromPath = ( - path: string, - options?: LinkingConfig, - ) => PossiblyStaleNavigationState; - - declare export type GetPathFromState = ( - state?: ?PossiblyStaleNavigationState, - options?: LinkingConfig, - ) => string; - - declare export type GetFocusedRouteNameFromRoute = - PossiblyStaleRoute => ?string; - - /** - * Linking - */ - - declare export type ScreenLinkingConfig = {| - +path?: string, - +exact?: boolean, - +parse?: {| +[param: string]: string => mixed |}, - +stringify?: {| +[param: string]: mixed => string |}, - +screens?: ScreenLinkingConfigMap, - +initialRouteName?: string, - |}; - - declare export type ScreenLinkingConfigMap = {| - +[routeName: string]: string | ScreenLinkingConfig, - |}; - - declare export type LinkingConfig = {| - +initialRouteName?: string, - +screens: ScreenLinkingConfigMap, - |}; - - declare export type LinkingOptions = {| - +enabled?: boolean, - +prefixes: $ReadOnlyArray, - +config?: LinkingConfig, - +getStateFromPath?: GetStateFromPath, - +getPathFromState?: GetPathFromState, - |}; - - /** - * NavigationContainer - */ - - declare export type Theme = {| - +dark: boolean, - +colors: {| - +primary: string, - +background: string, - +card: string, - +text: string, - +border: string, - |}, - |}; - - declare export type NavigationContainerType = React$AbstractComponent< - {| - ...BaseNavigationContainerProps, - +theme?: Theme, - +linking?: LinkingOptions, - +fallback?: React$Node, - +onReady?: () => mixed, - |}, - BaseNavigationContainerInterface, - >; - - //--------------------------------------------------------------------------- - // SECTION 2: EXPORTED MODULE - // This section defines the module exports and contains exported types that - // are not present in any other React Navigation libdef. - //--------------------------------------------------------------------------- - - /** - * createBottomTabNavigator - */ - - declare export var createBottomTabNavigator: CreateNavigator< - TabNavigationState, - BottomTabOptions, - BottomTabNavigationEventMap, - ExtraBottomTabNavigatorProps, - >; - - /** - * BottomTabBar - */ - - declare export var BottomTabBar: React$ComponentType; - - /** - * BottomTabView - */ - - declare export type BottomTabViewProps = {| - ...BottomTabNavigationConfig, - ...BottomTabNavigationBuilderResult, - |}; - declare export var BottomTabView: React$ComponentType; - -} diff --git a/flow-typed/npm/@react-navigation/material-top-tabs_v5.x.x.js b/flow-typed/npm/@react-navigation/material-top-tabs_v5.x.x.js deleted file mode 100644 index 6867726f87..0000000000 --- a/flow-typed/npm/@react-navigation/material-top-tabs_v5.x.x.js +++ /dev/null @@ -1,2078 +0,0 @@ -// flow-typed signature: add7a9504efc04ec59b85f3eedfad445 -// flow-typed version: 510a06cce0/@react-navigation/material-top-tabs_v5.x.x/flow_>=v0.104.x - -declare module '@react-navigation/material-top-tabs' { - - //--------------------------------------------------------------------------- - // SECTION 1: IDENTICAL TYPE DEFINITIONS - // This section is identical across all React Navigation libdefs and contains - // shared definitions. We wish we could make it DRY and import from a shared - // definition, but that isn't yet possible. - //--------------------------------------------------------------------------- - - /** - * We start with some definitions that we have copy-pasted from React Native - * source files. - */ - - // This is a bastardization of the true StyleObj type located in - // react-native/Libraries/StyleSheet/StyleSheetTypes. We unfortunately can't - // import that here, and it's too lengthy (and consequently too brittle) to - // copy-paste here either. - declare type StyleObj = - | null - | void - | number - | false - | '' - | $ReadOnlyArray - | { [name: string]: any, ... }; - declare type ViewStyleProp = StyleObj; - declare type TextStyleProp = StyleObj; - declare type AnimatedViewStyleProp = StyleObj; - declare type AnimatedTextStyleProp = StyleObj; - - // Vaguely copied from - // react-native/Libraries/Animated/src/animations/Animation.js - declare type EndResult = { finished: boolean, ... }; - declare type EndCallback = (result: EndResult) => void; - declare interface Animation { - start( - fromValue: number, - onUpdate: (value: number) => void, - onEnd: ?EndCallback, - previousAnimation: ?Animation, - animatedValue: AnimatedValue, - ): void; - stop(): void; - } - declare type AnimationConfig = { - isInteraction?: boolean, - useNativeDriver: boolean, - onComplete?: ?EndCallback, - iterations?: number, - ... - }; - - // Vaguely copied from - // react-native/Libraries/Animated/src/nodes/AnimatedTracking.js - declare interface AnimatedTracking { - constructor( - value: AnimatedValue, - parent: any, - animationClass: any, - animationConfig: Object, - callback?: ?EndCallback, - ): void; - update(): void; - } - - // Vaguely copied from - // react-native/Libraries/Animated/src/nodes/AnimatedValue.js - declare type ValueListenerCallback = (state: { value: number, ... }) => void; - declare interface AnimatedValue { - constructor(value: number): void; - setValue(value: number): void; - setOffset(offset: number): void; - flattenOffset(): void; - extractOffset(): void; - addListener(callback: ValueListenerCallback): string; - removeListener(id: string): void; - removeAllListeners(): void; - stopAnimation(callback?: ?(value: number) => void): void; - resetAnimation(callback?: ?(value: number) => void): void; - interpolate(config: InterpolationConfigType): AnimatedInterpolation; - animate(animation: Animation, callback: ?EndCallback): void; - stopTracking(): void; - track(tracking: AnimatedTracking): void; - } - - // Copied from - // react-native/Libraries/Animated/src/animations/TimingAnimation.js - declare type TimingAnimationConfigSingle = AnimationConfig & { - toValue: number | AnimatedValue, - easing?: (value: number) => number, - duration?: number, - delay?: number, - ... - }; - - // Copied from - // react-native/Libraries/Animated/src/animations/SpringAnimation.js - declare type SpringAnimationConfigSingle = AnimationConfig & { - toValue: number | AnimatedValue, - overshootClamping?: boolean, - restDisplacementThreshold?: number, - restSpeedThreshold?: number, - velocity?: number, - bounciness?: number, - speed?: number, - tension?: number, - friction?: number, - stiffness?: number, - damping?: number, - mass?: number, - delay?: number, - ... - }; - - // Copied from react-native/Libraries/Types/CoreEventTypes.js - declare type SyntheticEvent = $ReadOnly<{| - bubbles: ?boolean, - cancelable: ?boolean, - currentTarget: number, - defaultPrevented: ?boolean, - dispatchConfig: $ReadOnly<{| - registrationName: string, - |}>, - eventPhase: ?number, - preventDefault: () => void, - isDefaultPrevented: () => boolean, - stopPropagation: () => void, - isPropagationStopped: () => boolean, - isTrusted: ?boolean, - nativeEvent: T, - persist: () => void, - target: ?number, - timeStamp: number, - type: ?string, - |}>; - declare type Layout = $ReadOnly<{| - x: number, - y: number, - width: number, - height: number, - |}>; - declare type LayoutEvent = SyntheticEvent< - $ReadOnly<{| - layout: Layout, - |}>, - >; - declare type BlurEvent = SyntheticEvent< - $ReadOnly<{| - target: number, - |}>, - >; - declare type FocusEvent = SyntheticEvent< - $ReadOnly<{| - target: number, - |}>, - >; - declare type ResponderSyntheticEvent = $ReadOnly<{| - ...SyntheticEvent, - touchHistory: $ReadOnly<{| - indexOfSingleActiveTouch: number, - mostRecentTimeStamp: number, - numberActiveTouches: number, - touchBank: $ReadOnlyArray< - $ReadOnly<{| - touchActive: boolean, - startPageX: number, - startPageY: number, - startTimeStamp: number, - currentPageX: number, - currentPageY: number, - currentTimeStamp: number, - previousPageX: number, - previousPageY: number, - previousTimeStamp: number, - |}>, - >, - |}>, - |}>; - declare type PressEvent = ResponderSyntheticEvent< - $ReadOnly<{| - changedTouches: $ReadOnlyArray<$PropertyType>, - force: number, - identifier: number, - locationX: number, - locationY: number, - pageX: number, - pageY: number, - target: ?number, - timestamp: number, - touches: $ReadOnlyArray<$PropertyType>, - |}>, - >; - - // Vaguely copied from - // react-native/Libraries/Animated/src/nodes/AnimatedInterpolation.js - declare type ExtrapolateType = 'extend' | 'identity' | 'clamp'; - declare type InterpolationConfigType = { - inputRange: Array, - outputRange: Array | Array, - easing?: (input: number) => number, - extrapolate?: ExtrapolateType, - extrapolateLeft?: ExtrapolateType, - extrapolateRight?: ExtrapolateType, - ... - }; - declare interface AnimatedInterpolation { - interpolate(config: InterpolationConfigType): AnimatedInterpolation; - } - - // Copied from react-native/Libraries/Components/View/ViewAccessibility.js - declare 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'; - declare type AccessibilityActionInfo = $ReadOnly<{ - name: string, - label?: string, - ... - }>; - declare type AccessibilityActionEvent = SyntheticEvent< - $ReadOnly<{actionName: string, ...}>, - >; - declare type AccessibilityState = { - disabled?: boolean, - selected?: boolean, - checked?: ?boolean | 'mixed', - busy?: boolean, - expanded?: boolean, - ... - }; - declare type AccessibilityValue = $ReadOnly<{| - min?: number, - max?: number, - now?: number, - text?: string, - |}>; - - // Copied from - // react-native/Libraries/Components/Touchable/TouchableWithoutFeedback.js - declare type Stringish = string; - declare type EdgeInsetsProp = $ReadOnly<$Partial>; - declare type TouchableWithoutFeedbackProps = $ReadOnly<{| - accessibilityActions?: ?$ReadOnlyArray, - accessibilityElementsHidden?: ?boolean, - accessibilityHint?: ?Stringish, - accessibilityIgnoresInvertColors?: ?boolean, - accessibilityLabel?: ?Stringish, - accessibilityLiveRegion?: ?('none' | 'polite' | 'assertive'), - accessibilityRole?: ?AccessibilityRole, - accessibilityState?: ?AccessibilityState, - accessibilityValue?: ?AccessibilityValue, - accessibilityViewIsModal?: ?boolean, - accessible?: ?boolean, - children?: ?React$Node, - delayLongPress?: ?number, - delayPressIn?: ?number, - delayPressOut?: ?number, - disabled?: ?boolean, - focusable?: ?boolean, - hitSlop?: ?EdgeInsetsProp, - importantForAccessibility?: ?('auto' | 'yes' | 'no' | 'no-hide-descendants'), - nativeID?: ?string, - onAccessibilityAction?: ?(event: AccessibilityActionEvent) => mixed, - onBlur?: ?(event: BlurEvent) => mixed, - onFocus?: ?(event: FocusEvent) => mixed, - onLayout?: ?(event: LayoutEvent) => mixed, - onLongPress?: ?(event: PressEvent) => mixed, - onPress?: ?(event: PressEvent) => mixed, - onPressIn?: ?(event: PressEvent) => mixed, - onPressOut?: ?(event: PressEvent) => mixed, - pressRetentionOffset?: ?EdgeInsetsProp, - rejectResponderTermination?: ?boolean, - testID?: ?string, - touchSoundDisabled?: ?boolean, - |}>; - - // Copied from react-native/Libraries/Image/ImageSource.js - declare type ImageURISource = $ReadOnly<{ - uri?: ?string, - bundle?: ?string, - method?: ?string, - headers?: ?Object, - body?: ?string, - cache?: ?('default' | 'reload' | 'force-cache' | 'only-if-cached'), - width?: ?number, - height?: ?number, - scale?: ?number, - ... - }>; - - /** - * The following is copied from react-native-gesture-handler's libdef - */ - - declare type $EventHandlers = {| - onGestureEvent?: ($Event) => mixed, - onHandlerStateChange?: ($Event) => mixed, - onBegan?: ($Event) => mixed, - onFailed?: ($Event) => mixed, - onCancelled?: ($Event) => mixed, - onActivated?: ($Event) => mixed, - onEnded?: ($Event) => mixed, - |}; - - declare type HitSlop = - | number - | {| - left?: number, - top?: number, - right?: number, - bottom?: number, - vertical?: number, - horizontal?: number, - width?: number, - height?: number, - |} - | {| - width: number, - left: number, - |} - | {| - width: number, - right: number, - |} - | {| - height: number, - top: number, - |} - | {| - height: number, - bottom: number, - |}; - - declare type $GestureHandlerProps< - AdditionalProps: {...}, - ExtraEventsProps: {...} - > = $ReadOnly<{| - ...$Exact, - ...$EventHandlers, - id?: string, - enabled?: boolean, - waitFor?: React$Ref | Array>, - simultaneousHandlers?: React$Ref | Array>, - shouldCancelWhenOutside?: boolean, - minPointers?: number, - hitSlop?: HitSlop, - children?: React$Node, - |}>; - - declare type PanGestureHandlerProps = $GestureHandlerProps< - { - activeOffsetY?: number | [number, number], - activeOffsetX?: number | [number, number], - failOffsetY?: number | [number, number], - failOffsetX?: number | [number, number], - minDist?: number, - minVelocity?: number, - minVelocityX?: number, - minVelocityY?: number, - minPointers?: number, - maxPointers?: number, - avgTouches?: boolean, - ... - }, - { - x: number, - y: number, - absoluteX: number, - absoluteY: number, - translationX: number, - translationY: number, - velocityX: number, - velocityY: number, - ... - } - >; - - /** - * MAGIC - */ - - declare type $If = $Call< - ((true, Then, Else) => Then) & ((false, Then, Else) => Else), - Test, - Then, - Else, - >; - declare type $IsA = $Call< - (Y => true) & (mixed => false), - X, - >; - declare type $IsUndefined = $IsA; - - declare type $Partial = $ReadOnly<$Rest>; - - /** - * Actions, state, etc. - */ - - declare export type ScreenParams = { +[key: string]: mixed, ... }; - - declare export type BackAction = {| - +type: 'GO_BACK', - +source?: string, - +target?: string, - |}; - declare export type NavigateAction = {| - +type: 'NAVIGATE', - +payload: - | {| +key: string, +params?: ScreenParams |} - | {| +name: string, +key?: string, +params?: ScreenParams |}, - +source?: string, - +target?: string, - |}; - declare export type ResetAction = {| - +type: 'RESET', - +payload: StaleNavigationState, - +source?: string, - +target?: string, - |}; - declare export type SetParamsAction = {| - +type: 'SET_PARAMS', - +payload: {| +params?: ScreenParams |}, - +source?: string, - +target?: string, - |}; - declare export type CommonAction = - | BackAction - | NavigateAction - | ResetAction - | SetParamsAction; - - declare type NavigateActionCreator = {| - (routeName: string, params?: ScreenParams): NavigateAction, - ( - | {| +key: string, +params?: ScreenParams |} - | {| +name: string, +key?: string, +params?: ScreenParams |}, - ): NavigateAction, - |}; - declare export type CommonActionsType = {| - +navigate: NavigateActionCreator, - +goBack: () => BackAction, - +reset: (state: PossiblyStaleNavigationState) => ResetAction, - +setParams: (params: ScreenParams) => SetParamsAction, - |}; - - declare export type GenericNavigationAction = {| - +type: string, - +payload?: { +[key: string]: mixed, ... }, - +source?: string, - +target?: string, - |}; - - declare export type LeafRoute = {| - +key: string, - +name: RouteName, - +params?: ScreenParams, - |}; - declare export type StateRoute = {| - ...LeafRoute, - +state: NavigationState | StaleNavigationState, - |}; - declare export type Route = - | LeafRoute - | StateRoute; - - declare export type NavigationState = {| - +key: string, - +index: number, - +routeNames: $ReadOnlyArray, - +history?: $ReadOnlyArray, - +routes: $ReadOnlyArray>, - +type: string, - +stale: false, - |}; - - declare export type StaleLeafRoute = {| - +key?: string, - +name: RouteName, - +params?: ScreenParams, - |}; - declare export type StaleStateRoute = {| - ...StaleLeafRoute, - +state: StaleNavigationState, - |}; - declare export type StaleRoute = - | StaleLeafRoute - | StaleStateRoute; - declare export type StaleNavigationState = {| - // It's possible to pass React Nav a StaleNavigationState with an undefined - // index, but React Nav will always return one with the index set. This is - // the same as for the type property below, but in the case of index we tend - // to rely on it being set more... - +index: number, - +history?: $ReadOnlyArray, - +routes: $ReadOnlyArray>, - +type?: string, - +stale?: true, - |}; - - declare export type PossiblyStaleNavigationState = - | NavigationState - | StaleNavigationState; - declare export type PossiblyStaleRoute = - | Route - | StaleRoute; - - /** - * Routers - */ - - declare type ActionCreators< - State: NavigationState, - Action: GenericNavigationAction, - > = { - +[key: string]: (...args: any) => (Action | State => Action), - ... - }; - - declare export type DefaultRouterOptions = { - +initialRouteName?: string, - ... - }; - - declare export type RouterFactory< - State: NavigationState, - Action: GenericNavigationAction, - RouterOptions: DefaultRouterOptions, - > = (options: RouterOptions) => Router; - - declare export type ParamListBase = { +[key: string]: ?ScreenParams, ... }; - - declare export type RouterConfigOptions = {| - +routeNames: $ReadOnlyArray, - +routeParamList: ParamListBase, - |}; - - declare export type Router< - State: NavigationState, - Action: GenericNavigationAction, - > = {| - +type: $PropertyType, - +getInitialState: (options: RouterConfigOptions) => State, - +getRehydratedState: ( - partialState: PossibleStaleNavigationState, - options: RouterConfigOptions, - ) => State, - +getStateForRouteNamesChange: ( - state: State, - options: RouterConfigOptions, - ) => State, - +getStateForRouteFocus: (state: State, key: string) => State, - +getStateForAction: ( - state: State, - action: Action, - options: RouterConfigOptions, - ) => ?PossiblyStaleNavigationState; - +shouldActionChangeFocus: (action: GenericNavigationAction) => boolean, - +actionCreators?: ActionCreators, - |}; - - /** - * Stack actions and router - */ - - declare export type StackNavigationState = {| - ...NavigationState, - +type: 'stack', - |}; - - declare export type ReplaceAction = {| - +type: 'REPLACE', - +payload: {| +name: string, +key?: ?string, +params?: ScreenParams |}, - +source?: string, - +target?: string, - |}; - declare export type PushAction = {| - +type: 'PUSH', - +payload: {| +name: string, +key?: ?string, +params?: ScreenParams |}, - +source?: string, - +target?: string, - |}; - declare export type PopAction = {| - +type: 'POP', - +payload: {| +count: number |}, - +source?: string, - +target?: string, - |}; - declare export type PopToTopAction = {| - +type: 'POP_TO_TOP', - +source?: string, - +target?: string, - |}; - declare export type StackAction = - | CommonAction - | ReplaceAction - | PushAction - | PopAction - | PopToTopAction; - - declare export type StackActionsType = {| - +replace: (routeName: string, params?: ScreenParams) => ReplaceAction, - +push: (routeName: string, params?: ScreenParams) => PushAction, - +pop: (count?: number) => PopAction, - +popToTop: () => PopToTopAction, - |}; - - declare export type StackRouterOptions = $Exact; - - /** - * Tab actions and router - */ - - declare export type TabNavigationState = {| - ...NavigationState, - +type: 'tab', - +history: $ReadOnlyArray<{| type: 'route', key: string |}>, - |}; - - declare export type JumpToAction = {| - +type: 'JUMP_TO', - +payload: {| +name: string, +params?: ScreenParams |}, - +source?: string, - +target?: string, - |}; - declare export type TabAction = - | CommonAction - | JumpToAction; - - declare export type TabActionsType = {| - +jumpTo: string => JumpToAction, - |}; - - declare export type TabRouterOptions = {| - ...$Exact, - +backBehavior?: 'initialRoute' | 'order' | 'history' | 'none', - |}; - - /** - * Drawer actions and router - */ - - declare type DrawerHistoryEntry = - | {| +type: 'route', +key: string |} - | {| +type: 'drawer' |}; - declare export type DrawerNavigationState = {| - ...NavigationState, - +type: 'drawer', - +history: $ReadOnlyArray, - |}; - - declare export type OpenDrawerAction = {| - +type: 'OPEN_DRAWER', - +source?: string, - +target?: string, - |}; - declare export type CloseDrawerAction = {| - +type: 'CLOSE_DRAWER', - +source?: string, - +target?: string, - |}; - declare export type ToggleDrawerAction = {| - +type: 'TOGGLE_DRAWER', - +source?: string, - +target?: string, - |}; - declare export type DrawerAction = - | TabAction - | OpenDrawerAction - | CloseDrawerAction - | ToggleDrawerAction; - - declare export type DrawerActionsType = {| - ...TabActionsType, - +openDrawer: () => OpenDrawerAction, - +closeDrawer: () => CloseDrawerAction, - +toggleDrawer: () => ToggleDrawerAction, - |}; - - declare export type DrawerRouterOptions = {| - ...TabRouterOptions, - +openByDefault?: boolean, - |}; - - /** - * Events - */ - - declare export type EventMapBase = { - +[name: string]: {| - +data?: mixed, - +canPreventDefault?: boolean, - |}, - ... - }; - declare type EventPreventDefaultProperties = $If< - Test, - {| +defaultPrevented: boolean, +preventDefault: () => void |}, - {| |}, - >; - declare type EventDataProperties = $If< - $IsUndefined, - {| |}, - {| +data: Data |}, - >; - declare type EventArg< - EventName: string, - CanPreventDefault: ?boolean = false, - Data = void, - > = {| - ...EventPreventDefaultProperties, - ...EventDataProperties, - +type: EventName, - +target?: string, - |}; - declare type GlobalEventMap = {| - +state: {| +data: {| +state: State |}, +canPreventDefault: false |}, - |}; - declare type EventMapCore = {| - ...GlobalEventMap, - +focus: {| +data: void, +canPreventDefault: false |}, - +blur: {| +data: void, +canPreventDefault: false |}, - +beforeRemove: {| - +data: {| +action: GenericNavigationAction |}, - +canPreventDefault: true, - |}, - |}; - declare type EventListenerCallback< - EventName: string, - State: PossiblyStaleNavigationState = NavigationState, - EventMap: EventMapBase = EventMapCore, - > = (e: EventArg< - EventName, - $PropertyType< - $ElementType< - {| ...EventMap, ...EventMapCore |}, - EventName, - >, - 'canPreventDefault', - >, - $PropertyType< - $ElementType< - {| ...EventMap, ...EventMapCore |}, - EventName, - >, - 'data', - >, - >) => mixed; - - /** - * Navigation prop - */ - - declare export type SimpleNavigate = - >( - routeName: DestinationRouteName, - params: $ElementType, - ) => void; - - declare export type Navigate = - & SimpleNavigate - & >( - route: - | {| - key: string, - params?: $ElementType, - |} - | {| - name: DestinationRouteName, - key?: string, - params?: $ElementType, - |}, - ) => void; - - declare type NavigationHelpers< - ParamList: ParamListBase, - State: PossiblyStaleNavigationState = PossiblyStaleNavigationState, - EventMap: EventMapBase = EventMapCore, - > = { - +navigate: Navigate, - +dispatch: ( - action: - | GenericNavigationAction - | (State => GenericNavigationAction), - ) => void, - +reset: PossiblyStaleNavigationState => void, - +goBack: () => void, - +isFocused: () => boolean, - +canGoBack: () => boolean, - +dangerouslyGetParent: >() => ?Parent, - +dangerouslyGetState: () => NavigationState, - +addListener: |}, - >>( - name: EventName, - callback: EventListenerCallback, - ) => () => void, - +removeListener: |}, - >>( - name: EventName, - callback: EventListenerCallback, - ) => void, - ... - }; - - declare export type NavigationProp< - ParamList: ParamListBase, - RouteName: $Keys = $Keys, - State: PossiblyStaleNavigationState = PossiblyStaleNavigationState, - ScreenOptions: {...} = {...}, - EventMap: EventMapBase = EventMapCore, - > = { - ...$Exact>, - +setOptions: (options: $Partial) => void, - +setParams: ( - params: $If< - $IsUndefined<$ElementType>, - empty, - $Partial<$NonMaybeType<$ElementType>>, - >, - ) => void, - ... - }; - - /** - * CreateNavigator - */ - - declare export type RouteProp< - ParamList: ParamListBase, - RouteName: $Keys, - > = {| - ...LeafRoute, - +params: $ElementType, - |}; - - declare export type ScreenListeners< - EventMap: EventMapBase = EventMapCore, - State: NavigationState = NavigationState, - > = $ObjMapi< - {| [name: $Keys]: empty |}, - >(K, empty) => EventListenerCallback, - >; - - declare type BaseScreenProps< - ParamList: ParamListBase, - NavProp, - RouteName: $Keys = $Keys, - State: NavigationState = NavigationState, - ScreenOptions: {...} = {...}, - EventMap: EventMapBase = EventMapCore, - > = {| - +name: RouteName, - +options?: - | ScreenOptions - | ({| - route: RouteProp, - navigation: NavProp, - |}) => ScreenOptions, - +listeners?: - | ScreenListeners - | ({| - route: RouteProp, - navigation: NavProp, - |}) => ScreenListeners, - +initialParams?: $Partial<$ElementType>, - |}; - - declare export type ScreenProps< - ParamList: ParamListBase, - NavProp, - RouteName: $Keys = $Keys, - State: NavigationState = NavigationState, - ScreenOptions: {...} = {...}, - EventMap: EventMapBase = EventMapCore, - > = - | {| - ...BaseScreenProps< - ParamList, - NavProp, - RouteName, - State, - ScreenOptions, - EventMap, - >, - +component: React$ComponentType<{| - route: RouteProp, - navigation: NavProp, - |}>, - |} - | {| - ...BaseScreenProps< - ParamList, - NavProp, - RouteName, - State, - ScreenOptions, - EventMap, - >, - +children: ({| - route: RouteProp, - navigation: NavProp, - |}) => React$Node, - |}; - - declare export type ScreenComponent< - GlobalParamList: ParamListBase, - ParamList: ParamListBase, - State: NavigationState = NavigationState, - ScreenOptions: {...} = {...}, - EventMap: EventMapBase = EventMapCore, - > = < - RouteName: $Keys, - NavProp: NavigationProp< - GlobalParamList, - RouteName, - State, - ScreenOptions, - EventMap, - >, - >(props: ScreenProps< - ParamList, - NavProp, - RouteName, - State, - ScreenOptions, - EventMap, - >) => React$Node; - - declare type ScreenOptionsProp = {| - +screenOptions?: - | ScreenOptions - | ({| route: LeafRoute<>, navigation: NavProp |}) => ScreenOptions, - |}; - declare export type ExtraNavigatorPropsBase = { - ...$Exact, - +children?: React$Node, - ... - }; - declare export type NavigatorPropsBase = { - ...$Exact, - ...ScreenOptionsProp, - ... - }; - - declare export type CreateNavigator< - State: NavigationState, - ScreenOptions: {...}, - EventMap: EventMapBase, - ExtraNavigatorProps: ExtraNavigatorPropsBase, - > = < - GlobalParamList: ParamListBase, - ParamList: ParamListBase, - NavProp: NavigationHelpers< - GlobalParamList, - State, - EventMap, - >, - >() => {| - +Screen: ScreenComponent< - GlobalParamList, - ParamList, - State, - ScreenOptions, - EventMap, - >, - +Navigator: React$ComponentType<{| - ...$Exact, - ...ScreenOptionsProp, - |}>, - |}; - - declare export type CreateNavigatorFactory = < - State: NavigationState, - ScreenOptions: {...}, - EventMap: EventMapBase, - NavProp: NavigationHelpers< - ParamListBase, - State, - EventMap, - >, - ExtraNavigatorProps: ExtraNavigatorPropsBase, - >( - navigator: React$ComponentType<{| - ...$Exact, - ...ScreenOptionsProp, - |}>, - ) => CreateNavigator; - - /** - * useNavigationBuilder - */ - - declare export type Descriptor< - NavProp, - ScreenOptions: {...} = {...}, - > = {| - +render: () => React$Node, - +options: $ReadOnly, - +navigation: NavProp, - |}; - - declare export type UseNavigationBuilder = < - State: NavigationState, - Action: GenericNavigationAction, - ScreenOptions: {...}, - RouterOptions: DefaultRouterOptions, - NavProp, - >( - routerFactory: RouterFactory, - options: {| - ...$Exact, - ...ScreenOptionsProp, - +children?: React$Node, - |}, - ) => {| - +state: State, - +descriptors: {| +[key: string]: Descriptor |}, - +navigation: NavProp, - |}; - - /** - * EdgeInsets - */ - - declare type EdgeInsets = {| - +top: number, - +right: number, - +bottom: number, - +left: number, - |}; - - /** - * TransitionPreset - */ - - declare export type TransitionSpec = - | {| - animation: 'spring', - config: $Diff< - SpringAnimationConfigSingle, - { toValue: number | AnimatedValue, ... }, - >, - |} - | {| - animation: 'timing', - config: $Diff< - TimingAnimationConfigSingle, - { toValue: number | AnimatedValue, ... }, - >, - |}; - - declare export type StackCardInterpolationProps = {| - +current: {| - +progress: AnimatedInterpolation, - |}, - +next?: {| - +progress: AnimatedInterpolation, - |}, - +index: number, - +closing: AnimatedInterpolation, - +swiping: AnimatedInterpolation, - +inverted: AnimatedInterpolation, - +layouts: {| - +screen: {| +width: number, +height: number |}, - |}, - +insets: EdgeInsets, - |}; - declare export type StackCardInterpolatedStyle = {| - containerStyle?: AnimatedViewStyleProp, - cardStyle?: AnimatedViewStyleProp, - overlayStyle?: AnimatedViewStyleProp, - shadowStyle?: AnimatedViewStyleProp, - |}; - declare export type StackCardStyleInterpolator = ( - props: StackCardInterpolationProps, - ) => StackCardInterpolatedStyle; - - declare export type StackHeaderInterpolationProps = {| - +current: {| - +progress: AnimatedInterpolation, - |}, - +next?: {| - +progress: AnimatedInterpolation, - |}, - +layouts: {| - +header: {| +width: number, +height: number |}, - +screen: {| +width: number, +height: number |}, - +title?: {| +width: number, +height: number |}, - +leftLabel?: {| +width: number, +height: number |}, - |}, - |}; - declare export type StackHeaderInterpolatedStyle = {| - leftLabelStyle?: AnimatedViewStyleProp, - leftButtonStyle?: AnimatedViewStyleProp, - rightButtonStyle?: AnimatedViewStyleProp, - titleStyle?: AnimatedViewStyleProp, - backgroundStyle?: AnimatedViewStyleProp, - |}; - declare export type StackHeaderStyleInterpolator = ( - props: StackHeaderInterpolationProps, - ) => StackHeaderInterpolatedStyle; - - declare type GestureDirection = - | 'horizontal' - | 'horizontal-inverted' - | 'vertical' - | 'vertical-inverted'; - - declare export type TransitionPreset = {| - +gestureDirection: GestureDirection, - +transitionSpec: {| - +open: TransitionSpec, - +close: TransitionSpec, - |}, - +cardStyleInterpolator: StackCardStyleInterpolator, - +headerStyleInterpolator: StackHeaderStyleInterpolator, - |}; - - /** - * Stack options - */ - - declare export type StackDescriptor = Descriptor< - StackNavigationProp<>, - StackOptions, - >; - - declare type Scene = {| - +route: T, - +descriptor: StackDescriptor, - +progress: {| - +current: AnimatedInterpolation, - +next?: AnimatedInterpolation, - +previous?: AnimatedInterpolation, - |}, - |}; - - declare export type StackHeaderProps = {| - +mode: 'float' | 'screen', - +layout: {| +width: number, +height: number |}, - +insets: EdgeInsets, - +scene: Scene>, - +previous?: Scene>, - +navigation: StackNavigationProp, - +styleInterpolator: StackHeaderStyleInterpolator, - |}; - - declare export type StackHeaderLeftButtonProps = $Partial<{| - +onPress: (() => void), - +pressColorAndroid: string; - +backImage: (props: {| tintColor: string |}) => React$Node, - +tintColor: string, - +label: string, - +truncatedLabel: string, - +labelVisible: boolean, - +labelStyle: AnimatedTextStyleProp, - +allowFontScaling: boolean, - +onLabelLayout: LayoutEvent => void, - +screenLayout: {| +width: number, +height: number |}, - +titleLayout: {| +width: number, +height: number |}, - +canGoBack: boolean, - |}>; - - declare type StackHeaderTitleInputBase = { - +onLayout: LayoutEvent => void, - +children: string, - +allowFontScaling: ?boolean, - +tintColor: ?string, - +style: ?AnimatedTextStyleProp, - ... - }; - - declare export type StackHeaderTitleInputProps = - $Exact; - - declare export type StackOptions = $Partial<{| - +title: string, - +header: StackHeaderProps => React$Node, - +headerShown: boolean, - +cardShadowEnabled: boolean, - +cardOverlayEnabled: boolean, - +cardOverlay: {| style: ViewStyleProp |} => React$Node, - +cardStyle: ViewStyleProp, - +animationEnabled: boolean, - +animationTypeForReplace: 'push' | 'pop', - +gestureEnabled: boolean, - +gestureResponseDistance: {| vertical?: number, horizontal?: number |}, - +gestureVelocityImpact: number, - +safeAreaInsets: $Partial, - // Transition - ...TransitionPreset, - // Header - +headerTitle: string | (StackHeaderTitleInputProps => React$Node), - +headerTitleAlign: 'left' | 'center', - +headerTitleStyle: AnimatedTextStyleProp, - +headerTitleContainerStyle: ViewStyleProp, - +headerTintColor: string, - +headerTitleAllowFontScaling: boolean, - +headerBackAllowFontScaling: boolean, - +headerBackTitle: string | null, - +headerBackTitleStyle: TextStyleProp, - +headerBackTitleVisible: boolean, - +headerTruncatedBackTitle: string, - +headerLeft: StackHeaderLeftButtonProps => React$Node, - +headerLeftContainerStyle: ViewStyleProp, - +headerRight: {| tintColor?: string |} => React$Node, - +headerRightContainerStyle: ViewStyleProp, - +headerBackImage: $PropertyType, - +headerPressColorAndroid: string, - +headerBackground: ({| style: ViewStyleProp |}) => React$Node, - +headerStyle: ViewStyleProp, - +headerTransparent: boolean, - +headerStatusBarHeight: number, - |}>; - - /** - * Stack navigation prop - */ - - declare export type StackNavigationEventMap = {| - ...EventMapCore, - +transitionStart: {| - +data: {| +closing: boolean |}, - +canPreventDefault: false, - |}, - +transitionEnd: {| - +data: {| +closing: boolean |}, - +canPreventDefault: false, - |}, - +gestureStart: {| +data: void, +canPreventDefault: false |}, - +gestureEnd: {| +data: void, +canPreventDefault: false |}, - +gestureCancel: {| +data: void, +canPreventDefault: false |}, - |}; - - declare type InexactStackNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = StackOptions, - EventMap: EventMapBase = StackNavigationEventMap, - > = { - ...$Exact>, - +replace: SimpleNavigate, - +push: SimpleNavigate, - +pop: (count?: number) => void, - +popToTop: () => void, - ... - }; - - declare export type StackNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = StackOptions, - EventMap: EventMapBase = StackNavigationEventMap, - > = $Exact>; - - /** - * Miscellaneous stack exports - */ - - declare type StackNavigationConfig = {| - +mode?: 'card' | 'modal', - +headerMode?: 'float' | 'screen' | 'none', - +keyboardHandlingEnabled?: boolean, - +detachInactiveScreens?: boolean, - |}; - - declare export type ExtraStackNavigatorProps = {| - ...$Exact, - ...StackRouterOptions, - ...StackNavigationConfig, - |}; - - declare export type StackNavigatorProps< - NavProp: InexactStackNavigationProp<> = StackNavigationProp<>, - > = {| - ...ExtraStackNavigatorProps, - ...ScreenOptionsProp, - |}; - - /** - * Bottom tab options - */ - - declare export type BottomTabBarButtonProps = {| - ...$Diff< - TouchableWithoutFeedbackProps, - {| onPress?: ?(event: PressEvent) => mixed |}, - >, - +to?: string, - +children: React$Node, - +onPress?: (MouseEvent | PressEvent) => void, - |}; - - declare export type TabBarVisibilityAnimationConfig = - | {| - +animation: 'spring', - +config?: $Diff< - SpringAnimationConfigSingle, - { toValue: number | AnimatedValue, useNativeDriver: boolean, ... }, - >, - |} - | {| - +animation: 'timing', - +config?: $Diff< - TimingAnimationConfigSingle, - { toValue: number | AnimatedValue, useNativeDriver: boolean, ... }, - >, - |}; - - declare export type BottomTabOptions = $Partial<{| - +title: string, - +tabBarLabel: - | string - | ({| focused: boolean, color: string |}) => React$Node, - +tabBarIcon: ({| - focused: boolean, - color: string, - size: number, - |}) => React$Node, - +tabBarBadge: number | string, - +tabBarBadgeStyle: TextStyleProp, - +tabBarAccessibilityLabel: string, - +tabBarTestID: string, - +tabBarVisible: boolean, - +tabBarVisibilityAnimationConfig: $Partial<{| - +show: TabBarVisibilityAnimationConfig, - +hide: TabBarVisibilityAnimationConfig, - |}>, - +tabBarButton: BottomTabBarButtonProps => React$Node, - +unmountOnBlur: boolean, - |}>; - - /** - * Bottom tab navigation prop - */ - - declare export type BottomTabNavigationEventMap = {| - ...EventMapCore, - +tabPress: {| +data: void, +canPreventDefault: true |}, - +tabLongPress: {| +data: void, +canPreventDefault: false |}, - |}; - - declare type InexactTabNavigationProp< - ParamList: ParamListBase, - RouteName: $Keys, - Options: {...}, - EventMap: EventMapBase, - > = { - ...$Exact>, - +jumpTo: SimpleNavigate, - ... - }; - - declare export type InexactBottomTabNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = BottomTabOptions, - EventMap: EventMapBase = BottomTabNavigationEventMap, - > = InexactTabNavigationProp< - ParamList, - RouteName, - Options, - EventMap, - >; - - declare export type BottomTabNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = BottomTabOptions, - EventMap: EventMapBase = BottomTabNavigationEventMap, - > = $Exact>; - - /** - * Miscellaneous bottom tab exports - */ - - declare export type BottomTabDescriptor = Descriptor< - BottomTabNavigationProp<>, - BottomTabOptions, - >; - - declare export type BottomTabBarOptions = $Partial<{| - +keyboardHidesTabBar: boolean, - +activeTintColor: string, - +inactiveTintColor: string, - +activeBackgroundColor: string, - +inactiveBackgroundColor: string, - +allowFontScaling: boolean, - +showLabel: boolean, - +showIcon: boolean, - +labelStyle: TextStyleProp, - +iconStyle: TextStyleProp, - +tabStyle: ViewStyleProp, - +labelPosition: 'beside-icon' | 'below-icon', - +adaptive: boolean, - +safeAreaInsets: $Partial, - +style: ViewStyleProp, - |}>; - - declare type BottomTabNavigationBuilderResult = {| - +state: TabNavigationState, - +navigation: BottomTabNavigationProp<>, - +descriptors: {| +[key: string]: BottomTabDescriptor |}, - |}; - - declare export type BottomTabBarProps = {| - ...BottomTabBarOptions, - ...BottomTabNavigationBuilderResult, - |} - - declare type BottomTabNavigationConfig = {| - +lazy?: boolean, - +tabBar?: BottomTabBarProps => React$Node, - +tabBarOptions?: BottomTabBarOptions, - +detachInactiveScreens?: boolean, - |}; - - declare export type ExtraBottomTabNavigatorProps = {| - ...$Exact, - ...TabRouterOptions, - ...BottomTabNavigationConfig, - |}; - - declare export type BottomTabNavigatorProps< - NavProp: InexactBottomTabNavigationProp<> = BottomTabNavigationProp<>, - > = {| - ...ExtraBottomTabNavigatorProps, - ...ScreenOptionsProp, - |}; - - /** - * Material bottom tab options - */ - - declare export type MaterialBottomTabOptions = $Partial<{| - +title: string, - +tabBarColor: string, - +tabBarLabel: string, - +tabBarIcon: - | string - | ({| +focused: boolean, +color: string |}) => React$Node, - +tabBarBadge: boolean | number | string, - +tabBarAccessibilityLabel: string, - +tabBarTestID: string, - |}>; - - /** - * Material bottom tab navigation prop - */ - - declare export type MaterialBottomTabNavigationEventMap = {| - ...EventMapCore, - +tabPress: {| +data: void, +canPreventDefault: true |}, - |}; - - declare export type InexactMaterialBottomTabNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = MaterialBottomTabOptions, - EventMap: EventMapBase = MaterialBottomTabNavigationEventMap, - > = InexactTabNavigationProp< - ParamList, - RouteName, - Options, - EventMap, - >; - - declare export type MaterialBottomTabNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = MaterialBottomTabOptions, - EventMap: EventMapBase = MaterialBottomTabNavigationEventMap, - > = $Exact>; - - /** - * Miscellaneous material bottom tab exports - */ - - declare export type PaperFont = {| - +fontFamily: string, - +fontWeight?: - | 'normal' - | 'bold' - | '100' - | '200' - | '300' - | '400' - | '500' - | '600' - | '700' - | '800' - | '900', - |}; - - declare export type PaperFonts = {| - +regular: Font, - +medium: Font, - +light: Font, - +thin: Font, - |}; - - declare export type PaperTheme = {| - +dark: boolean, - +mode?: 'adaptive' | 'exact', - +roundness: number, - +colors: {| - +primary: string, - +background: string, - +surface: string, - +accent: string, - +error: string, - +text: string, - +onSurface: string, - +onBackground: string, - +disabled: string, - +placeholder: string, - +backdrop: string, - +notification: string, - |}, - +fonts: PaperFonts, - +animation: {| - +scale: number, - |}, - |}; - - declare export type PaperRoute = {| - +key: string, - +title?: string, - +icon?: any, - +badge?: string | number | boolean, - +color?: string, - +accessibilityLabel?: string, - +testID?: string, - |}; - - declare export type PaperTouchableProps = {| - ...TouchableWithoutFeedbackProps, - +key: string, - +route: PaperRoute, - +children: React$Node, - +borderless?: boolean, - +centered?: boolean, - +rippleColor?: string, - |}; - - declare export type MaterialBottomTabNavigationConfig = {| - +shifting?: boolean, - +labeled?: boolean, - +renderTouchable?: PaperTouchableProps => React$Node, - +activeColor?: string, - +inactiveColor?: string, - +sceneAnimationEnabled?: boolean, - +keyboardHidesNavigationBar?: boolean, - +barStyle?: ViewStyleProp, - +style?: ViewStyleProp, - +theme?: PaperTheme, - |}; - - declare export type ExtraMaterialBottomTabNavigatorProps = {| - ...$Exact, - ...TabRouterOptions, - ...MaterialBottomTabNavigationConfig, - |}; - - declare export type MaterialBottomTabNavigatorProps< - NavProp: InexactMaterialBottomTabNavigationProp<> = - MaterialBottomTabNavigationProp<>, - > = {| - ...ExtraMaterialBottomTabNavigatorProps, - ...ScreenOptionsProp, - |}; - - /** - * Material top tab options - */ - - declare export type MaterialTopTabOptions = $Partial<{| - +title: string, - +tabBarLabel: - | string - | ({| +focused: boolean, +color: string |}) => React$Node, - +tabBarIcon: ({| +focused: boolean, +color: string |}) => React$Node, - +tabBarAccessibilityLabel: string, - +tabBarTestID: string, - |}>; - - /** - * Material top tab navigation prop - */ - - declare export type MaterialTopTabNavigationEventMap = {| - ...EventMapCore, - +tabPress: {| +data: void, +canPreventDefault: true |}, - +tabLongPress: {| +data: void, +canPreventDefault: false |}, - +swipeStart: {| +data: void, +canPreventDefault: false |}, - +swipeEnd: {| +data: void, +canPreventDefault: false |}, - |}; - - declare export type InexactMaterialTopTabNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = MaterialTopTabOptions, - EventMap: EventMapBase = MaterialTopTabNavigationEventMap, - > = InexactTabNavigationProp< - ParamList, - RouteName, - Options, - EventMap, - >; - - declare export type MaterialTopTabNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = MaterialTopTabOptions, - EventMap: EventMapBase = MaterialTopTabNavigationEventMap, - > = $Exact>; - - /** - * Miscellaneous material top tab exports - */ - - declare type MaterialTopTabPagerCommonProps = {| - +keyboardDismissMode: 'none' | 'on-drag' | 'auto', - +swipeEnabled: boolean, - +swipeVelocityImpact?: number, - +springVelocityScale?: number, - +springConfig: $Partial<{| - +damping: number, - +mass: number, - +stiffness: number, - +restSpeedThreshold: number, - +restDisplacementThreshold: number, - |}>, - +timingConfig: $Partial<{| - +duration: number, - |}>, - |}; - - declare export type MaterialTopTabPagerProps = {| - ...MaterialTopTabPagerCommonProps, - +onSwipeStart?: () => void, - +onSwipeEnd?: () => void, - +onIndexChange: (index: number) => void, - +navigationState: TabNavigationState, - +layout: {| +width: number, +height: number |}, - +removeClippedSubviews: boolean, - +children: ({| - +addListener: (type: 'enter', listener: number => void) => void, - +removeListener: (type: 'enter', listener: number => void) => void, - +position: any, // Reanimated.Node - +render: React$Node => React$Node, - +jumpTo: string => void, - |}) => React$Node, - +gestureHandlerProps: PanGestureHandlerProps, - |}; - - declare export type MaterialTopTabBarIndicatorProps = {| - +navigationState: TabNavigationState, - +width: string, - +style?: ViewStyleProp, - +getTabWidth: number => number, - |}; - - declare export type MaterialTopTabBarOptions = $Partial<{| - +scrollEnabled: boolean, - +bounces: boolean, - +pressColor: string, - +pressOpacity: number, - +getAccessible: ({| +route: Route<> |}) => boolean, - +renderBadge: ({| +route: Route<> |}) => React$Node, - +renderIndicator: MaterialTopTabBarIndicatorProps => React$Node, - +tabStyle: ViewStyleProp, - +indicatorStyle: ViewStyleProp, - +indicatorContainerStyle: ViewStyleProp, - +labelStyle: TextStyleProp, - +contentContainerStyle: ViewStyleProp, - +style: ViewStyleProp, - +activeTintColor: string, - +inactiveTintColor: string, - +iconStyle: ViewStyleProp, - +labelStyle: TextStyleProp, - +showLabel: boolean, - +showIcon: boolean, - +allowFontScaling: boolean, - |}>; - - declare export type MaterialTopTabDescriptor = Descriptor< - MaterialBottomTabNavigationProp<>, - MaterialBottomTabOptions, - >; - - declare type MaterialTopTabNavigationBuilderResult = {| - +state: TabNavigationState, - +navigation: MaterialTopTabNavigationProp<>, - +descriptors: {| +[key: string]: MaterialTopTabDescriptor |}, - |}; - - declare export type MaterialTopTabBarProps = {| - ...MaterialTopTabBarOptions, - ...MaterialTopTabNavigationBuilderResult, - +layout: {| +width: number, +height: number |}, - +position: any, // Reanimated.Node - +jumpTo: string => void, - |}; - - declare export type MaterialTopTabNavigationConfig = {| - ...$Partial, - +position?: any, // Reanimated.Value - +tabBarPosition?: 'top' | 'bottom', - +initialLayout?: $Partial<{| +width: number, +height: number |}>, - +lazy?: boolean, - +lazyPreloadDistance?: number, - +removeClippedSubviews?: boolean, - +sceneContainerStyle?: ViewStyleProp, - +style?: ViewStyleProp, - +gestureHandlerProps?: PanGestureHandlerProps, - +pager?: MaterialTopTabPagerProps => React$Node, - +lazyPlaceholder?: ({| +route: Route<> |}) => React$Node, - +tabBar?: MaterialTopTabBarProps => React$Node, - +tabBarOptions?: MaterialTopTabBarOptions, - |}; - - declare export type ExtraMaterialTopTabNavigatorProps = {| - ...$Exact, - ...TabRouterOptions, - ...MaterialTopTabNavigationConfig, - |}; - - declare export type MaterialTopTabNavigatorProps< - NavProp: InexactMaterialTopTabNavigationProp<> = - MaterialTopTabNavigationProp<>, - > = {| - ...ExtraMaterialTopTabNavigatorProps, - ...ScreenOptionsProp, - |}; - - /** - * Drawer options - */ - - declare export type DrawerOptions = $Partial<{| - title: string, - drawerLabel: - | string - | ({| +color: string, +focused: boolean |}) => React$Node, - drawerIcon: ({| - +color: string, - +size: number, - +focused: boolean, - |}) => React$Node, - gestureEnabled: boolean, - swipeEnabled: boolean, - unmountOnBlur: boolean, - |}>; - - /** - * Drawer navigation prop - */ - - declare export type DrawerNavigationEventMap = {| - ...EventMapCore, - +drawerOpen: {| +data: void, +canPreventDefault: false |}, - +drawerClose: {| +data: void, +canPreventDefault: false |}, - |}; - - declare export type InexactDrawerNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = DrawerOptions, - EventMap: EventMapBase = DrawerNavigationEventMap, - > = { - ...$Exact>, - +jumpTo: SimpleNavigate, - +openDrawer: () => void, - +closeDrawer: () => void, - +toggleDrawer: () => void, - ... - }; - - declare export type DrawerNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = DrawerOptions, - EventMap: EventMapBase = DrawerNavigationEventMap, - > = $Exact>; - - /** - * Miscellaneous drawer exports - */ - - declare export type DrawerDescriptor = Descriptor< - DrawerNavigationProp<>, - DrawerOptions, - >; - - declare export type DrawerItemListBaseOptions = $Partial<{| - +activeTintColor: string, - +activeBackgroundColor: string, - +inactiveTintColor: string, - +inactiveBackgroundColor: string, - +itemStyle: ViewStyleProp, - +labelStyle: TextStyleProp, - |}>; - - declare export type DrawerContentOptions = $Partial<{| - ...DrawerItemListBaseOptions, - +contentContainerStyle: ViewStyleProp, - +style: ViewStyleProp, - |}>; - - declare type DrawerNavigationBuilderResult = {| - +state: DrawerNavigationState, - +navigation: DrawerNavigationProp<>, - +descriptors: {| +[key: string]: DrawerDescriptor |}, - |}; - - declare export type DrawerContentProps = {| - ...DrawerContentOptions, - ...DrawerNavigationBuilderResult, - +progress: any, // Reanimated.Node - |}; - - declare export type DrawerNavigationConfig = {| - +drawerPosition?: 'left' | 'right', - +drawerType?: 'front' | 'back' | 'slide' | 'permanent', - +edgeWidth?: number, - +hideStatusBar?: boolean, - +keyboardDismissMode?: 'on-drag' | 'none', - +minSwipeDistance?: number, - +overlayColor?: string, - +statusBarAnimation?: 'slide' | 'none' | 'fade', - +gestureHandlerProps?: PanGestureHandlerProps, - +lazy?: boolean, - +drawerContent?: DrawerContentProps => React$Node, - +drawerContentOptions?: DrawerContentOptions, - +sceneContainerStyle?: ViewStyleProp, - +drawerStyle?: ViewStyleProp, - +detachInactiveScreens?: boolean, - |}; - - declare export type ExtraDrawerNavigatorProps = {| - ...$Exact, - ...DrawerRouterOptions, - ...DrawerNavigationConfig, - |}; - - declare export type DrawerNavigatorProps< - NavProp: InexactDrawerNavigationProp<> = DrawerNavigationProp<>, - > = {| - ...ExtraDrawerNavigatorProps, - ...ScreenOptionsProp, - |}; - - /** - * BaseNavigationContainer - */ - - declare export type BaseNavigationContainerProps = {| - +children: React$Node, - +initialState?: PossiblyStaleNavigationState, - +onStateChange?: (state: ?PossiblyStaleNavigationState) => void, - +independent?: boolean, - |}; - - declare export type ContainerEventMap = {| - ...GlobalEventMap, - +options: {| - +data: {| +options: { +[key: string]: mixed, ... } |}, - +canPreventDefault: false, - |}, - +__unsafe_action__: {| - +data: {| - +action: GenericNavigationAction, - +noop: boolean, - |}, - +canPreventDefault: false, - |}, - |}; - - declare export type BaseNavigationContainerInterface = {| - ...$Exact>, - +setParams: (params: ScreenParams) => void, - +resetRoot: (state?: ?PossiblyStaleNavigationState) => void, - +getRootState: () => PossiblyStaleNavigationState, - |}; - - /** - * State utils - */ - - declare export type GetStateFromPath = ( - path: string, - options?: LinkingConfig, - ) => PossiblyStaleNavigationState; - - declare export type GetPathFromState = ( - state?: ?PossiblyStaleNavigationState, - options?: LinkingConfig, - ) => string; - - declare export type GetFocusedRouteNameFromRoute = - PossiblyStaleRoute => ?string; - - /** - * Linking - */ - - declare export type ScreenLinkingConfig = {| - +path?: string, - +exact?: boolean, - +parse?: {| +[param: string]: string => mixed |}, - +stringify?: {| +[param: string]: mixed => string |}, - +screens?: ScreenLinkingConfigMap, - +initialRouteName?: string, - |}; - - declare export type ScreenLinkingConfigMap = {| - +[routeName: string]: string | ScreenLinkingConfig, - |}; - - declare export type LinkingConfig = {| - +initialRouteName?: string, - +screens: ScreenLinkingConfigMap, - |}; - - declare export type LinkingOptions = {| - +enabled?: boolean, - +prefixes: $ReadOnlyArray, - +config?: LinkingConfig, - +getStateFromPath?: GetStateFromPath, - +getPathFromState?: GetPathFromState, - |}; - - /** - * NavigationContainer - */ - - declare export type Theme = {| - +dark: boolean, - +colors: {| - +primary: string, - +background: string, - +card: string, - +text: string, - +border: string, - |}, - |}; - - declare export type NavigationContainerType = React$AbstractComponent< - {| - ...BaseNavigationContainerProps, - +theme?: Theme, - +linking?: LinkingOptions, - +fallback?: React$Node, - +onReady?: () => mixed, - |}, - BaseNavigationContainerInterface, - >; - - //--------------------------------------------------------------------------- - // SECTION 2: EXPORTED MODULE - // This section defines the module exports and contains exported types that - // are not present in any other React Navigation libdef. - //--------------------------------------------------------------------------- - - /** - * createMaterialTopTabNavigator - */ - - declare export var createMaterialTopTabNavigator: CreateNavigator< - TabNavigationState, - MaterialTopTabOptions, - MaterialTopTabNavigationEventMap, - ExtraMaterialTopTabNavigatorProps, - >; - - /** - * MaterialTopTabView - */ - - declare export type MaterialTopTabViewProps = {| - ...MaterialTopTabNavigationConfig, - ...MaterialTopTabNavigationBuilderResult, - |}; - declare export var MaterialTopTabView: React$ComponentType< - MaterialTopTabViewProps, - >; - - /** - * MaterialTopTabBar - */ - - declare export var MaterialTopTabBar: React$ComponentType< - MaterialTopTabBarProps, - >; - -} diff --git a/flow-typed/npm/@react-navigation/native_v5.x.x.js b/flow-typed/npm/@react-navigation/native_v5.x.x.js deleted file mode 100644 index ff5e87790a..0000000000 --- a/flow-typed/npm/@react-navigation/native_v5.x.x.js +++ /dev/null @@ -1,2215 +0,0 @@ -// flow-typed signature: b2255225d40384acddcae0e4503bf084 -// flow-typed version: 510a06cce0/@react-navigation/native_v5.x.x/flow_>=v0.104.x - -declare module '@react-navigation/native' { - - //--------------------------------------------------------------------------- - // SECTION 1: IDENTICAL TYPE DEFINITIONS - // This section is identical across all React Navigation libdefs and contains - // shared definitions. We wish we could make it DRY and import from a shared - // definition, but that isn't yet possible. - //--------------------------------------------------------------------------- - - /** - * We start with some definitions that we have copy-pasted from React Native - * source files. - */ - - // This is a bastardization of the true StyleObj type located in - // react-native/Libraries/StyleSheet/StyleSheetTypes. We unfortunately can't - // import that here, and it's too lengthy (and consequently too brittle) to - // copy-paste here either. - declare type StyleObj = - | null - | void - | number - | false - | '' - | $ReadOnlyArray - | { [name: string]: any, ... }; - declare type ViewStyleProp = StyleObj; - declare type TextStyleProp = StyleObj; - declare type AnimatedViewStyleProp = StyleObj; - declare type AnimatedTextStyleProp = StyleObj; - - // Vaguely copied from - // react-native/Libraries/Animated/src/animations/Animation.js - declare type EndResult = { finished: boolean, ... }; - declare type EndCallback = (result: EndResult) => void; - declare interface Animation { - start( - fromValue: number, - onUpdate: (value: number) => void, - onEnd: ?EndCallback, - previousAnimation: ?Animation, - animatedValue: AnimatedValue, - ): void; - stop(): void; - } - declare type AnimationConfig = { - isInteraction?: boolean, - useNativeDriver: boolean, - onComplete?: ?EndCallback, - iterations?: number, - ... - }; - - // Vaguely copied from - // react-native/Libraries/Animated/src/nodes/AnimatedTracking.js - declare interface AnimatedTracking { - constructor( - value: AnimatedValue, - parent: any, - animationClass: any, - animationConfig: Object, - callback?: ?EndCallback, - ): void; - update(): void; - } - - // Vaguely copied from - // react-native/Libraries/Animated/src/nodes/AnimatedValue.js - declare type ValueListenerCallback = (state: { value: number, ... }) => void; - declare interface AnimatedValue { - constructor(value: number): void; - setValue(value: number): void; - setOffset(offset: number): void; - flattenOffset(): void; - extractOffset(): void; - addListener(callback: ValueListenerCallback): string; - removeListener(id: string): void; - removeAllListeners(): void; - stopAnimation(callback?: ?(value: number) => void): void; - resetAnimation(callback?: ?(value: number) => void): void; - interpolate(config: InterpolationConfigType): AnimatedInterpolation; - animate(animation: Animation, callback: ?EndCallback): void; - stopTracking(): void; - track(tracking: AnimatedTracking): void; - } - - // Copied from - // react-native/Libraries/Animated/src/animations/TimingAnimation.js - declare type TimingAnimationConfigSingle = AnimationConfig & { - toValue: number | AnimatedValue, - easing?: (value: number) => number, - duration?: number, - delay?: number, - ... - }; - - // Copied from - // react-native/Libraries/Animated/src/animations/SpringAnimation.js - declare type SpringAnimationConfigSingle = AnimationConfig & { - toValue: number | AnimatedValue, - overshootClamping?: boolean, - restDisplacementThreshold?: number, - restSpeedThreshold?: number, - velocity?: number, - bounciness?: number, - speed?: number, - tension?: number, - friction?: number, - stiffness?: number, - damping?: number, - mass?: number, - delay?: number, - ... - }; - - // Copied from react-native/Libraries/Types/CoreEventTypes.js - declare type SyntheticEvent = $ReadOnly<{| - bubbles: ?boolean, - cancelable: ?boolean, - currentTarget: number, - defaultPrevented: ?boolean, - dispatchConfig: $ReadOnly<{| - registrationName: string, - |}>, - eventPhase: ?number, - preventDefault: () => void, - isDefaultPrevented: () => boolean, - stopPropagation: () => void, - isPropagationStopped: () => boolean, - isTrusted: ?boolean, - nativeEvent: T, - persist: () => void, - target: ?number, - timeStamp: number, - type: ?string, - |}>; - declare type Layout = $ReadOnly<{| - x: number, - y: number, - width: number, - height: number, - |}>; - declare type LayoutEvent = SyntheticEvent< - $ReadOnly<{| - layout: Layout, - |}>, - >; - declare type BlurEvent = SyntheticEvent< - $ReadOnly<{| - target: number, - |}>, - >; - declare type FocusEvent = SyntheticEvent< - $ReadOnly<{| - target: number, - |}>, - >; - declare type ResponderSyntheticEvent = $ReadOnly<{| - ...SyntheticEvent, - touchHistory: $ReadOnly<{| - indexOfSingleActiveTouch: number, - mostRecentTimeStamp: number, - numberActiveTouches: number, - touchBank: $ReadOnlyArray< - $ReadOnly<{| - touchActive: boolean, - startPageX: number, - startPageY: number, - startTimeStamp: number, - currentPageX: number, - currentPageY: number, - currentTimeStamp: number, - previousPageX: number, - previousPageY: number, - previousTimeStamp: number, - |}>, - >, - |}>, - |}>; - declare type PressEvent = ResponderSyntheticEvent< - $ReadOnly<{| - changedTouches: $ReadOnlyArray<$PropertyType>, - force: number, - identifier: number, - locationX: number, - locationY: number, - pageX: number, - pageY: number, - target: ?number, - timestamp: number, - touches: $ReadOnlyArray<$PropertyType>, - |}>, - >; - - // Vaguely copied from - // react-native/Libraries/Animated/src/nodes/AnimatedInterpolation.js - declare type ExtrapolateType = 'extend' | 'identity' | 'clamp'; - declare type InterpolationConfigType = { - inputRange: Array, - outputRange: Array | Array, - easing?: (input: number) => number, - extrapolate?: ExtrapolateType, - extrapolateLeft?: ExtrapolateType, - extrapolateRight?: ExtrapolateType, - ... - }; - declare interface AnimatedInterpolation { - interpolate(config: InterpolationConfigType): AnimatedInterpolation; - } - - // Copied from react-native/Libraries/Components/View/ViewAccessibility.js - declare 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'; - declare type AccessibilityActionInfo = $ReadOnly<{ - name: string, - label?: string, - ... - }>; - declare type AccessibilityActionEvent = SyntheticEvent< - $ReadOnly<{actionName: string, ...}>, - >; - declare type AccessibilityState = { - disabled?: boolean, - selected?: boolean, - checked?: ?boolean | 'mixed', - busy?: boolean, - expanded?: boolean, - ... - }; - declare type AccessibilityValue = $ReadOnly<{| - min?: number, - max?: number, - now?: number, - text?: string, - |}>; - - // Copied from - // react-native/Libraries/Components/Touchable/TouchableWithoutFeedback.js - declare type Stringish = string; - declare type EdgeInsetsProp = $ReadOnly<$Partial>; - declare type TouchableWithoutFeedbackProps = $ReadOnly<{| - accessibilityActions?: ?$ReadOnlyArray, - accessibilityElementsHidden?: ?boolean, - accessibilityHint?: ?Stringish, - accessibilityIgnoresInvertColors?: ?boolean, - accessibilityLabel?: ?Stringish, - accessibilityLiveRegion?: ?('none' | 'polite' | 'assertive'), - accessibilityRole?: ?AccessibilityRole, - accessibilityState?: ?AccessibilityState, - accessibilityValue?: ?AccessibilityValue, - accessibilityViewIsModal?: ?boolean, - accessible?: ?boolean, - children?: ?React$Node, - delayLongPress?: ?number, - delayPressIn?: ?number, - delayPressOut?: ?number, - disabled?: ?boolean, - focusable?: ?boolean, - hitSlop?: ?EdgeInsetsProp, - importantForAccessibility?: ?('auto' | 'yes' | 'no' | 'no-hide-descendants'), - nativeID?: ?string, - onAccessibilityAction?: ?(event: AccessibilityActionEvent) => mixed, - onBlur?: ?(event: BlurEvent) => mixed, - onFocus?: ?(event: FocusEvent) => mixed, - onLayout?: ?(event: LayoutEvent) => mixed, - onLongPress?: ?(event: PressEvent) => mixed, - onPress?: ?(event: PressEvent) => mixed, - onPressIn?: ?(event: PressEvent) => mixed, - onPressOut?: ?(event: PressEvent) => mixed, - pressRetentionOffset?: ?EdgeInsetsProp, - rejectResponderTermination?: ?boolean, - testID?: ?string, - touchSoundDisabled?: ?boolean, - |}>; - - // Copied from react-native/Libraries/Image/ImageSource.js - declare type ImageURISource = $ReadOnly<{ - uri?: ?string, - bundle?: ?string, - method?: ?string, - headers?: ?Object, - body?: ?string, - cache?: ?('default' | 'reload' | 'force-cache' | 'only-if-cached'), - width?: ?number, - height?: ?number, - scale?: ?number, - ... - }>; - - /** - * The following is copied from react-native-gesture-handler's libdef - */ - - declare type $EventHandlers = {| - onGestureEvent?: ($Event) => mixed, - onHandlerStateChange?: ($Event) => mixed, - onBegan?: ($Event) => mixed, - onFailed?: ($Event) => mixed, - onCancelled?: ($Event) => mixed, - onActivated?: ($Event) => mixed, - onEnded?: ($Event) => mixed, - |}; - - declare type HitSlop = - | number - | {| - left?: number, - top?: number, - right?: number, - bottom?: number, - vertical?: number, - horizontal?: number, - width?: number, - height?: number, - |} - | {| - width: number, - left: number, - |} - | {| - width: number, - right: number, - |} - | {| - height: number, - top: number, - |} - | {| - height: number, - bottom: number, - |}; - - declare type $GestureHandlerProps< - AdditionalProps: {...}, - ExtraEventsProps: {...} - > = $ReadOnly<{| - ...$Exact, - ...$EventHandlers, - id?: string, - enabled?: boolean, - waitFor?: React$Ref | Array>, - simultaneousHandlers?: React$Ref | Array>, - shouldCancelWhenOutside?: boolean, - minPointers?: number, - hitSlop?: HitSlop, - children?: React$Node, - |}>; - - declare type PanGestureHandlerProps = $GestureHandlerProps< - { - activeOffsetY?: number | [number, number], - activeOffsetX?: number | [number, number], - failOffsetY?: number | [number, number], - failOffsetX?: number | [number, number], - minDist?: number, - minVelocity?: number, - minVelocityX?: number, - minVelocityY?: number, - minPointers?: number, - maxPointers?: number, - avgTouches?: boolean, - ... - }, - { - x: number, - y: number, - absoluteX: number, - absoluteY: number, - translationX: number, - translationY: number, - velocityX: number, - velocityY: number, - ... - } - >; - - /** - * MAGIC - */ - - declare type $If = $Call< - ((true, Then, Else) => Then) & ((false, Then, Else) => Else), - Test, - Then, - Else, - >; - declare type $IsA = $Call< - (Y => true) & (mixed => false), - X, - >; - declare type $IsUndefined = $IsA; - - declare type $Partial = $ReadOnly<$Rest>; - - /** - * Actions, state, etc. - */ - - declare export type ScreenParams = { +[key: string]: mixed, ... }; - - declare export type BackAction = {| - +type: 'GO_BACK', - +source?: string, - +target?: string, - |}; - declare export type NavigateAction = {| - +type: 'NAVIGATE', - +payload: - | {| +key: string, +params?: ScreenParams |} - | {| +name: string, +key?: string, +params?: ScreenParams |}, - +source?: string, - +target?: string, - |}; - declare export type ResetAction = {| - +type: 'RESET', - +payload: StaleNavigationState, - +source?: string, - +target?: string, - |}; - declare export type SetParamsAction = {| - +type: 'SET_PARAMS', - +payload: {| +params?: ScreenParams |}, - +source?: string, - +target?: string, - |}; - declare export type CommonAction = - | BackAction - | NavigateAction - | ResetAction - | SetParamsAction; - - declare type NavigateActionCreator = {| - (routeName: string, params?: ScreenParams): NavigateAction, - ( - | {| +key: string, +params?: ScreenParams |} - | {| +name: string, +key?: string, +params?: ScreenParams |}, - ): NavigateAction, - |}; - declare export type CommonActionsType = {| - +navigate: NavigateActionCreator, - +goBack: () => BackAction, - +reset: (state: PossiblyStaleNavigationState) => ResetAction, - +setParams: (params: ScreenParams) => SetParamsAction, - |}; - - declare export type GenericNavigationAction = {| - +type: string, - +payload?: { +[key: string]: mixed, ... }, - +source?: string, - +target?: string, - |}; - - declare export type LeafRoute = {| - +key: string, - +name: RouteName, - +params?: ScreenParams, - |}; - declare export type StateRoute = {| - ...LeafRoute, - +state: NavigationState | StaleNavigationState, - |}; - declare export type Route = - | LeafRoute - | StateRoute; - - declare export type NavigationState = {| - +key: string, - +index: number, - +routeNames: $ReadOnlyArray, - +history?: $ReadOnlyArray, - +routes: $ReadOnlyArray>, - +type: string, - +stale: false, - |}; - - declare export type StaleLeafRoute = {| - +key?: string, - +name: RouteName, - +params?: ScreenParams, - |}; - declare export type StaleStateRoute = {| - ...StaleLeafRoute, - +state: StaleNavigationState, - |}; - declare export type StaleRoute = - | StaleLeafRoute - | StaleStateRoute; - declare export type StaleNavigationState = {| - // It's possible to pass React Nav a StaleNavigationState with an undefined - // index, but React Nav will always return one with the index set. This is - // the same as for the type property below, but in the case of index we tend - // to rely on it being set more... - +index: number, - +history?: $ReadOnlyArray, - +routes: $ReadOnlyArray>, - +type?: string, - +stale?: true, - |}; - - declare export type PossiblyStaleNavigationState = - | NavigationState - | StaleNavigationState; - declare export type PossiblyStaleRoute = - | Route - | StaleRoute; - - /** - * Routers - */ - - declare type ActionCreators< - State: NavigationState, - Action: GenericNavigationAction, - > = { - +[key: string]: (...args: any) => (Action | State => Action), - ... - }; - - declare export type DefaultRouterOptions = { - +initialRouteName?: string, - ... - }; - - declare export type RouterFactory< - State: NavigationState, - Action: GenericNavigationAction, - RouterOptions: DefaultRouterOptions, - > = (options: RouterOptions) => Router; - - declare export type ParamListBase = { +[key: string]: ?ScreenParams, ... }; - - declare export type RouterConfigOptions = {| - +routeNames: $ReadOnlyArray, - +routeParamList: ParamListBase, - |}; - - declare export type Router< - State: NavigationState, - Action: GenericNavigationAction, - > = {| - +type: $PropertyType, - +getInitialState: (options: RouterConfigOptions) => State, - +getRehydratedState: ( - partialState: PossibleStaleNavigationState, - options: RouterConfigOptions, - ) => State, - +getStateForRouteNamesChange: ( - state: State, - options: RouterConfigOptions, - ) => State, - +getStateForRouteFocus: (state: State, key: string) => State, - +getStateForAction: ( - state: State, - action: Action, - options: RouterConfigOptions, - ) => ?PossiblyStaleNavigationState; - +shouldActionChangeFocus: (action: GenericNavigationAction) => boolean, - +actionCreators?: ActionCreators, - |}; - - /** - * Stack actions and router - */ - - declare export type StackNavigationState = {| - ...NavigationState, - +type: 'stack', - |}; - - declare export type ReplaceAction = {| - +type: 'REPLACE', - +payload: {| +name: string, +key?: ?string, +params?: ScreenParams |}, - +source?: string, - +target?: string, - |}; - declare export type PushAction = {| - +type: 'PUSH', - +payload: {| +name: string, +key?: ?string, +params?: ScreenParams |}, - +source?: string, - +target?: string, - |}; - declare export type PopAction = {| - +type: 'POP', - +payload: {| +count: number |}, - +source?: string, - +target?: string, - |}; - declare export type PopToTopAction = {| - +type: 'POP_TO_TOP', - +source?: string, - +target?: string, - |}; - declare export type StackAction = - | CommonAction - | ReplaceAction - | PushAction - | PopAction - | PopToTopAction; - - declare export type StackActionsType = {| - +replace: (routeName: string, params?: ScreenParams) => ReplaceAction, - +push: (routeName: string, params?: ScreenParams) => PushAction, - +pop: (count?: number) => PopAction, - +popToTop: () => PopToTopAction, - |}; - - declare export type StackRouterOptions = $Exact; - - /** - * Tab actions and router - */ - - declare export type TabNavigationState = {| - ...NavigationState, - +type: 'tab', - +history: $ReadOnlyArray<{| type: 'route', key: string |}>, - |}; - - declare export type JumpToAction = {| - +type: 'JUMP_TO', - +payload: {| +name: string, +params?: ScreenParams |}, - +source?: string, - +target?: string, - |}; - declare export type TabAction = - | CommonAction - | JumpToAction; - - declare export type TabActionsType = {| - +jumpTo: string => JumpToAction, - |}; - - declare export type TabRouterOptions = {| - ...$Exact, - +backBehavior?: 'initialRoute' | 'order' | 'history' | 'none', - |}; - - /** - * Drawer actions and router - */ - - declare type DrawerHistoryEntry = - | {| +type: 'route', +key: string |} - | {| +type: 'drawer' |}; - declare export type DrawerNavigationState = {| - ...NavigationState, - +type: 'drawer', - +history: $ReadOnlyArray, - |}; - - declare export type OpenDrawerAction = {| - +type: 'OPEN_DRAWER', - +source?: string, - +target?: string, - |}; - declare export type CloseDrawerAction = {| - +type: 'CLOSE_DRAWER', - +source?: string, - +target?: string, - |}; - declare export type ToggleDrawerAction = {| - +type: 'TOGGLE_DRAWER', - +source?: string, - +target?: string, - |}; - declare export type DrawerAction = - | TabAction - | OpenDrawerAction - | CloseDrawerAction - | ToggleDrawerAction; - - declare export type DrawerActionsType = {| - ...TabActionsType, - +openDrawer: () => OpenDrawerAction, - +closeDrawer: () => CloseDrawerAction, - +toggleDrawer: () => ToggleDrawerAction, - |}; - - declare export type DrawerRouterOptions = {| - ...TabRouterOptions, - +openByDefault?: boolean, - |}; - - /** - * Events - */ - - declare export type EventMapBase = { - +[name: string]: {| - +data?: mixed, - +canPreventDefault?: boolean, - |}, - ... - }; - declare type EventPreventDefaultProperties = $If< - Test, - {| +defaultPrevented: boolean, +preventDefault: () => void |}, - {| |}, - >; - declare type EventDataProperties = $If< - $IsUndefined, - {| |}, - {| +data: Data |}, - >; - declare type EventArg< - EventName: string, - CanPreventDefault: ?boolean = false, - Data = void, - > = {| - ...EventPreventDefaultProperties, - ...EventDataProperties, - +type: EventName, - +target?: string, - |}; - declare type GlobalEventMap = {| - +state: {| +data: {| +state: State |}, +canPreventDefault: false |}, - |}; - declare type EventMapCore = {| - ...GlobalEventMap, - +focus: {| +data: void, +canPreventDefault: false |}, - +blur: {| +data: void, +canPreventDefault: false |}, - +beforeRemove: {| - +data: {| +action: GenericNavigationAction |}, - +canPreventDefault: true, - |}, - |}; - declare type EventListenerCallback< - EventName: string, - State: PossiblyStaleNavigationState = NavigationState, - EventMap: EventMapBase = EventMapCore, - > = (e: EventArg< - EventName, - $PropertyType< - $ElementType< - {| ...EventMap, ...EventMapCore |}, - EventName, - >, - 'canPreventDefault', - >, - $PropertyType< - $ElementType< - {| ...EventMap, ...EventMapCore |}, - EventName, - >, - 'data', - >, - >) => mixed; - - /** - * Navigation prop - */ - - declare export type SimpleNavigate = - >( - routeName: DestinationRouteName, - params: $ElementType, - ) => void; - - declare export type Navigate = - & SimpleNavigate - & >( - route: - | {| - key: string, - params?: $ElementType, - |} - | {| - name: DestinationRouteName, - key?: string, - params?: $ElementType, - |}, - ) => void; - - declare type NavigationHelpers< - ParamList: ParamListBase, - State: PossiblyStaleNavigationState = PossiblyStaleNavigationState, - EventMap: EventMapBase = EventMapCore, - > = { - +navigate: Navigate, - +dispatch: ( - action: - | GenericNavigationAction - | (State => GenericNavigationAction), - ) => void, - +reset: PossiblyStaleNavigationState => void, - +goBack: () => void, - +isFocused: () => boolean, - +canGoBack: () => boolean, - +dangerouslyGetParent: >() => ?Parent, - +dangerouslyGetState: () => NavigationState, - +addListener: |}, - >>( - name: EventName, - callback: EventListenerCallback, - ) => () => void, - +removeListener: |}, - >>( - name: EventName, - callback: EventListenerCallback, - ) => void, - ... - }; - - declare export type NavigationProp< - ParamList: ParamListBase, - RouteName: $Keys = $Keys, - State: PossiblyStaleNavigationState = PossiblyStaleNavigationState, - ScreenOptions: {...} = {...}, - EventMap: EventMapBase = EventMapCore, - > = { - ...$Exact>, - +setOptions: (options: $Partial) => void, - +setParams: ( - params: $If< - $IsUndefined<$ElementType>, - empty, - $Partial<$NonMaybeType<$ElementType>>, - >, - ) => void, - ... - }; - - /** - * CreateNavigator - */ - - declare export type RouteProp< - ParamList: ParamListBase, - RouteName: $Keys, - > = {| - ...LeafRoute, - +params: $ElementType, - |}; - - declare export type ScreenListeners< - EventMap: EventMapBase = EventMapCore, - State: NavigationState = NavigationState, - > = $ObjMapi< - {| [name: $Keys]: empty |}, - >(K, empty) => EventListenerCallback, - >; - - declare type BaseScreenProps< - ParamList: ParamListBase, - NavProp, - RouteName: $Keys = $Keys, - State: NavigationState = NavigationState, - ScreenOptions: {...} = {...}, - EventMap: EventMapBase = EventMapCore, - > = {| - +name: RouteName, - +options?: - | ScreenOptions - | ({| - route: RouteProp, - navigation: NavProp, - |}) => ScreenOptions, - +listeners?: - | ScreenListeners - | ({| - route: RouteProp, - navigation: NavProp, - |}) => ScreenListeners, - +initialParams?: $Partial<$ElementType>, - |}; - - declare export type ScreenProps< - ParamList: ParamListBase, - NavProp, - RouteName: $Keys = $Keys, - State: NavigationState = NavigationState, - ScreenOptions: {...} = {...}, - EventMap: EventMapBase = EventMapCore, - > = - | {| - ...BaseScreenProps< - ParamList, - NavProp, - RouteName, - State, - ScreenOptions, - EventMap, - >, - +component: React$ComponentType<{| - route: RouteProp, - navigation: NavProp, - |}>, - |} - | {| - ...BaseScreenProps< - ParamList, - NavProp, - RouteName, - State, - ScreenOptions, - EventMap, - >, - +children: ({| - route: RouteProp, - navigation: NavProp, - |}) => React$Node, - |}; - - declare export type ScreenComponent< - GlobalParamList: ParamListBase, - ParamList: ParamListBase, - State: NavigationState = NavigationState, - ScreenOptions: {...} = {...}, - EventMap: EventMapBase = EventMapCore, - > = < - RouteName: $Keys, - NavProp: NavigationProp< - GlobalParamList, - RouteName, - State, - ScreenOptions, - EventMap, - >, - >(props: ScreenProps< - ParamList, - NavProp, - RouteName, - State, - ScreenOptions, - EventMap, - >) => React$Node; - - declare type ScreenOptionsProp = {| - +screenOptions?: - | ScreenOptions - | ({| route: LeafRoute<>, navigation: NavProp |}) => ScreenOptions, - |}; - declare export type ExtraNavigatorPropsBase = { - ...$Exact, - +children?: React$Node, - ... - }; - declare export type NavigatorPropsBase = { - ...$Exact, - ...ScreenOptionsProp, - ... - }; - - declare export type CreateNavigator< - State: NavigationState, - ScreenOptions: {...}, - EventMap: EventMapBase, - ExtraNavigatorProps: ExtraNavigatorPropsBase, - > = < - GlobalParamList: ParamListBase, - ParamList: ParamListBase, - NavProp: NavigationHelpers< - GlobalParamList, - State, - EventMap, - >, - >() => {| - +Screen: ScreenComponent< - GlobalParamList, - ParamList, - State, - ScreenOptions, - EventMap, - >, - +Navigator: React$ComponentType<{| - ...$Exact, - ...ScreenOptionsProp, - |}>, - |}; - - declare export type CreateNavigatorFactory = < - State: NavigationState, - ScreenOptions: {...}, - EventMap: EventMapBase, - NavProp: NavigationHelpers< - ParamListBase, - State, - EventMap, - >, - ExtraNavigatorProps: ExtraNavigatorPropsBase, - >( - navigator: React$ComponentType<{| - ...$Exact, - ...ScreenOptionsProp, - |}>, - ) => CreateNavigator; - - /** - * useNavigationBuilder - */ - - declare export type Descriptor< - NavProp, - ScreenOptions: {...} = {...}, - > = {| - +render: () => React$Node, - +options: $ReadOnly, - +navigation: NavProp, - |}; - - declare export type UseNavigationBuilder = < - State: NavigationState, - Action: GenericNavigationAction, - ScreenOptions: {...}, - RouterOptions: DefaultRouterOptions, - NavProp, - >( - routerFactory: RouterFactory, - options: {| - ...$Exact, - ...ScreenOptionsProp, - +children?: React$Node, - |}, - ) => {| - +state: State, - +descriptors: {| +[key: string]: Descriptor |}, - +navigation: NavProp, - |}; - - /** - * EdgeInsets - */ - - declare type EdgeInsets = {| - +top: number, - +right: number, - +bottom: number, - +left: number, - |}; - - /** - * TransitionPreset - */ - - declare export type TransitionSpec = - | {| - animation: 'spring', - config: $Diff< - SpringAnimationConfigSingle, - { toValue: number | AnimatedValue, ... }, - >, - |} - | {| - animation: 'timing', - config: $Diff< - TimingAnimationConfigSingle, - { toValue: number | AnimatedValue, ... }, - >, - |}; - - declare export type StackCardInterpolationProps = {| - +current: {| - +progress: AnimatedInterpolation, - |}, - +next?: {| - +progress: AnimatedInterpolation, - |}, - +index: number, - +closing: AnimatedInterpolation, - +swiping: AnimatedInterpolation, - +inverted: AnimatedInterpolation, - +layouts: {| - +screen: {| +width: number, +height: number |}, - |}, - +insets: EdgeInsets, - |}; - declare export type StackCardInterpolatedStyle = {| - containerStyle?: AnimatedViewStyleProp, - cardStyle?: AnimatedViewStyleProp, - overlayStyle?: AnimatedViewStyleProp, - shadowStyle?: AnimatedViewStyleProp, - |}; - declare export type StackCardStyleInterpolator = ( - props: StackCardInterpolationProps, - ) => StackCardInterpolatedStyle; - - declare export type StackHeaderInterpolationProps = {| - +current: {| - +progress: AnimatedInterpolation, - |}, - +next?: {| - +progress: AnimatedInterpolation, - |}, - +layouts: {| - +header: {| +width: number, +height: number |}, - +screen: {| +width: number, +height: number |}, - +title?: {| +width: number, +height: number |}, - +leftLabel?: {| +width: number, +height: number |}, - |}, - |}; - declare export type StackHeaderInterpolatedStyle = {| - leftLabelStyle?: AnimatedViewStyleProp, - leftButtonStyle?: AnimatedViewStyleProp, - rightButtonStyle?: AnimatedViewStyleProp, - titleStyle?: AnimatedViewStyleProp, - backgroundStyle?: AnimatedViewStyleProp, - |}; - declare export type StackHeaderStyleInterpolator = ( - props: StackHeaderInterpolationProps, - ) => StackHeaderInterpolatedStyle; - - declare type GestureDirection = - | 'horizontal' - | 'horizontal-inverted' - | 'vertical' - | 'vertical-inverted'; - - declare export type TransitionPreset = {| - +gestureDirection: GestureDirection, - +transitionSpec: {| - +open: TransitionSpec, - +close: TransitionSpec, - |}, - +cardStyleInterpolator: StackCardStyleInterpolator, - +headerStyleInterpolator: StackHeaderStyleInterpolator, - |}; - - /** - * Stack options - */ - - declare export type StackDescriptor = Descriptor< - StackNavigationProp<>, - StackOptions, - >; - - declare type Scene = {| - +route: T, - +descriptor: StackDescriptor, - +progress: {| - +current: AnimatedInterpolation, - +next?: AnimatedInterpolation, - +previous?: AnimatedInterpolation, - |}, - |}; - - declare export type StackHeaderProps = {| - +mode: 'float' | 'screen', - +layout: {| +width: number, +height: number |}, - +insets: EdgeInsets, - +scene: Scene>, - +previous?: Scene>, - +navigation: StackNavigationProp, - +styleInterpolator: StackHeaderStyleInterpolator, - |}; - - declare export type StackHeaderLeftButtonProps = $Partial<{| - +onPress: (() => void), - +pressColorAndroid: string; - +backImage: (props: {| tintColor: string |}) => React$Node, - +tintColor: string, - +label: string, - +truncatedLabel: string, - +labelVisible: boolean, - +labelStyle: AnimatedTextStyleProp, - +allowFontScaling: boolean, - +onLabelLayout: LayoutEvent => void, - +screenLayout: {| +width: number, +height: number |}, - +titleLayout: {| +width: number, +height: number |}, - +canGoBack: boolean, - |}>; - - declare type StackHeaderTitleInputBase = { - +onLayout: LayoutEvent => void, - +children: string, - +allowFontScaling: ?boolean, - +tintColor: ?string, - +style: ?AnimatedTextStyleProp, - ... - }; - - declare export type StackHeaderTitleInputProps = - $Exact; - - declare export type StackOptions = $Partial<{| - +title: string, - +header: StackHeaderProps => React$Node, - +headerShown: boolean, - +cardShadowEnabled: boolean, - +cardOverlayEnabled: boolean, - +cardOverlay: {| style: ViewStyleProp |} => React$Node, - +cardStyle: ViewStyleProp, - +animationEnabled: boolean, - +animationTypeForReplace: 'push' | 'pop', - +gestureEnabled: boolean, - +gestureResponseDistance: {| vertical?: number, horizontal?: number |}, - +gestureVelocityImpact: number, - +safeAreaInsets: $Partial, - // Transition - ...TransitionPreset, - // Header - +headerTitle: string | (StackHeaderTitleInputProps => React$Node), - +headerTitleAlign: 'left' | 'center', - +headerTitleStyle: AnimatedTextStyleProp, - +headerTitleContainerStyle: ViewStyleProp, - +headerTintColor: string, - +headerTitleAllowFontScaling: boolean, - +headerBackAllowFontScaling: boolean, - +headerBackTitle: string | null, - +headerBackTitleStyle: TextStyleProp, - +headerBackTitleVisible: boolean, - +headerTruncatedBackTitle: string, - +headerLeft: StackHeaderLeftButtonProps => React$Node, - +headerLeftContainerStyle: ViewStyleProp, - +headerRight: {| tintColor?: string |} => React$Node, - +headerRightContainerStyle: ViewStyleProp, - +headerBackImage: $PropertyType, - +headerPressColorAndroid: string, - +headerBackground: ({| style: ViewStyleProp |}) => React$Node, - +headerStyle: ViewStyleProp, - +headerTransparent: boolean, - +headerStatusBarHeight: number, - |}>; - - /** - * Stack navigation prop - */ - - declare export type StackNavigationEventMap = {| - ...EventMapCore, - +transitionStart: {| - +data: {| +closing: boolean |}, - +canPreventDefault: false, - |}, - +transitionEnd: {| - +data: {| +closing: boolean |}, - +canPreventDefault: false, - |}, - +gestureStart: {| +data: void, +canPreventDefault: false |}, - +gestureEnd: {| +data: void, +canPreventDefault: false |}, - +gestureCancel: {| +data: void, +canPreventDefault: false |}, - |}; - - declare type InexactStackNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = StackOptions, - EventMap: EventMapBase = StackNavigationEventMap, - > = { - ...$Exact>, - +replace: SimpleNavigate, - +push: SimpleNavigate, - +pop: (count?: number) => void, - +popToTop: () => void, - ... - }; - - declare export type StackNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = StackOptions, - EventMap: EventMapBase = StackNavigationEventMap, - > = $Exact>; - - /** - * Miscellaneous stack exports - */ - - declare type StackNavigationConfig = {| - +mode?: 'card' | 'modal', - +headerMode?: 'float' | 'screen' | 'none', - +keyboardHandlingEnabled?: boolean, - +detachInactiveScreens?: boolean, - |}; - - declare export type ExtraStackNavigatorProps = {| - ...$Exact, - ...StackRouterOptions, - ...StackNavigationConfig, - |}; - - declare export type StackNavigatorProps< - NavProp: InexactStackNavigationProp<> = StackNavigationProp<>, - > = {| - ...ExtraStackNavigatorProps, - ...ScreenOptionsProp, - |}; - - /** - * Bottom tab options - */ - - declare export type BottomTabBarButtonProps = {| - ...$Diff< - TouchableWithoutFeedbackProps, - {| onPress?: ?(event: PressEvent) => mixed |}, - >, - +to?: string, - +children: React$Node, - +onPress?: (MouseEvent | PressEvent) => void, - |}; - - declare export type TabBarVisibilityAnimationConfig = - | {| - +animation: 'spring', - +config?: $Diff< - SpringAnimationConfigSingle, - { toValue: number | AnimatedValue, useNativeDriver: boolean, ... }, - >, - |} - | {| - +animation: 'timing', - +config?: $Diff< - TimingAnimationConfigSingle, - { toValue: number | AnimatedValue, useNativeDriver: boolean, ... }, - >, - |}; - - declare export type BottomTabOptions = $Partial<{| - +title: string, - +tabBarLabel: - | string - | ({| focused: boolean, color: string |}) => React$Node, - +tabBarIcon: ({| - focused: boolean, - color: string, - size: number, - |}) => React$Node, - +tabBarBadge: number | string, - +tabBarBadgeStyle: TextStyleProp, - +tabBarAccessibilityLabel: string, - +tabBarTestID: string, - +tabBarVisible: boolean, - +tabBarVisibilityAnimationConfig: $Partial<{| - +show: TabBarVisibilityAnimationConfig, - +hide: TabBarVisibilityAnimationConfig, - |}>, - +tabBarButton: BottomTabBarButtonProps => React$Node, - +unmountOnBlur: boolean, - |}>; - - /** - * Bottom tab navigation prop - */ - - declare export type BottomTabNavigationEventMap = {| - ...EventMapCore, - +tabPress: {| +data: void, +canPreventDefault: true |}, - +tabLongPress: {| +data: void, +canPreventDefault: false |}, - |}; - - declare type InexactTabNavigationProp< - ParamList: ParamListBase, - RouteName: $Keys, - Options: {...}, - EventMap: EventMapBase, - > = { - ...$Exact>, - +jumpTo: SimpleNavigate, - ... - }; - - declare export type InexactBottomTabNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = BottomTabOptions, - EventMap: EventMapBase = BottomTabNavigationEventMap, - > = InexactTabNavigationProp< - ParamList, - RouteName, - Options, - EventMap, - >; - - declare export type BottomTabNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = BottomTabOptions, - EventMap: EventMapBase = BottomTabNavigationEventMap, - > = $Exact>; - - /** - * Miscellaneous bottom tab exports - */ - - declare export type BottomTabDescriptor = Descriptor< - BottomTabNavigationProp<>, - BottomTabOptions, - >; - - declare export type BottomTabBarOptions = $Partial<{| - +keyboardHidesTabBar: boolean, - +activeTintColor: string, - +inactiveTintColor: string, - +activeBackgroundColor: string, - +inactiveBackgroundColor: string, - +allowFontScaling: boolean, - +showLabel: boolean, - +showIcon: boolean, - +labelStyle: TextStyleProp, - +iconStyle: TextStyleProp, - +tabStyle: ViewStyleProp, - +labelPosition: 'beside-icon' | 'below-icon', - +adaptive: boolean, - +safeAreaInsets: $Partial, - +style: ViewStyleProp, - |}>; - - declare type BottomTabNavigationBuilderResult = {| - +state: TabNavigationState, - +navigation: BottomTabNavigationProp<>, - +descriptors: {| +[key: string]: BottomTabDescriptor |}, - |}; - - declare export type BottomTabBarProps = {| - ...BottomTabBarOptions, - ...BottomTabNavigationBuilderResult, - |} - - declare type BottomTabNavigationConfig = {| - +lazy?: boolean, - +tabBar?: BottomTabBarProps => React$Node, - +tabBarOptions?: BottomTabBarOptions, - +detachInactiveScreens?: boolean, - |}; - - declare export type ExtraBottomTabNavigatorProps = {| - ...$Exact, - ...TabRouterOptions, - ...BottomTabNavigationConfig, - |}; - - declare export type BottomTabNavigatorProps< - NavProp: InexactBottomTabNavigationProp<> = BottomTabNavigationProp<>, - > = {| - ...ExtraBottomTabNavigatorProps, - ...ScreenOptionsProp, - |}; - - /** - * Material bottom tab options - */ - - declare export type MaterialBottomTabOptions = $Partial<{| - +title: string, - +tabBarColor: string, - +tabBarLabel: string, - +tabBarIcon: - | string - | ({| +focused: boolean, +color: string |}) => React$Node, - +tabBarBadge: boolean | number | string, - +tabBarAccessibilityLabel: string, - +tabBarTestID: string, - |}>; - - /** - * Material bottom tab navigation prop - */ - - declare export type MaterialBottomTabNavigationEventMap = {| - ...EventMapCore, - +tabPress: {| +data: void, +canPreventDefault: true |}, - |}; - - declare export type InexactMaterialBottomTabNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = MaterialBottomTabOptions, - EventMap: EventMapBase = MaterialBottomTabNavigationEventMap, - > = InexactTabNavigationProp< - ParamList, - RouteName, - Options, - EventMap, - >; - - declare export type MaterialBottomTabNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = MaterialBottomTabOptions, - EventMap: EventMapBase = MaterialBottomTabNavigationEventMap, - > = $Exact>; - - /** - * Miscellaneous material bottom tab exports - */ - - declare export type PaperFont = {| - +fontFamily: string, - +fontWeight?: - | 'normal' - | 'bold' - | '100' - | '200' - | '300' - | '400' - | '500' - | '600' - | '700' - | '800' - | '900', - |}; - - declare export type PaperFonts = {| - +regular: Font, - +medium: Font, - +light: Font, - +thin: Font, - |}; - - declare export type PaperTheme = {| - +dark: boolean, - +mode?: 'adaptive' | 'exact', - +roundness: number, - +colors: {| - +primary: string, - +background: string, - +surface: string, - +accent: string, - +error: string, - +text: string, - +onSurface: string, - +onBackground: string, - +disabled: string, - +placeholder: string, - +backdrop: string, - +notification: string, - |}, - +fonts: PaperFonts, - +animation: {| - +scale: number, - |}, - |}; - - declare export type PaperRoute = {| - +key: string, - +title?: string, - +icon?: any, - +badge?: string | number | boolean, - +color?: string, - +accessibilityLabel?: string, - +testID?: string, - |}; - - declare export type PaperTouchableProps = {| - ...TouchableWithoutFeedbackProps, - +key: string, - +route: PaperRoute, - +children: React$Node, - +borderless?: boolean, - +centered?: boolean, - +rippleColor?: string, - |}; - - declare export type MaterialBottomTabNavigationConfig = {| - +shifting?: boolean, - +labeled?: boolean, - +renderTouchable?: PaperTouchableProps => React$Node, - +activeColor?: string, - +inactiveColor?: string, - +sceneAnimationEnabled?: boolean, - +keyboardHidesNavigationBar?: boolean, - +barStyle?: ViewStyleProp, - +style?: ViewStyleProp, - +theme?: PaperTheme, - |}; - - declare export type ExtraMaterialBottomTabNavigatorProps = {| - ...$Exact, - ...TabRouterOptions, - ...MaterialBottomTabNavigationConfig, - |}; - - declare export type MaterialBottomTabNavigatorProps< - NavProp: InexactMaterialBottomTabNavigationProp<> = - MaterialBottomTabNavigationProp<>, - > = {| - ...ExtraMaterialBottomTabNavigatorProps, - ...ScreenOptionsProp, - |}; - - /** - * Material top tab options - */ - - declare export type MaterialTopTabOptions = $Partial<{| - +title: string, - +tabBarLabel: - | string - | ({| +focused: boolean, +color: string |}) => React$Node, - +tabBarIcon: ({| +focused: boolean, +color: string |}) => React$Node, - +tabBarAccessibilityLabel: string, - +tabBarTestID: string, - |}>; - - /** - * Material top tab navigation prop - */ - - declare export type MaterialTopTabNavigationEventMap = {| - ...EventMapCore, - +tabPress: {| +data: void, +canPreventDefault: true |}, - +tabLongPress: {| +data: void, +canPreventDefault: false |}, - +swipeStart: {| +data: void, +canPreventDefault: false |}, - +swipeEnd: {| +data: void, +canPreventDefault: false |}, - |}; - - declare export type InexactMaterialTopTabNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = MaterialTopTabOptions, - EventMap: EventMapBase = MaterialTopTabNavigationEventMap, - > = InexactTabNavigationProp< - ParamList, - RouteName, - Options, - EventMap, - >; - - declare export type MaterialTopTabNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = MaterialTopTabOptions, - EventMap: EventMapBase = MaterialTopTabNavigationEventMap, - > = $Exact>; - - /** - * Miscellaneous material top tab exports - */ - - declare type MaterialTopTabPagerCommonProps = {| - +keyboardDismissMode: 'none' | 'on-drag' | 'auto', - +swipeEnabled: boolean, - +swipeVelocityImpact?: number, - +springVelocityScale?: number, - +springConfig: $Partial<{| - +damping: number, - +mass: number, - +stiffness: number, - +restSpeedThreshold: number, - +restDisplacementThreshold: number, - |}>, - +timingConfig: $Partial<{| - +duration: number, - |}>, - |}; - - declare export type MaterialTopTabPagerProps = {| - ...MaterialTopTabPagerCommonProps, - +onSwipeStart?: () => void, - +onSwipeEnd?: () => void, - +onIndexChange: (index: number) => void, - +navigationState: TabNavigationState, - +layout: {| +width: number, +height: number |}, - +removeClippedSubviews: boolean, - +children: ({| - +addListener: (type: 'enter', listener: number => void) => void, - +removeListener: (type: 'enter', listener: number => void) => void, - +position: any, // Reanimated.Node - +render: React$Node => React$Node, - +jumpTo: string => void, - |}) => React$Node, - +gestureHandlerProps: PanGestureHandlerProps, - |}; - - declare export type MaterialTopTabBarIndicatorProps = {| - +navigationState: TabNavigationState, - +width: string, - +style?: ViewStyleProp, - +getTabWidth: number => number, - |}; - - declare export type MaterialTopTabBarOptions = $Partial<{| - +scrollEnabled: boolean, - +bounces: boolean, - +pressColor: string, - +pressOpacity: number, - +getAccessible: ({| +route: Route<> |}) => boolean, - +renderBadge: ({| +route: Route<> |}) => React$Node, - +renderIndicator: MaterialTopTabBarIndicatorProps => React$Node, - +tabStyle: ViewStyleProp, - +indicatorStyle: ViewStyleProp, - +indicatorContainerStyle: ViewStyleProp, - +labelStyle: TextStyleProp, - +contentContainerStyle: ViewStyleProp, - +style: ViewStyleProp, - +activeTintColor: string, - +inactiveTintColor: string, - +iconStyle: ViewStyleProp, - +labelStyle: TextStyleProp, - +showLabel: boolean, - +showIcon: boolean, - +allowFontScaling: boolean, - |}>; - - declare export type MaterialTopTabDescriptor = Descriptor< - MaterialBottomTabNavigationProp<>, - MaterialBottomTabOptions, - >; - - declare type MaterialTopTabNavigationBuilderResult = {| - +state: TabNavigationState, - +navigation: MaterialTopTabNavigationProp<>, - +descriptors: {| +[key: string]: MaterialTopTabDescriptor |}, - |}; - - declare export type MaterialTopTabBarProps = {| - ...MaterialTopTabBarOptions, - ...MaterialTopTabNavigationBuilderResult, - +layout: {| +width: number, +height: number |}, - +position: any, // Reanimated.Node - +jumpTo: string => void, - |}; - - declare export type MaterialTopTabNavigationConfig = {| - ...$Partial, - +position?: any, // Reanimated.Value - +tabBarPosition?: 'top' | 'bottom', - +initialLayout?: $Partial<{| +width: number, +height: number |}>, - +lazy?: boolean, - +lazyPreloadDistance?: number, - +removeClippedSubviews?: boolean, - +sceneContainerStyle?: ViewStyleProp, - +style?: ViewStyleProp, - +gestureHandlerProps?: PanGestureHandlerProps, - +pager?: MaterialTopTabPagerProps => React$Node, - +lazyPlaceholder?: ({| +route: Route<> |}) => React$Node, - +tabBar?: MaterialTopTabBarProps => React$Node, - +tabBarOptions?: MaterialTopTabBarOptions, - |}; - - declare export type ExtraMaterialTopTabNavigatorProps = {| - ...$Exact, - ...TabRouterOptions, - ...MaterialTopTabNavigationConfig, - |}; - - declare export type MaterialTopTabNavigatorProps< - NavProp: InexactMaterialTopTabNavigationProp<> = - MaterialTopTabNavigationProp<>, - > = {| - ...ExtraMaterialTopTabNavigatorProps, - ...ScreenOptionsProp, - |}; - - /** - * Drawer options - */ - - declare export type DrawerOptions = $Partial<{| - title: string, - drawerLabel: - | string - | ({| +color: string, +focused: boolean |}) => React$Node, - drawerIcon: ({| - +color: string, - +size: number, - +focused: boolean, - |}) => React$Node, - gestureEnabled: boolean, - swipeEnabled: boolean, - unmountOnBlur: boolean, - |}>; - - /** - * Drawer navigation prop - */ - - declare export type DrawerNavigationEventMap = {| - ...EventMapCore, - +drawerOpen: {| +data: void, +canPreventDefault: false |}, - +drawerClose: {| +data: void, +canPreventDefault: false |}, - |}; - - declare export type InexactDrawerNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = DrawerOptions, - EventMap: EventMapBase = DrawerNavigationEventMap, - > = { - ...$Exact>, - +jumpTo: SimpleNavigate, - +openDrawer: () => void, - +closeDrawer: () => void, - +toggleDrawer: () => void, - ... - }; - - declare export type DrawerNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = DrawerOptions, - EventMap: EventMapBase = DrawerNavigationEventMap, - > = $Exact>; - - /** - * Miscellaneous drawer exports - */ - - declare export type DrawerDescriptor = Descriptor< - DrawerNavigationProp<>, - DrawerOptions, - >; - - declare export type DrawerItemListBaseOptions = $Partial<{| - +activeTintColor: string, - +activeBackgroundColor: string, - +inactiveTintColor: string, - +inactiveBackgroundColor: string, - +itemStyle: ViewStyleProp, - +labelStyle: TextStyleProp, - |}>; - - declare export type DrawerContentOptions = $Partial<{| - ...DrawerItemListBaseOptions, - +contentContainerStyle: ViewStyleProp, - +style: ViewStyleProp, - |}>; - - declare type DrawerNavigationBuilderResult = {| - +state: DrawerNavigationState, - +navigation: DrawerNavigationProp<>, - +descriptors: {| +[key: string]: DrawerDescriptor |}, - |}; - - declare export type DrawerContentProps = {| - ...DrawerContentOptions, - ...DrawerNavigationBuilderResult, - +progress: any, // Reanimated.Node - |}; - - declare export type DrawerNavigationConfig = {| - +drawerPosition?: 'left' | 'right', - +drawerType?: 'front' | 'back' | 'slide' | 'permanent', - +edgeWidth?: number, - +hideStatusBar?: boolean, - +keyboardDismissMode?: 'on-drag' | 'none', - +minSwipeDistance?: number, - +overlayColor?: string, - +statusBarAnimation?: 'slide' | 'none' | 'fade', - +gestureHandlerProps?: PanGestureHandlerProps, - +lazy?: boolean, - +drawerContent?: DrawerContentProps => React$Node, - +drawerContentOptions?: DrawerContentOptions, - +sceneContainerStyle?: ViewStyleProp, - +drawerStyle?: ViewStyleProp, - +detachInactiveScreens?: boolean, - |}; - - declare export type ExtraDrawerNavigatorProps = {| - ...$Exact, - ...DrawerRouterOptions, - ...DrawerNavigationConfig, - |}; - - declare export type DrawerNavigatorProps< - NavProp: InexactDrawerNavigationProp<> = DrawerNavigationProp<>, - > = {| - ...ExtraDrawerNavigatorProps, - ...ScreenOptionsProp, - |}; - - /** - * BaseNavigationContainer - */ - - declare export type BaseNavigationContainerProps = {| - +children: React$Node, - +initialState?: PossiblyStaleNavigationState, - +onStateChange?: (state: ?PossiblyStaleNavigationState) => void, - +independent?: boolean, - |}; - - declare export type ContainerEventMap = {| - ...GlobalEventMap, - +options: {| - +data: {| +options: { +[key: string]: mixed, ... } |}, - +canPreventDefault: false, - |}, - +__unsafe_action__: {| - +data: {| - +action: GenericNavigationAction, - +noop: boolean, - |}, - +canPreventDefault: false, - |}, - |}; - - declare export type BaseNavigationContainerInterface = {| - ...$Exact>, - +setParams: (params: ScreenParams) => void, - +resetRoot: (state?: ?PossiblyStaleNavigationState) => void, - +getRootState: () => PossiblyStaleNavigationState, - |}; - - /** - * State utils - */ - - declare export type GetStateFromPath = ( - path: string, - options?: LinkingConfig, - ) => PossiblyStaleNavigationState; - - declare export type GetPathFromState = ( - state?: ?PossiblyStaleNavigationState, - options?: LinkingConfig, - ) => string; - - declare export type GetFocusedRouteNameFromRoute = - PossiblyStaleRoute => ?string; - - /** - * Linking - */ - - declare export type ScreenLinkingConfig = {| - +path?: string, - +exact?: boolean, - +parse?: {| +[param: string]: string => mixed |}, - +stringify?: {| +[param: string]: mixed => string |}, - +screens?: ScreenLinkingConfigMap, - +initialRouteName?: string, - |}; - - declare export type ScreenLinkingConfigMap = {| - +[routeName: string]: string | ScreenLinkingConfig, - |}; - - declare export type LinkingConfig = {| - +initialRouteName?: string, - +screens: ScreenLinkingConfigMap, - |}; - - declare export type LinkingOptions = {| - +enabled?: boolean, - +prefixes: $ReadOnlyArray, - +config?: LinkingConfig, - +getStateFromPath?: GetStateFromPath, - +getPathFromState?: GetPathFromState, - |}; - - /** - * NavigationContainer - */ - - declare export type Theme = {| - +dark: boolean, - +colors: {| - +primary: string, - +background: string, - +card: string, - +text: string, - +border: string, - |}, - |}; - - declare export type NavigationContainerType = React$AbstractComponent< - {| - ...BaseNavigationContainerProps, - +theme?: Theme, - +linking?: LinkingOptions, - +fallback?: React$Node, - +onReady?: () => mixed, - |}, - BaseNavigationContainerInterface, - >; - - //--------------------------------------------------------------------------- - // SECTION 2: EXPORTED MODULE - // This section defines the module exports and contains exported types that - // are not present in any other React Navigation libdef. - //--------------------------------------------------------------------------- - - /** - * Actions and routers - */ - - declare export var CommonActions: CommonActionsType; - declare export var StackActions: StackActionsType; - declare export var TabActions: TabActionsType; - declare export var DrawerActions: DrawerActionsType; - - declare export var BaseRouter: RouterFactory< - NavigationState, - CommonAction, - DefaultRouterOptions, - >; - declare export var StackRouter: RouterFactory< - StackNavigationState, - StackAction, - StackRouterOptions, - >; - declare export var TabRouter: RouterFactory< - TabNavigationState, - TabAction, - TabRouterOptions, - >; - declare export var DrawerRouter: RouterFactory< - DrawerNavigationState, - DrawerAction, - DrawerRouterOptions, - >; - - /** - * Navigator utils - */ - - declare export var BaseNavigationContainer: React$AbstractComponent< - BaseNavigationContainerProps, - BaseNavigationContainerInterface, - >; - - declare export var createNavigatorFactory: CreateNavigatorFactory; - - declare export var useNavigationBuilder: UseNavigationBuilder; - - declare export var NavigationHelpersContext: React$Context< - ?NavigationHelpers, - >; - - /** - * Navigation prop / route accessors - */ - - declare export var NavigationContext: React$Context< - ?NavigationProp, - >; - declare export function useNavigation(): NavigationProp; - - declare export var NavigationRouteContext: React$Context>; - declare export function useRoute(): LeafRoute<>; - - declare export function useNavigationState( - selector: NavigationState => T, - ): T; - - /** - * Focus utils - */ - - declare export function useFocusEffect( - effect: () => ?(() => mixed), - ): void; - declare export function useIsFocused(): boolean; - - /** - * State utils - */ - - declare export var getStateFromPath: GetStateFromPath; - - declare export var getPathFromState: GetPathFromState; - - declare export function getActionFromState( - state: PossiblyStaleNavigationState, - ): ?NavigateAction; - - declare export var getFocusedRouteNameFromRoute: GetFocusedRouteNameFromRoute; - - /** - * useScrollToTop - */ - - declare type ScrollToOptions = { y?: number, animated?: boolean, ... }; - declare type ScrollToOffsetOptions = { - offset: number, - animated?: boolean, - ... - }; - declare type ScrollableView = - | { scrollToTop(): void, ... } - | { scrollTo(options: ScrollToOptions): void, ... } - | { scrollToOffset(options: ScrollToOffsetOptions): void, ... } - | { scrollResponderScrollTo(options: ScrollToOptions): void, ... }; - declare type ScrollableWrapper = - | { getScrollResponder(): React$Node, ... } - | { getNode(): ScrollableView, ... } - | ScrollableView; - declare export function useScrollToTop( - ref: { +current: ?ScrollableWrapper, ... }, - ): void; - - /** - * Themes - */ - - declare export var DefaultTheme: Theme & { +dark: false, ... }; - declare export var DarkTheme: Theme & { +dark: true, ... }; - declare export function useTheme(): Theme; - declare export var ThemeProvider: React$ComponentType<{| - +value: Theme, - +children: React$Node, - |}>; - - /** - * Linking - */ - - declare export var Link: React$ComponentType<{ - +to: string, - +action?: GenericNavigationAction, - +target?: string, - +children: React$Node, - ... - }>; - - declare export function useLinking( - container: { +current: ?React$ElementRef, ... }, - options: LinkingOptions, - ): {| +getInitialState: () => Promise |}; - - declare export function useLinkTo(): (path: string) => void; - - declare export function useLinkProps(props: {| - +to: Top, - +action?: GenericNavigationAction, - |}): {| - +href: To, - +accessibilityRole: 'link', - +onPress: (MouseEvent | PressEvent) => void, - |}; - - declare export function useLinkBuilder(): ( - name: string, - params?: ScreenParams, - ) => ?string; - - /** - * NavigationContainer - */ - - declare export var NavigationContainer: NavigationContainerType; - - /** - * useBackButton - */ - - declare export function useBackButton( - container: { +current: ?React$ElementRef, ... }, - ): void; - -} diff --git a/flow-typed/npm/@react-navigation/stack_v5.x.x.js b/flow-typed/npm/@react-navigation/stack_v5.x.x.js deleted file mode 100644 index 7108f7852d..0000000000 --- a/flow-typed/npm/@react-navigation/stack_v5.x.x.js +++ /dev/null @@ -1,2169 +0,0 @@ -// flow-typed signature: 9e831659b1a7a87cc7ecd433e0cc765e -// flow-typed version: 510a06cce0/@react-navigation/stack_v5.x.x/flow_>=v0.104.x - -declare module '@react-navigation/stack' { - - //--------------------------------------------------------------------------- - // SECTION 1: IDENTICAL TYPE DEFINITIONS - // This section is identical across all React Navigation libdefs and contains - // shared definitions. We wish we could make it DRY and import from a shared - // definition, but that isn't yet possible. - //--------------------------------------------------------------------------- - - /** - * We start with some definitions that we have copy-pasted from React Native - * source files. - */ - - // This is a bastardization of the true StyleObj type located in - // react-native/Libraries/StyleSheet/StyleSheetTypes. We unfortunately can't - // import that here, and it's too lengthy (and consequently too brittle) to - // copy-paste here either. - declare type StyleObj = - | null - | void - | number - | false - | '' - | $ReadOnlyArray - | { [name: string]: any, ... }; - declare type ViewStyleProp = StyleObj; - declare type TextStyleProp = StyleObj; - declare type AnimatedViewStyleProp = StyleObj; - declare type AnimatedTextStyleProp = StyleObj; - - // Vaguely copied from - // react-native/Libraries/Animated/src/animations/Animation.js - declare type EndResult = { finished: boolean, ... }; - declare type EndCallback = (result: EndResult) => void; - declare interface Animation { - start( - fromValue: number, - onUpdate: (value: number) => void, - onEnd: ?EndCallback, - previousAnimation: ?Animation, - animatedValue: AnimatedValue, - ): void; - stop(): void; - } - declare type AnimationConfig = { - isInteraction?: boolean, - useNativeDriver: boolean, - onComplete?: ?EndCallback, - iterations?: number, - ... - }; - - // Vaguely copied from - // react-native/Libraries/Animated/src/nodes/AnimatedTracking.js - declare interface AnimatedTracking { - constructor( - value: AnimatedValue, - parent: any, - animationClass: any, - animationConfig: Object, - callback?: ?EndCallback, - ): void; - update(): void; - } - - // Vaguely copied from - // react-native/Libraries/Animated/src/nodes/AnimatedValue.js - declare type ValueListenerCallback = (state: { value: number, ... }) => void; - declare interface AnimatedValue { - constructor(value: number): void; - setValue(value: number): void; - setOffset(offset: number): void; - flattenOffset(): void; - extractOffset(): void; - addListener(callback: ValueListenerCallback): string; - removeListener(id: string): void; - removeAllListeners(): void; - stopAnimation(callback?: ?(value: number) => void): void; - resetAnimation(callback?: ?(value: number) => void): void; - interpolate(config: InterpolationConfigType): AnimatedInterpolation; - animate(animation: Animation, callback: ?EndCallback): void; - stopTracking(): void; - track(tracking: AnimatedTracking): void; - } - - // Copied from - // react-native/Libraries/Animated/src/animations/TimingAnimation.js - declare type TimingAnimationConfigSingle = AnimationConfig & { - toValue: number | AnimatedValue, - easing?: (value: number) => number, - duration?: number, - delay?: number, - ... - }; - - // Copied from - // react-native/Libraries/Animated/src/animations/SpringAnimation.js - declare type SpringAnimationConfigSingle = AnimationConfig & { - toValue: number | AnimatedValue, - overshootClamping?: boolean, - restDisplacementThreshold?: number, - restSpeedThreshold?: number, - velocity?: number, - bounciness?: number, - speed?: number, - tension?: number, - friction?: number, - stiffness?: number, - damping?: number, - mass?: number, - delay?: number, - ... - }; - - // Copied from react-native/Libraries/Types/CoreEventTypes.js - declare type SyntheticEvent = $ReadOnly<{| - bubbles: ?boolean, - cancelable: ?boolean, - currentTarget: number, - defaultPrevented: ?boolean, - dispatchConfig: $ReadOnly<{| - registrationName: string, - |}>, - eventPhase: ?number, - preventDefault: () => void, - isDefaultPrevented: () => boolean, - stopPropagation: () => void, - isPropagationStopped: () => boolean, - isTrusted: ?boolean, - nativeEvent: T, - persist: () => void, - target: ?number, - timeStamp: number, - type: ?string, - |}>; - declare type Layout = $ReadOnly<{| - x: number, - y: number, - width: number, - height: number, - |}>; - declare type LayoutEvent = SyntheticEvent< - $ReadOnly<{| - layout: Layout, - |}>, - >; - declare type BlurEvent = SyntheticEvent< - $ReadOnly<{| - target: number, - |}>, - >; - declare type FocusEvent = SyntheticEvent< - $ReadOnly<{| - target: number, - |}>, - >; - declare type ResponderSyntheticEvent = $ReadOnly<{| - ...SyntheticEvent, - touchHistory: $ReadOnly<{| - indexOfSingleActiveTouch: number, - mostRecentTimeStamp: number, - numberActiveTouches: number, - touchBank: $ReadOnlyArray< - $ReadOnly<{| - touchActive: boolean, - startPageX: number, - startPageY: number, - startTimeStamp: number, - currentPageX: number, - currentPageY: number, - currentTimeStamp: number, - previousPageX: number, - previousPageY: number, - previousTimeStamp: number, - |}>, - >, - |}>, - |}>; - declare type PressEvent = ResponderSyntheticEvent< - $ReadOnly<{| - changedTouches: $ReadOnlyArray<$PropertyType>, - force: number, - identifier: number, - locationX: number, - locationY: number, - pageX: number, - pageY: number, - target: ?number, - timestamp: number, - touches: $ReadOnlyArray<$PropertyType>, - |}>, - >; - - // Vaguely copied from - // react-native/Libraries/Animated/src/nodes/AnimatedInterpolation.js - declare type ExtrapolateType = 'extend' | 'identity' | 'clamp'; - declare type InterpolationConfigType = { - inputRange: Array, - outputRange: Array | Array, - easing?: (input: number) => number, - extrapolate?: ExtrapolateType, - extrapolateLeft?: ExtrapolateType, - extrapolateRight?: ExtrapolateType, - ... - }; - declare interface AnimatedInterpolation { - interpolate(config: InterpolationConfigType): AnimatedInterpolation; - } - - // Copied from react-native/Libraries/Components/View/ViewAccessibility.js - declare 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'; - declare type AccessibilityActionInfo = $ReadOnly<{ - name: string, - label?: string, - ... - }>; - declare type AccessibilityActionEvent = SyntheticEvent< - $ReadOnly<{actionName: string, ...}>, - >; - declare type AccessibilityState = { - disabled?: boolean, - selected?: boolean, - checked?: ?boolean | 'mixed', - busy?: boolean, - expanded?: boolean, - ... - }; - declare type AccessibilityValue = $ReadOnly<{| - min?: number, - max?: number, - now?: number, - text?: string, - |}>; - - // Copied from - // react-native/Libraries/Components/Touchable/TouchableWithoutFeedback.js - declare type Stringish = string; - declare type EdgeInsetsProp = $ReadOnly<$Partial>; - declare type TouchableWithoutFeedbackProps = $ReadOnly<{| - accessibilityActions?: ?$ReadOnlyArray, - accessibilityElementsHidden?: ?boolean, - accessibilityHint?: ?Stringish, - accessibilityIgnoresInvertColors?: ?boolean, - accessibilityLabel?: ?Stringish, - accessibilityLiveRegion?: ?('none' | 'polite' | 'assertive'), - accessibilityRole?: ?AccessibilityRole, - accessibilityState?: ?AccessibilityState, - accessibilityValue?: ?AccessibilityValue, - accessibilityViewIsModal?: ?boolean, - accessible?: ?boolean, - children?: ?React$Node, - delayLongPress?: ?number, - delayPressIn?: ?number, - delayPressOut?: ?number, - disabled?: ?boolean, - focusable?: ?boolean, - hitSlop?: ?EdgeInsetsProp, - importantForAccessibility?: ?('auto' | 'yes' | 'no' | 'no-hide-descendants'), - nativeID?: ?string, - onAccessibilityAction?: ?(event: AccessibilityActionEvent) => mixed, - onBlur?: ?(event: BlurEvent) => mixed, - onFocus?: ?(event: FocusEvent) => mixed, - onLayout?: ?(event: LayoutEvent) => mixed, - onLongPress?: ?(event: PressEvent) => mixed, - onPress?: ?(event: PressEvent) => mixed, - onPressIn?: ?(event: PressEvent) => mixed, - onPressOut?: ?(event: PressEvent) => mixed, - pressRetentionOffset?: ?EdgeInsetsProp, - rejectResponderTermination?: ?boolean, - testID?: ?string, - touchSoundDisabled?: ?boolean, - |}>; - - // Copied from react-native/Libraries/Image/ImageSource.js - declare type ImageURISource = $ReadOnly<{ - uri?: ?string, - bundle?: ?string, - method?: ?string, - headers?: ?Object, - body?: ?string, - cache?: ?('default' | 'reload' | 'force-cache' | 'only-if-cached'), - width?: ?number, - height?: ?number, - scale?: ?number, - ... - }>; - - /** - * The following is copied from react-native-gesture-handler's libdef - */ - - declare type $EventHandlers = {| - onGestureEvent?: ($Event) => mixed, - onHandlerStateChange?: ($Event) => mixed, - onBegan?: ($Event) => mixed, - onFailed?: ($Event) => mixed, - onCancelled?: ($Event) => mixed, - onActivated?: ($Event) => mixed, - onEnded?: ($Event) => mixed, - |}; - - declare type HitSlop = - | number - | {| - left?: number, - top?: number, - right?: number, - bottom?: number, - vertical?: number, - horizontal?: number, - width?: number, - height?: number, - |} - | {| - width: number, - left: number, - |} - | {| - width: number, - right: number, - |} - | {| - height: number, - top: number, - |} - | {| - height: number, - bottom: number, - |}; - - declare type $GestureHandlerProps< - AdditionalProps: {...}, - ExtraEventsProps: {...} - > = $ReadOnly<{| - ...$Exact, - ...$EventHandlers, - id?: string, - enabled?: boolean, - waitFor?: React$Ref | Array>, - simultaneousHandlers?: React$Ref | Array>, - shouldCancelWhenOutside?: boolean, - minPointers?: number, - hitSlop?: HitSlop, - children?: React$Node, - |}>; - - declare type PanGestureHandlerProps = $GestureHandlerProps< - { - activeOffsetY?: number | [number, number], - activeOffsetX?: number | [number, number], - failOffsetY?: number | [number, number], - failOffsetX?: number | [number, number], - minDist?: number, - minVelocity?: number, - minVelocityX?: number, - minVelocityY?: number, - minPointers?: number, - maxPointers?: number, - avgTouches?: boolean, - ... - }, - { - x: number, - y: number, - absoluteX: number, - absoluteY: number, - translationX: number, - translationY: number, - velocityX: number, - velocityY: number, - ... - } - >; - - /** - * MAGIC - */ - - declare type $If = $Call< - ((true, Then, Else) => Then) & ((false, Then, Else) => Else), - Test, - Then, - Else, - >; - declare type $IsA = $Call< - (Y => true) & (mixed => false), - X, - >; - declare type $IsUndefined = $IsA; - - declare type $Partial = $ReadOnly<$Rest>; - - /** - * Actions, state, etc. - */ - - declare export type ScreenParams = { +[key: string]: mixed, ... }; - - declare export type BackAction = {| - +type: 'GO_BACK', - +source?: string, - +target?: string, - |}; - declare export type NavigateAction = {| - +type: 'NAVIGATE', - +payload: - | {| +key: string, +params?: ScreenParams |} - | {| +name: string, +key?: string, +params?: ScreenParams |}, - +source?: string, - +target?: string, - |}; - declare export type ResetAction = {| - +type: 'RESET', - +payload: StaleNavigationState, - +source?: string, - +target?: string, - |}; - declare export type SetParamsAction = {| - +type: 'SET_PARAMS', - +payload: {| +params?: ScreenParams |}, - +source?: string, - +target?: string, - |}; - declare export type CommonAction = - | BackAction - | NavigateAction - | ResetAction - | SetParamsAction; - - declare type NavigateActionCreator = {| - (routeName: string, params?: ScreenParams): NavigateAction, - ( - | {| +key: string, +params?: ScreenParams |} - | {| +name: string, +key?: string, +params?: ScreenParams |}, - ): NavigateAction, - |}; - declare export type CommonActionsType = {| - +navigate: NavigateActionCreator, - +goBack: () => BackAction, - +reset: (state: PossiblyStaleNavigationState) => ResetAction, - +setParams: (params: ScreenParams) => SetParamsAction, - |}; - - declare export type GenericNavigationAction = {| - +type: string, - +payload?: { +[key: string]: mixed, ... }, - +source?: string, - +target?: string, - |}; - - declare export type LeafRoute = {| - +key: string, - +name: RouteName, - +params?: ScreenParams, - |}; - declare export type StateRoute = {| - ...LeafRoute, - +state: NavigationState | StaleNavigationState, - |}; - declare export type Route = - | LeafRoute - | StateRoute; - - declare export type NavigationState = {| - +key: string, - +index: number, - +routeNames: $ReadOnlyArray, - +history?: $ReadOnlyArray, - +routes: $ReadOnlyArray>, - +type: string, - +stale: false, - |}; - - declare export type StaleLeafRoute = {| - +key?: string, - +name: RouteName, - +params?: ScreenParams, - |}; - declare export type StaleStateRoute = {| - ...StaleLeafRoute, - +state: StaleNavigationState, - |}; - declare export type StaleRoute = - | StaleLeafRoute - | StaleStateRoute; - declare export type StaleNavigationState = {| - // It's possible to pass React Nav a StaleNavigationState with an undefined - // index, but React Nav will always return one with the index set. This is - // the same as for the type property below, but in the case of index we tend - // to rely on it being set more... - +index: number, - +history?: $ReadOnlyArray, - +routes: $ReadOnlyArray>, - +type?: string, - +stale?: true, - |}; - - declare export type PossiblyStaleNavigationState = - | NavigationState - | StaleNavigationState; - declare export type PossiblyStaleRoute = - | Route - | StaleRoute; - - /** - * Routers - */ - - declare type ActionCreators< - State: NavigationState, - Action: GenericNavigationAction, - > = { - +[key: string]: (...args: any) => (Action | State => Action), - ... - }; - - declare export type DefaultRouterOptions = { - +initialRouteName?: string, - ... - }; - - declare export type RouterFactory< - State: NavigationState, - Action: GenericNavigationAction, - RouterOptions: DefaultRouterOptions, - > = (options: RouterOptions) => Router; - - declare export type ParamListBase = { +[key: string]: ?ScreenParams, ... }; - - declare export type RouterConfigOptions = {| - +routeNames: $ReadOnlyArray, - +routeParamList: ParamListBase, - |}; - - declare export type Router< - State: NavigationState, - Action: GenericNavigationAction, - > = {| - +type: $PropertyType, - +getInitialState: (options: RouterConfigOptions) => State, - +getRehydratedState: ( - partialState: PossibleStaleNavigationState, - options: RouterConfigOptions, - ) => State, - +getStateForRouteNamesChange: ( - state: State, - options: RouterConfigOptions, - ) => State, - +getStateForRouteFocus: (state: State, key: string) => State, - +getStateForAction: ( - state: State, - action: Action, - options: RouterConfigOptions, - ) => ?PossiblyStaleNavigationState; - +shouldActionChangeFocus: (action: GenericNavigationAction) => boolean, - +actionCreators?: ActionCreators, - |}; - - /** - * Stack actions and router - */ - - declare export type StackNavigationState = {| - ...NavigationState, - +type: 'stack', - |}; - - declare export type ReplaceAction = {| - +type: 'REPLACE', - +payload: {| +name: string, +key?: ?string, +params?: ScreenParams |}, - +source?: string, - +target?: string, - |}; - declare export type PushAction = {| - +type: 'PUSH', - +payload: {| +name: string, +key?: ?string, +params?: ScreenParams |}, - +source?: string, - +target?: string, - |}; - declare export type PopAction = {| - +type: 'POP', - +payload: {| +count: number |}, - +source?: string, - +target?: string, - |}; - declare export type PopToTopAction = {| - +type: 'POP_TO_TOP', - +source?: string, - +target?: string, - |}; - declare export type StackAction = - | CommonAction - | ReplaceAction - | PushAction - | PopAction - | PopToTopAction; - - declare export type StackActionsType = {| - +replace: (routeName: string, params?: ScreenParams) => ReplaceAction, - +push: (routeName: string, params?: ScreenParams) => PushAction, - +pop: (count?: number) => PopAction, - +popToTop: () => PopToTopAction, - |}; - - declare export type StackRouterOptions = $Exact; - - /** - * Tab actions and router - */ - - declare export type TabNavigationState = {| - ...NavigationState, - +type: 'tab', - +history: $ReadOnlyArray<{| type: 'route', key: string |}>, - |}; - - declare export type JumpToAction = {| - +type: 'JUMP_TO', - +payload: {| +name: string, +params?: ScreenParams |}, - +source?: string, - +target?: string, - |}; - declare export type TabAction = - | CommonAction - | JumpToAction; - - declare export type TabActionsType = {| - +jumpTo: string => JumpToAction, - |}; - - declare export type TabRouterOptions = {| - ...$Exact, - +backBehavior?: 'initialRoute' | 'order' | 'history' | 'none', - |}; - - /** - * Drawer actions and router - */ - - declare type DrawerHistoryEntry = - | {| +type: 'route', +key: string |} - | {| +type: 'drawer' |}; - declare export type DrawerNavigationState = {| - ...NavigationState, - +type: 'drawer', - +history: $ReadOnlyArray, - |}; - - declare export type OpenDrawerAction = {| - +type: 'OPEN_DRAWER', - +source?: string, - +target?: string, - |}; - declare export type CloseDrawerAction = {| - +type: 'CLOSE_DRAWER', - +source?: string, - +target?: string, - |}; - declare export type ToggleDrawerAction = {| - +type: 'TOGGLE_DRAWER', - +source?: string, - +target?: string, - |}; - declare export type DrawerAction = - | TabAction - | OpenDrawerAction - | CloseDrawerAction - | ToggleDrawerAction; - - declare export type DrawerActionsType = {| - ...TabActionsType, - +openDrawer: () => OpenDrawerAction, - +closeDrawer: () => CloseDrawerAction, - +toggleDrawer: () => ToggleDrawerAction, - |}; - - declare export type DrawerRouterOptions = {| - ...TabRouterOptions, - +openByDefault?: boolean, - |}; - - /** - * Events - */ - - declare export type EventMapBase = { - +[name: string]: {| - +data?: mixed, - +canPreventDefault?: boolean, - |}, - ... - }; - declare type EventPreventDefaultProperties = $If< - Test, - {| +defaultPrevented: boolean, +preventDefault: () => void |}, - {| |}, - >; - declare type EventDataProperties = $If< - $IsUndefined, - {| |}, - {| +data: Data |}, - >; - declare type EventArg< - EventName: string, - CanPreventDefault: ?boolean = false, - Data = void, - > = {| - ...EventPreventDefaultProperties, - ...EventDataProperties, - +type: EventName, - +target?: string, - |}; - declare type GlobalEventMap = {| - +state: {| +data: {| +state: State |}, +canPreventDefault: false |}, - |}; - declare type EventMapCore = {| - ...GlobalEventMap, - +focus: {| +data: void, +canPreventDefault: false |}, - +blur: {| +data: void, +canPreventDefault: false |}, - +beforeRemove: {| - +data: {| +action: GenericNavigationAction |}, - +canPreventDefault: true, - |}, - |}; - declare type EventListenerCallback< - EventName: string, - State: PossiblyStaleNavigationState = NavigationState, - EventMap: EventMapBase = EventMapCore, - > = (e: EventArg< - EventName, - $PropertyType< - $ElementType< - {| ...EventMap, ...EventMapCore |}, - EventName, - >, - 'canPreventDefault', - >, - $PropertyType< - $ElementType< - {| ...EventMap, ...EventMapCore |}, - EventName, - >, - 'data', - >, - >) => mixed; - - /** - * Navigation prop - */ - - declare export type SimpleNavigate = - >( - routeName: DestinationRouteName, - params: $ElementType, - ) => void; - - declare export type Navigate = - & SimpleNavigate - & >( - route: - | {| - key: string, - params?: $ElementType, - |} - | {| - name: DestinationRouteName, - key?: string, - params?: $ElementType, - |}, - ) => void; - - declare type NavigationHelpers< - ParamList: ParamListBase, - State: PossiblyStaleNavigationState = PossiblyStaleNavigationState, - EventMap: EventMapBase = EventMapCore, - > = { - +navigate: Navigate, - +dispatch: ( - action: - | GenericNavigationAction - | (State => GenericNavigationAction), - ) => void, - +reset: PossiblyStaleNavigationState => void, - +goBack: () => void, - +isFocused: () => boolean, - +canGoBack: () => boolean, - +dangerouslyGetParent: >() => ?Parent, - +dangerouslyGetState: () => NavigationState, - +addListener: |}, - >>( - name: EventName, - callback: EventListenerCallback, - ) => () => void, - +removeListener: |}, - >>( - name: EventName, - callback: EventListenerCallback, - ) => void, - ... - }; - - declare export type NavigationProp< - ParamList: ParamListBase, - RouteName: $Keys = $Keys, - State: PossiblyStaleNavigationState = PossiblyStaleNavigationState, - ScreenOptions: {...} = {...}, - EventMap: EventMapBase = EventMapCore, - > = { - ...$Exact>, - +setOptions: (options: $Partial) => void, - +setParams: ( - params: $If< - $IsUndefined<$ElementType>, - empty, - $Partial<$NonMaybeType<$ElementType>>, - >, - ) => void, - ... - }; - - /** - * CreateNavigator - */ - - declare export type RouteProp< - ParamList: ParamListBase, - RouteName: $Keys, - > = {| - ...LeafRoute, - +params: $ElementType, - |}; - - declare export type ScreenListeners< - EventMap: EventMapBase = EventMapCore, - State: NavigationState = NavigationState, - > = $ObjMapi< - {| [name: $Keys]: empty |}, - >(K, empty) => EventListenerCallback, - >; - - declare type BaseScreenProps< - ParamList: ParamListBase, - NavProp, - RouteName: $Keys = $Keys, - State: NavigationState = NavigationState, - ScreenOptions: {...} = {...}, - EventMap: EventMapBase = EventMapCore, - > = {| - +name: RouteName, - +options?: - | ScreenOptions - | ({| - route: RouteProp, - navigation: NavProp, - |}) => ScreenOptions, - +listeners?: - | ScreenListeners - | ({| - route: RouteProp, - navigation: NavProp, - |}) => ScreenListeners, - +initialParams?: $Partial<$ElementType>, - |}; - - declare export type ScreenProps< - ParamList: ParamListBase, - NavProp, - RouteName: $Keys = $Keys, - State: NavigationState = NavigationState, - ScreenOptions: {...} = {...}, - EventMap: EventMapBase = EventMapCore, - > = - | {| - ...BaseScreenProps< - ParamList, - NavProp, - RouteName, - State, - ScreenOptions, - EventMap, - >, - +component: React$ComponentType<{| - route: RouteProp, - navigation: NavProp, - |}>, - |} - | {| - ...BaseScreenProps< - ParamList, - NavProp, - RouteName, - State, - ScreenOptions, - EventMap, - >, - +children: ({| - route: RouteProp, - navigation: NavProp, - |}) => React$Node, - |}; - - declare export type ScreenComponent< - GlobalParamList: ParamListBase, - ParamList: ParamListBase, - State: NavigationState = NavigationState, - ScreenOptions: {...} = {...}, - EventMap: EventMapBase = EventMapCore, - > = < - RouteName: $Keys, - NavProp: NavigationProp< - GlobalParamList, - RouteName, - State, - ScreenOptions, - EventMap, - >, - >(props: ScreenProps< - ParamList, - NavProp, - RouteName, - State, - ScreenOptions, - EventMap, - >) => React$Node; - - declare type ScreenOptionsProp = {| - +screenOptions?: - | ScreenOptions - | ({| route: LeafRoute<>, navigation: NavProp |}) => ScreenOptions, - |}; - declare export type ExtraNavigatorPropsBase = { - ...$Exact, - +children?: React$Node, - ... - }; - declare export type NavigatorPropsBase = { - ...$Exact, - ...ScreenOptionsProp, - ... - }; - - declare export type CreateNavigator< - State: NavigationState, - ScreenOptions: {...}, - EventMap: EventMapBase, - ExtraNavigatorProps: ExtraNavigatorPropsBase, - > = < - GlobalParamList: ParamListBase, - ParamList: ParamListBase, - NavProp: NavigationHelpers< - GlobalParamList, - State, - EventMap, - >, - >() => {| - +Screen: ScreenComponent< - GlobalParamList, - ParamList, - State, - ScreenOptions, - EventMap, - >, - +Navigator: React$ComponentType<{| - ...$Exact, - ...ScreenOptionsProp, - |}>, - |}; - - declare export type CreateNavigatorFactory = < - State: NavigationState, - ScreenOptions: {...}, - EventMap: EventMapBase, - NavProp: NavigationHelpers< - ParamListBase, - State, - EventMap, - >, - ExtraNavigatorProps: ExtraNavigatorPropsBase, - >( - navigator: React$ComponentType<{| - ...$Exact, - ...ScreenOptionsProp, - |}>, - ) => CreateNavigator; - - /** - * useNavigationBuilder - */ - - declare export type Descriptor< - NavProp, - ScreenOptions: {...} = {...}, - > = {| - +render: () => React$Node, - +options: $ReadOnly, - +navigation: NavProp, - |}; - - declare export type UseNavigationBuilder = < - State: NavigationState, - Action: GenericNavigationAction, - ScreenOptions: {...}, - RouterOptions: DefaultRouterOptions, - NavProp, - >( - routerFactory: RouterFactory, - options: {| - ...$Exact, - ...ScreenOptionsProp, - +children?: React$Node, - |}, - ) => {| - +state: State, - +descriptors: {| +[key: string]: Descriptor |}, - +navigation: NavProp, - |}; - - /** - * EdgeInsets - */ - - declare type EdgeInsets = {| - +top: number, - +right: number, - +bottom: number, - +left: number, - |}; - - /** - * TransitionPreset - */ - - declare export type TransitionSpec = - | {| - animation: 'spring', - config: $Diff< - SpringAnimationConfigSingle, - { toValue: number | AnimatedValue, ... }, - >, - |} - | {| - animation: 'timing', - config: $Diff< - TimingAnimationConfigSingle, - { toValue: number | AnimatedValue, ... }, - >, - |}; - - declare export type StackCardInterpolationProps = {| - +current: {| - +progress: AnimatedInterpolation, - |}, - +next?: {| - +progress: AnimatedInterpolation, - |}, - +index: number, - +closing: AnimatedInterpolation, - +swiping: AnimatedInterpolation, - +inverted: AnimatedInterpolation, - +layouts: {| - +screen: {| +width: number, +height: number |}, - |}, - +insets: EdgeInsets, - |}; - declare export type StackCardInterpolatedStyle = {| - containerStyle?: AnimatedViewStyleProp, - cardStyle?: AnimatedViewStyleProp, - overlayStyle?: AnimatedViewStyleProp, - shadowStyle?: AnimatedViewStyleProp, - |}; - declare export type StackCardStyleInterpolator = ( - props: StackCardInterpolationProps, - ) => StackCardInterpolatedStyle; - - declare export type StackHeaderInterpolationProps = {| - +current: {| - +progress: AnimatedInterpolation, - |}, - +next?: {| - +progress: AnimatedInterpolation, - |}, - +layouts: {| - +header: {| +width: number, +height: number |}, - +screen: {| +width: number, +height: number |}, - +title?: {| +width: number, +height: number |}, - +leftLabel?: {| +width: number, +height: number |}, - |}, - |}; - declare export type StackHeaderInterpolatedStyle = {| - leftLabelStyle?: AnimatedViewStyleProp, - leftButtonStyle?: AnimatedViewStyleProp, - rightButtonStyle?: AnimatedViewStyleProp, - titleStyle?: AnimatedViewStyleProp, - backgroundStyle?: AnimatedViewStyleProp, - |}; - declare export type StackHeaderStyleInterpolator = ( - props: StackHeaderInterpolationProps, - ) => StackHeaderInterpolatedStyle; - - declare type GestureDirection = - | 'horizontal' - | 'horizontal-inverted' - | 'vertical' - | 'vertical-inverted'; - - declare export type TransitionPreset = {| - +gestureDirection: GestureDirection, - +transitionSpec: {| - +open: TransitionSpec, - +close: TransitionSpec, - |}, - +cardStyleInterpolator: StackCardStyleInterpolator, - +headerStyleInterpolator: StackHeaderStyleInterpolator, - |}; - - /** - * Stack options - */ - - declare export type StackDescriptor = Descriptor< - StackNavigationProp<>, - StackOptions, - >; - - declare type Scene = {| - +route: T, - +descriptor: StackDescriptor, - +progress: {| - +current: AnimatedInterpolation, - +next?: AnimatedInterpolation, - +previous?: AnimatedInterpolation, - |}, - |}; - - declare export type StackHeaderProps = {| - +mode: 'float' | 'screen', - +layout: {| +width: number, +height: number |}, - +insets: EdgeInsets, - +scene: Scene>, - +previous?: Scene>, - +navigation: StackNavigationProp, - +styleInterpolator: StackHeaderStyleInterpolator, - |}; - - declare export type StackHeaderLeftButtonProps = $Partial<{| - +onPress: (() => void), - +pressColorAndroid: string; - +backImage: (props: {| tintColor: string |}) => React$Node, - +tintColor: string, - +label: string, - +truncatedLabel: string, - +labelVisible: boolean, - +labelStyle: AnimatedTextStyleProp, - +allowFontScaling: boolean, - +onLabelLayout: LayoutEvent => void, - +screenLayout: {| +width: number, +height: number |}, - +titleLayout: {| +width: number, +height: number |}, - +canGoBack: boolean, - |}>; - - declare type StackHeaderTitleInputBase = { - +onLayout: LayoutEvent => void, - +children: string, - +allowFontScaling: ?boolean, - +tintColor: ?string, - +style: ?AnimatedTextStyleProp, - ... - }; - - declare export type StackHeaderTitleInputProps = - $Exact; - - declare export type StackOptions = $Partial<{| - +title: string, - +header: StackHeaderProps => React$Node, - +headerShown: boolean, - +cardShadowEnabled: boolean, - +cardOverlayEnabled: boolean, - +cardOverlay: {| style: ViewStyleProp |} => React$Node, - +cardStyle: ViewStyleProp, - +animationEnabled: boolean, - +animationTypeForReplace: 'push' | 'pop', - +gestureEnabled: boolean, - +gestureResponseDistance: {| vertical?: number, horizontal?: number |}, - +gestureVelocityImpact: number, - +safeAreaInsets: $Partial, - // Transition - ...TransitionPreset, - // Header - +headerTitle: string | (StackHeaderTitleInputProps => React$Node), - +headerTitleAlign: 'left' | 'center', - +headerTitleStyle: AnimatedTextStyleProp, - +headerTitleContainerStyle: ViewStyleProp, - +headerTintColor: string, - +headerTitleAllowFontScaling: boolean, - +headerBackAllowFontScaling: boolean, - +headerBackTitle: string | null, - +headerBackTitleStyle: TextStyleProp, - +headerBackTitleVisible: boolean, - +headerTruncatedBackTitle: string, - +headerLeft: StackHeaderLeftButtonProps => React$Node, - +headerLeftContainerStyle: ViewStyleProp, - +headerRight: {| tintColor?: string |} => React$Node, - +headerRightContainerStyle: ViewStyleProp, - +headerBackImage: $PropertyType, - +headerPressColorAndroid: string, - +headerBackground: ({| style: ViewStyleProp |}) => React$Node, - +headerStyle: ViewStyleProp, - +headerTransparent: boolean, - +headerStatusBarHeight: number, - |}>; - - /** - * Stack navigation prop - */ - - declare export type StackNavigationEventMap = {| - ...EventMapCore, - +transitionStart: {| - +data: {| +closing: boolean |}, - +canPreventDefault: false, - |}, - +transitionEnd: {| - +data: {| +closing: boolean |}, - +canPreventDefault: false, - |}, - +gestureStart: {| +data: void, +canPreventDefault: false |}, - +gestureEnd: {| +data: void, +canPreventDefault: false |}, - +gestureCancel: {| +data: void, +canPreventDefault: false |}, - |}; - - declare type InexactStackNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = StackOptions, - EventMap: EventMapBase = StackNavigationEventMap, - > = { - ...$Exact>, - +replace: SimpleNavigate, - +push: SimpleNavigate, - +pop: (count?: number) => void, - +popToTop: () => void, - ... - }; - - declare export type StackNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = StackOptions, - EventMap: EventMapBase = StackNavigationEventMap, - > = $Exact>; - - /** - * Miscellaneous stack exports - */ - - declare type StackNavigationConfig = {| - +mode?: 'card' | 'modal', - +headerMode?: 'float' | 'screen' | 'none', - +keyboardHandlingEnabled?: boolean, - +detachInactiveScreens?: boolean, - |}; - - declare export type ExtraStackNavigatorProps = {| - ...$Exact, - ...StackRouterOptions, - ...StackNavigationConfig, - |}; - - declare export type StackNavigatorProps< - NavProp: InexactStackNavigationProp<> = StackNavigationProp<>, - > = {| - ...ExtraStackNavigatorProps, - ...ScreenOptionsProp, - |}; - - /** - * Bottom tab options - */ - - declare export type BottomTabBarButtonProps = {| - ...$Diff< - TouchableWithoutFeedbackProps, - {| onPress?: ?(event: PressEvent) => mixed |}, - >, - +to?: string, - +children: React$Node, - +onPress?: (MouseEvent | PressEvent) => void, - |}; - - declare export type TabBarVisibilityAnimationConfig = - | {| - +animation: 'spring', - +config?: $Diff< - SpringAnimationConfigSingle, - { toValue: number | AnimatedValue, useNativeDriver: boolean, ... }, - >, - |} - | {| - +animation: 'timing', - +config?: $Diff< - TimingAnimationConfigSingle, - { toValue: number | AnimatedValue, useNativeDriver: boolean, ... }, - >, - |}; - - declare export type BottomTabOptions = $Partial<{| - +title: string, - +tabBarLabel: - | string - | ({| focused: boolean, color: string |}) => React$Node, - +tabBarIcon: ({| - focused: boolean, - color: string, - size: number, - |}) => React$Node, - +tabBarBadge: number | string, - +tabBarBadgeStyle: TextStyleProp, - +tabBarAccessibilityLabel: string, - +tabBarTestID: string, - +tabBarVisible: boolean, - +tabBarVisibilityAnimationConfig: $Partial<{| - +show: TabBarVisibilityAnimationConfig, - +hide: TabBarVisibilityAnimationConfig, - |}>, - +tabBarButton: BottomTabBarButtonProps => React$Node, - +unmountOnBlur: boolean, - |}>; - - /** - * Bottom tab navigation prop - */ - - declare export type BottomTabNavigationEventMap = {| - ...EventMapCore, - +tabPress: {| +data: void, +canPreventDefault: true |}, - +tabLongPress: {| +data: void, +canPreventDefault: false |}, - |}; - - declare type InexactTabNavigationProp< - ParamList: ParamListBase, - RouteName: $Keys, - Options: {...}, - EventMap: EventMapBase, - > = { - ...$Exact>, - +jumpTo: SimpleNavigate, - ... - }; - - declare export type InexactBottomTabNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = BottomTabOptions, - EventMap: EventMapBase = BottomTabNavigationEventMap, - > = InexactTabNavigationProp< - ParamList, - RouteName, - Options, - EventMap, - >; - - declare export type BottomTabNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = BottomTabOptions, - EventMap: EventMapBase = BottomTabNavigationEventMap, - > = $Exact>; - - /** - * Miscellaneous bottom tab exports - */ - - declare export type BottomTabDescriptor = Descriptor< - BottomTabNavigationProp<>, - BottomTabOptions, - >; - - declare export type BottomTabBarOptions = $Partial<{| - +keyboardHidesTabBar: boolean, - +activeTintColor: string, - +inactiveTintColor: string, - +activeBackgroundColor: string, - +inactiveBackgroundColor: string, - +allowFontScaling: boolean, - +showLabel: boolean, - +showIcon: boolean, - +labelStyle: TextStyleProp, - +iconStyle: TextStyleProp, - +tabStyle: ViewStyleProp, - +labelPosition: 'beside-icon' | 'below-icon', - +adaptive: boolean, - +safeAreaInsets: $Partial, - +style: ViewStyleProp, - |}>; - - declare type BottomTabNavigationBuilderResult = {| - +state: TabNavigationState, - +navigation: BottomTabNavigationProp<>, - +descriptors: {| +[key: string]: BottomTabDescriptor |}, - |}; - - declare export type BottomTabBarProps = {| - ...BottomTabBarOptions, - ...BottomTabNavigationBuilderResult, - |} - - declare type BottomTabNavigationConfig = {| - +lazy?: boolean, - +tabBar?: BottomTabBarProps => React$Node, - +tabBarOptions?: BottomTabBarOptions, - +detachInactiveScreens?: boolean, - |}; - - declare export type ExtraBottomTabNavigatorProps = {| - ...$Exact, - ...TabRouterOptions, - ...BottomTabNavigationConfig, - |}; - - declare export type BottomTabNavigatorProps< - NavProp: InexactBottomTabNavigationProp<> = BottomTabNavigationProp<>, - > = {| - ...ExtraBottomTabNavigatorProps, - ...ScreenOptionsProp, - |}; - - /** - * Material bottom tab options - */ - - declare export type MaterialBottomTabOptions = $Partial<{| - +title: string, - +tabBarColor: string, - +tabBarLabel: string, - +tabBarIcon: - | string - | ({| +focused: boolean, +color: string |}) => React$Node, - +tabBarBadge: boolean | number | string, - +tabBarAccessibilityLabel: string, - +tabBarTestID: string, - |}>; - - /** - * Material bottom tab navigation prop - */ - - declare export type MaterialBottomTabNavigationEventMap = {| - ...EventMapCore, - +tabPress: {| +data: void, +canPreventDefault: true |}, - |}; - - declare export type InexactMaterialBottomTabNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = MaterialBottomTabOptions, - EventMap: EventMapBase = MaterialBottomTabNavigationEventMap, - > = InexactTabNavigationProp< - ParamList, - RouteName, - Options, - EventMap, - >; - - declare export type MaterialBottomTabNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = MaterialBottomTabOptions, - EventMap: EventMapBase = MaterialBottomTabNavigationEventMap, - > = $Exact>; - - /** - * Miscellaneous material bottom tab exports - */ - - declare export type PaperFont = {| - +fontFamily: string, - +fontWeight?: - | 'normal' - | 'bold' - | '100' - | '200' - | '300' - | '400' - | '500' - | '600' - | '700' - | '800' - | '900', - |}; - - declare export type PaperFonts = {| - +regular: Font, - +medium: Font, - +light: Font, - +thin: Font, - |}; - - declare export type PaperTheme = {| - +dark: boolean, - +mode?: 'adaptive' | 'exact', - +roundness: number, - +colors: {| - +primary: string, - +background: string, - +surface: string, - +accent: string, - +error: string, - +text: string, - +onSurface: string, - +onBackground: string, - +disabled: string, - +placeholder: string, - +backdrop: string, - +notification: string, - |}, - +fonts: PaperFonts, - +animation: {| - +scale: number, - |}, - |}; - - declare export type PaperRoute = {| - +key: string, - +title?: string, - +icon?: any, - +badge?: string | number | boolean, - +color?: string, - +accessibilityLabel?: string, - +testID?: string, - |}; - - declare export type PaperTouchableProps = {| - ...TouchableWithoutFeedbackProps, - +key: string, - +route: PaperRoute, - +children: React$Node, - +borderless?: boolean, - +centered?: boolean, - +rippleColor?: string, - |}; - - declare export type MaterialBottomTabNavigationConfig = {| - +shifting?: boolean, - +labeled?: boolean, - +renderTouchable?: PaperTouchableProps => React$Node, - +activeColor?: string, - +inactiveColor?: string, - +sceneAnimationEnabled?: boolean, - +keyboardHidesNavigationBar?: boolean, - +barStyle?: ViewStyleProp, - +style?: ViewStyleProp, - +theme?: PaperTheme, - |}; - - declare export type ExtraMaterialBottomTabNavigatorProps = {| - ...$Exact, - ...TabRouterOptions, - ...MaterialBottomTabNavigationConfig, - |}; - - declare export type MaterialBottomTabNavigatorProps< - NavProp: InexactMaterialBottomTabNavigationProp<> = - MaterialBottomTabNavigationProp<>, - > = {| - ...ExtraMaterialBottomTabNavigatorProps, - ...ScreenOptionsProp, - |}; - - /** - * Material top tab options - */ - - declare export type MaterialTopTabOptions = $Partial<{| - +title: string, - +tabBarLabel: - | string - | ({| +focused: boolean, +color: string |}) => React$Node, - +tabBarIcon: ({| +focused: boolean, +color: string |}) => React$Node, - +tabBarAccessibilityLabel: string, - +tabBarTestID: string, - |}>; - - /** - * Material top tab navigation prop - */ - - declare export type MaterialTopTabNavigationEventMap = {| - ...EventMapCore, - +tabPress: {| +data: void, +canPreventDefault: true |}, - +tabLongPress: {| +data: void, +canPreventDefault: false |}, - +swipeStart: {| +data: void, +canPreventDefault: false |}, - +swipeEnd: {| +data: void, +canPreventDefault: false |}, - |}; - - declare export type InexactMaterialTopTabNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = MaterialTopTabOptions, - EventMap: EventMapBase = MaterialTopTabNavigationEventMap, - > = InexactTabNavigationProp< - ParamList, - RouteName, - Options, - EventMap, - >; - - declare export type MaterialTopTabNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = MaterialTopTabOptions, - EventMap: EventMapBase = MaterialTopTabNavigationEventMap, - > = $Exact>; - - /** - * Miscellaneous material top tab exports - */ - - declare type MaterialTopTabPagerCommonProps = {| - +keyboardDismissMode: 'none' | 'on-drag' | 'auto', - +swipeEnabled: boolean, - +swipeVelocityImpact?: number, - +springVelocityScale?: number, - +springConfig: $Partial<{| - +damping: number, - +mass: number, - +stiffness: number, - +restSpeedThreshold: number, - +restDisplacementThreshold: number, - |}>, - +timingConfig: $Partial<{| - +duration: number, - |}>, - |}; - - declare export type MaterialTopTabPagerProps = {| - ...MaterialTopTabPagerCommonProps, - +onSwipeStart?: () => void, - +onSwipeEnd?: () => void, - +onIndexChange: (index: number) => void, - +navigationState: TabNavigationState, - +layout: {| +width: number, +height: number |}, - +removeClippedSubviews: boolean, - +children: ({| - +addListener: (type: 'enter', listener: number => void) => void, - +removeListener: (type: 'enter', listener: number => void) => void, - +position: any, // Reanimated.Node - +render: React$Node => React$Node, - +jumpTo: string => void, - |}) => React$Node, - +gestureHandlerProps: PanGestureHandlerProps, - |}; - - declare export type MaterialTopTabBarIndicatorProps = {| - +navigationState: TabNavigationState, - +width: string, - +style?: ViewStyleProp, - +getTabWidth: number => number, - |}; - - declare export type MaterialTopTabBarOptions = $Partial<{| - +scrollEnabled: boolean, - +bounces: boolean, - +pressColor: string, - +pressOpacity: number, - +getAccessible: ({| +route: Route<> |}) => boolean, - +renderBadge: ({| +route: Route<> |}) => React$Node, - +renderIndicator: MaterialTopTabBarIndicatorProps => React$Node, - +tabStyle: ViewStyleProp, - +indicatorStyle: ViewStyleProp, - +indicatorContainerStyle: ViewStyleProp, - +labelStyle: TextStyleProp, - +contentContainerStyle: ViewStyleProp, - +style: ViewStyleProp, - +activeTintColor: string, - +inactiveTintColor: string, - +iconStyle: ViewStyleProp, - +labelStyle: TextStyleProp, - +showLabel: boolean, - +showIcon: boolean, - +allowFontScaling: boolean, - |}>; - - declare export type MaterialTopTabDescriptor = Descriptor< - MaterialBottomTabNavigationProp<>, - MaterialBottomTabOptions, - >; - - declare type MaterialTopTabNavigationBuilderResult = {| - +state: TabNavigationState, - +navigation: MaterialTopTabNavigationProp<>, - +descriptors: {| +[key: string]: MaterialTopTabDescriptor |}, - |}; - - declare export type MaterialTopTabBarProps = {| - ...MaterialTopTabBarOptions, - ...MaterialTopTabNavigationBuilderResult, - +layout: {| +width: number, +height: number |}, - +position: any, // Reanimated.Node - +jumpTo: string => void, - |}; - - declare export type MaterialTopTabNavigationConfig = {| - ...$Partial, - +position?: any, // Reanimated.Value - +tabBarPosition?: 'top' | 'bottom', - +initialLayout?: $Partial<{| +width: number, +height: number |}>, - +lazy?: boolean, - +lazyPreloadDistance?: number, - +removeClippedSubviews?: boolean, - +sceneContainerStyle?: ViewStyleProp, - +style?: ViewStyleProp, - +gestureHandlerProps?: PanGestureHandlerProps, - +pager?: MaterialTopTabPagerProps => React$Node, - +lazyPlaceholder?: ({| +route: Route<> |}) => React$Node, - +tabBar?: MaterialTopTabBarProps => React$Node, - +tabBarOptions?: MaterialTopTabBarOptions, - |}; - - declare export type ExtraMaterialTopTabNavigatorProps = {| - ...$Exact, - ...TabRouterOptions, - ...MaterialTopTabNavigationConfig, - |}; - - declare export type MaterialTopTabNavigatorProps< - NavProp: InexactMaterialTopTabNavigationProp<> = - MaterialTopTabNavigationProp<>, - > = {| - ...ExtraMaterialTopTabNavigatorProps, - ...ScreenOptionsProp, - |}; - - /** - * Drawer options - */ - - declare export type DrawerOptions = $Partial<{| - title: string, - drawerLabel: - | string - | ({| +color: string, +focused: boolean |}) => React$Node, - drawerIcon: ({| - +color: string, - +size: number, - +focused: boolean, - |}) => React$Node, - gestureEnabled: boolean, - swipeEnabled: boolean, - unmountOnBlur: boolean, - |}>; - - /** - * Drawer navigation prop - */ - - declare export type DrawerNavigationEventMap = {| - ...EventMapCore, - +drawerOpen: {| +data: void, +canPreventDefault: false |}, - +drawerClose: {| +data: void, +canPreventDefault: false |}, - |}; - - declare export type InexactDrawerNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = DrawerOptions, - EventMap: EventMapBase = DrawerNavigationEventMap, - > = { - ...$Exact>, - +jumpTo: SimpleNavigate, - +openDrawer: () => void, - +closeDrawer: () => void, - +toggleDrawer: () => void, - ... - }; - - declare export type DrawerNavigationProp< - ParamList: ParamListBase = ParamListBase, - RouteName: $Keys = $Keys, - Options: {...} = DrawerOptions, - EventMap: EventMapBase = DrawerNavigationEventMap, - > = $Exact>; - - /** - * Miscellaneous drawer exports - */ - - declare export type DrawerDescriptor = Descriptor< - DrawerNavigationProp<>, - DrawerOptions, - >; - - declare export type DrawerItemListBaseOptions = $Partial<{| - +activeTintColor: string, - +activeBackgroundColor: string, - +inactiveTintColor: string, - +inactiveBackgroundColor: string, - +itemStyle: ViewStyleProp, - +labelStyle: TextStyleProp, - |}>; - - declare export type DrawerContentOptions = $Partial<{| - ...DrawerItemListBaseOptions, - +contentContainerStyle: ViewStyleProp, - +style: ViewStyleProp, - |}>; - - declare type DrawerNavigationBuilderResult = {| - +state: DrawerNavigationState, - +navigation: DrawerNavigationProp<>, - +descriptors: {| +[key: string]: DrawerDescriptor |}, - |}; - - declare export type DrawerContentProps = {| - ...DrawerContentOptions, - ...DrawerNavigationBuilderResult, - +progress: any, // Reanimated.Node - |}; - - declare export type DrawerNavigationConfig = {| - +drawerPosition?: 'left' | 'right', - +drawerType?: 'front' | 'back' | 'slide' | 'permanent', - +edgeWidth?: number, - +hideStatusBar?: boolean, - +keyboardDismissMode?: 'on-drag' | 'none', - +minSwipeDistance?: number, - +overlayColor?: string, - +statusBarAnimation?: 'slide' | 'none' | 'fade', - +gestureHandlerProps?: PanGestureHandlerProps, - +lazy?: boolean, - +drawerContent?: DrawerContentProps => React$Node, - +drawerContentOptions?: DrawerContentOptions, - +sceneContainerStyle?: ViewStyleProp, - +drawerStyle?: ViewStyleProp, - +detachInactiveScreens?: boolean, - |}; - - declare export type ExtraDrawerNavigatorProps = {| - ...$Exact, - ...DrawerRouterOptions, - ...DrawerNavigationConfig, - |}; - - declare export type DrawerNavigatorProps< - NavProp: InexactDrawerNavigationProp<> = DrawerNavigationProp<>, - > = {| - ...ExtraDrawerNavigatorProps, - ...ScreenOptionsProp, - |}; - - /** - * BaseNavigationContainer - */ - - declare export type BaseNavigationContainerProps = {| - +children: React$Node, - +initialState?: PossiblyStaleNavigationState, - +onStateChange?: (state: ?PossiblyStaleNavigationState) => void, - +independent?: boolean, - |}; - - declare export type ContainerEventMap = {| - ...GlobalEventMap, - +options: {| - +data: {| +options: { +[key: string]: mixed, ... } |}, - +canPreventDefault: false, - |}, - +__unsafe_action__: {| - +data: {| - +action: GenericNavigationAction, - +noop: boolean, - |}, - +canPreventDefault: false, - |}, - |}; - - declare export type BaseNavigationContainerInterface = {| - ...$Exact>, - +setParams: (params: ScreenParams) => void, - +resetRoot: (state?: ?PossiblyStaleNavigationState) => void, - +getRootState: () => PossiblyStaleNavigationState, - |}; - - /** - * State utils - */ - - declare export type GetStateFromPath = ( - path: string, - options?: LinkingConfig, - ) => PossiblyStaleNavigationState; - - declare export type GetPathFromState = ( - state?: ?PossiblyStaleNavigationState, - options?: LinkingConfig, - ) => string; - - declare export type GetFocusedRouteNameFromRoute = - PossiblyStaleRoute => ?string; - - /** - * Linking - */ - - declare export type ScreenLinkingConfig = {| - +path?: string, - +exact?: boolean, - +parse?: {| +[param: string]: string => mixed |}, - +stringify?: {| +[param: string]: mixed => string |}, - +screens?: ScreenLinkingConfigMap, - +initialRouteName?: string, - |}; - - declare export type ScreenLinkingConfigMap = {| - +[routeName: string]: string | ScreenLinkingConfig, - |}; - - declare export type LinkingConfig = {| - +initialRouteName?: string, - +screens: ScreenLinkingConfigMap, - |}; - - declare export type LinkingOptions = {| - +enabled?: boolean, - +prefixes: $ReadOnlyArray, - +config?: LinkingConfig, - +getStateFromPath?: GetStateFromPath, - +getPathFromState?: GetPathFromState, - |}; - - /** - * NavigationContainer - */ - - declare export type Theme = {| - +dark: boolean, - +colors: {| - +primary: string, - +background: string, - +card: string, - +text: string, - +border: string, - |}, - |}; - - declare export type NavigationContainerType = React$AbstractComponent< - {| - ...BaseNavigationContainerProps, - +theme?: Theme, - +linking?: LinkingOptions, - +fallback?: React$Node, - +onReady?: () => mixed, - |}, - BaseNavigationContainerInterface, - >; - - //--------------------------------------------------------------------------- - // SECTION 2: EXPORTED MODULE - // This section defines the module exports and contains exported types that - // are not present in any other React Navigation libdef. - //--------------------------------------------------------------------------- - - /** - * StackView - */ - - declare export var StackView: React$ComponentType<{| - ...StackNavigationConfig, - +state: StackNavigationState, - +navigation: StackNavigationProp<>, - +descriptors: {| +[key: string]: StackDescriptor |}, - |}>; - - /** - * createStackNavigator - */ - - declare export var createStackNavigator: CreateNavigator< - StackNavigationState, - StackOptions, - StackNavigationEventMap, - ExtraStackNavigatorProps, - >; - - /** - * Header components - */ - - declare export var Header: React$ComponentType; - - declare export type StackHeaderTitleProps = $Partial; - declare export var HeaderTitle: React$ComponentType; - - declare export type HeaderBackButtonProps = $Partial<{| - ...StackHeaderLeftButtonProps, - +disabled: boolean, - +accessibilityLabel: string, - |}>; - declare export var HeaderBackButton: React$ComponentType< - HeaderBackButtonProps, - >; - - declare export type HeaderBackgroundProps = $Partial<{ - +children: React$Node, - +style: AnimatedViewStyleProp, - ... - }>; - declare export var HeaderBackground: React$ComponentType< - HeaderBackgroundProps, - >; - - /** - * Style/animation options - */ - - declare export var CardStyleInterpolators: {| - +forHorizontalIOS: StackCardStyleInterpolator, - +forVerticalIOS: StackCardStyleInterpolator, - +forModalPresentationIOS: StackCardStyleInterpolator, - +forFadeFromBottomAndroid: StackCardStyleInterpolator, - +forRevealFromBottomAndroid: StackCardStyleInterpolator, - +forScaleFromCenterAndroid: StackCardStyleInterpolator, - +forNoAnimation: StackCardStyleInterpolator, - |}; - declare export var HeaderStyleInterpolators: {| - +forUIKit: StackHeaderStyleInterpolator, - +forFade: StackHeaderStyleInterpolator, - +forSlideLeft: StackHeaderStyleInterpolator, - +forSlideRight: StackHeaderStyleInterpolator, - +forSlideUp: StackHeaderStyleInterpolator, - +forNoAnimation: StackHeaderStyleInterpolator, - |}; - declare export var TransitionSpecs: {| - +TransitionIOSSpec: TransitionSpec, - +FadeInFromBottomAndroidSpec: TransitionSpec, - +FadeOutToBottomAndroidSpec: TransitionSpec, - +RevealFromBottomAndroidSpec: TransitionSpec, - +ScaleFromCenterAndroidSpec: TransitionSpec, - |}; - declare export var TransitionPresets: {| - +SlideFromRightIOS: TransitionPreset, - +ModalSlideFromBottomIOS: TransitionPreset, - +ModalPresentationIOS: TransitionPreset, - +FadeFromBottomAndroid: TransitionPreset, - +RevealFromBottomAndroid: TransitionPreset, - +ScaleFromCenterAndroid: TransitionPreset, - +DefaultTransition: TransitionPreset, - +ModalTransition: TransitionPreset, - |}; - - /** - * Image assets - */ - - declare export var Assets: $ReadOnlyArray; - - /** - * CardAnimation accessors - */ - - declare export var CardAnimationContext: React$Context< - ?StackCardInterpolationProps, - >; - declare export function useCardAnimation(): StackCardInterpolationProps - - /** - * HeaderHeight accessors - */ - - declare export var HeaderHeightContext: React$Context; - declare export function useHeaderHeight(): number; - - /** - * GestureHandler accessors - */ - - declare type GestureHandlerRef = React$Ref< - React$ComponentType, - >; - declare export var GestureHandlerRefContext: React$Context< - ?GestureHandlerRef, - >; - declare export function useGestureHandlerRef(): GestureHandlerRef; - -} diff --git a/flow-typed/npm/bignumber.js_v7.x.x.js b/flow-typed/npm/bignumber.js_v7.x.x.js deleted file mode 100644 index 0065fc98eb..0000000000 --- a/flow-typed/npm/bignumber.js_v7.x.x.js +++ /dev/null @@ -1,1690 +0,0 @@ -// flow-typed signature: d075a327187f16e80dac4c6cdc48183c -// flow-typed version: c9197156b6/bignumber.js_v7.x.x/flow_>=v0.55.x - -// Original Typescript: https://github.com/MikeMcl/bignumber.js/blob/master/bignumber.d.ts - -declare module "bignumber.js" { - /** - * See `BigNumber.config` and `BigNumber.clone`. - */ - declare interface Config { - /** - * An integer, 0 to 1e+9. Default value: 20. - * - * The maximum number of decimal places of the result of operations involving division, i.e. - * division, square root and base conversion operations, and exponentiation when the exponent is - * negative. - * - * ```ts - * BigNumber.config({ DECIMAL_PLACES: 5 }) - * BigNumber.set({ DECIMAL_PLACES: 5 }) - * ``` - */ - DECIMAL_PLACES?: number; - - /** - * An integer, 0 to 8. Default value: `BigNumber.ROUND_HALF_UP` (4). - * - * The rounding mode used in operations that involve division (see `DECIMAL_PLACES`) and the - * default rounding mode of the `decimalPlaces`, `precision`, `toExponential`, `toFixed`, - * `toFormat` and `toPrecision` methods. - * - * The modes are available as enumerated properties of the BigNumber constructor. - * - * ```ts - * BigNumber.config({ ROUNDING_MODE: 0 }) - * BigNumber.set({ ROUNDING_MODE: BigNumber.ROUND_UP }) - * ``` - */ - ROUNDING_MODE?: RoundingMode; - - /** - * An integer, 0 to 1e+9, or an array, [-1e+9 to 0, 0 to 1e+9]. - * Default value: `[-7, 20]`. - * - * The exponent value(s) at which `toString` returns exponential notation. - * - * If a single number is assigned, the value is the exponent magnitude. - * - * If an array of two numbers is assigned then the first number is the negative exponent value at - * and beneath which exponential notation is used, and the second number is the positive exponent - * value at and above which exponential notation is used. - * - * For example, to emulate JavaScript numbers in terms of the exponent values at which they begin - * to use exponential notation, use `[-7, 20]`. - * - * ```ts - * BigNumber.config({ EXPONENTIAL_AT: 2 }) - * new BigNumber(12.3) // '12.3' e is only 1 - * new BigNumber(123) // '1.23e+2' - * new BigNumber(0.123) // '0.123' e is only -1 - * new BigNumber(0.0123) // '1.23e-2' - * - * BigNumber.config({ EXPONENTIAL_AT: [-7, 20] }) - * new BigNumber(123456789) // '123456789' e is only 8 - * new BigNumber(0.000000123) // '1.23e-7' - * - * // Almost never return exponential notation: - * BigNumber.config({ EXPONENTIAL_AT: 1e+9 }) - * - * // Always return exponential notation: - * BigNumber.config({ EXPONENTIAL_AT: 0 }) - * ``` - * - * Regardless of the value of `EXPONENTIAL_AT`, the `toFixed` method will always return a value in - * normal notation and the `toExponential` method will always return a value in exponential form. - * Calling `toString` with a base argument, e.g. `toString(10)`, will also always return normal - * notation. - */ - EXPONENTIAL_AT?: number | [number, number]; - - /** - * An integer, magnitude 1 to 1e+9, or an array, [-1e+9 to -1, 1 to 1e+9]. - * Default value: `[-1e+9, 1e+9]`. - * - * The exponent value(s) beyond which overflow to Infinity and underflow to zero occurs. - * - * If a single number is assigned, it is the maximum exponent magnitude: values wth a positive - * exponent of greater magnitude become Infinity and those with a negative exponent of greater - * magnitude become zero. - * - * If an array of two numbers is assigned then the first number is the negative exponent limit and - * the second number is the positive exponent limit. - * - * For example, to emulate JavaScript numbers in terms of the exponent values at which they - * become zero and Infinity, use [-324, 308]. - * - * ```ts - * BigNumber.config({ RANGE: 500 }) - * BigNumber.config().RANGE // [ -500, 500 ] - * new BigNumber('9.999e499') // '9.999e+499' - * new BigNumber('1e500') // 'Infinity' - * new BigNumber('1e-499') // '1e-499' - * new BigNumber('1e-500') // '0' - * - * BigNumber.config({ RANGE: [-3, 4] }) - * new BigNumber(99999) // '99999' e is only 4 - * new BigNumber(100000) // 'Infinity' e is 5 - * new BigNumber(0.001) // '0.01' e is only -3 - * new BigNumber(0.0001) // '0' e is -4 - * ``` - * The largest possible magnitude of a finite BigNumber is 9.999...e+1000000000. - * The smallest possible magnitude of a non-zero BigNumber is 1e-1000000000. - */ - RANGE?: number | [number, number]; - - /** - * A boolean: `true` or `false`. Default value: `false`. - * - * The value that determines whether cryptographically-secure pseudo-random number generation is - * used. If `CRYPTO` is set to true then the random method will generate random digits using - * `crypto.getRandomValues` in browsers that support it, or `crypto.randomBytes` if using a - * version of Node.js that supports it. - * - * If neither function is supported by the host environment then attempting to set `CRYPTO` to - * `true` will fail and an exception will be thrown. - * - * If `CRYPTO` is `false` then the source of randomness used will be `Math.random` (which is - * assumed to generate at least 30 bits of randomness). - * - * See `BigNumber.random`. - * - * ```ts - * BigNumber.config({ CRYPTO: true }) - * BigNumber.config().CRYPTO // true - * BigNumber.random() // 0.54340758610486147524 - * ``` - */ - CRYPTO?: boolean; - - /** - * An integer, 0, 1, 3, 6 or 9. Default value: `BigNumber.ROUND_DOWN` (1). - * - * The modulo mode used when calculating the modulus: `a mod n`. - * The quotient, `q = a / n`, is calculated according to the `ROUNDING_MODE` that corresponds to - * the chosen `MODULO_MODE`. - * The remainder, `r`, is calculated as: `r = a - n * q`. - * - * The modes that are most commonly used for the modulus/remainder operation are shown in the - * following table. Although the other rounding modes can be used, they may not give useful - * results. - * - * Property | Value | Description - * :------------------|:------|:------------------------------------------------------------------ - * `ROUND_UP` | 0 | The remainder is positive if the dividend is negative. - * `ROUND_DOWN` | 1 | The remainder has the same sign as the dividend. - * | | Uses 'truncating division' and matches JavaScript's `%` operator . - * `ROUND_FLOOR` | 3 | The remainder has the same sign as the divisor. - * | | This matches Python's `%` operator. - * `ROUND_HALF_EVEN` | 6 | The IEEE 754 remainder function. - * `EUCLID` | 9 | The remainder is always positive. - * | | Euclidian division: `q = sign(n) * floor(a / abs(n))` - * - * The rounding/modulo modes are available as enumerated properties of the BigNumber constructor. - * - * See `modulo`. - * - * ```ts - * BigNumber.config({ MODULO_MODE: BigNumber.EUCLID }) - * BigNumber.set({ MODULO_MODE: 9 }) // equivalent - * ``` - */ - MODULO_MODE?: ModuloMode; - - /** - * An integer, 0 to 1e+9. Default value: 0. - * - * The maximum precision, i.e. number of significant digits, of the result of the power operation - * - unless a modulus is specified. - * - * If set to 0, the number of significant digits will not be limited. - * - * See `exponentiatedBy`. - * - * ```ts - * BigNumber.config({ POW_PRECISION: 100 }) - * ``` - */ - POW_PRECISION?: number; - - /** - * An object including any number of the properties shown below. - * - * The object configures the format of the string returned by the `toFormat` method. - * The example below shows the properties of the object that are recognised, and - * their default values. - * - * Unlike the other configuration properties, the values of the properties of the `FORMAT` object - * will not be checked for validity - the existing object will simply be replaced by the object - * that is passed in. - * - * See `toFormat`. - * - * ```ts - * BigNumber.config({ - * FORMAT: { - * // the decimal separator - * decimalSeparator: '.', - * // the grouping separator of the integer part - * groupSeparator: ',', - * // the primary grouping size of the integer part - * groupSize: 3, - * // the secondary grouping size of the integer part - * secondaryGroupSize: 0, - * // the grouping separator of the fraction part - * fractionGroupSeparator: ' ', - * // the grouping size of the fraction part - * fractionGroupSize: 0 - * } - * }) - * ``` - */ - FORMAT?: Format; - - /** - * A string representing the alphabet used for base conversion. - * Default value: `'0123456789abcdefghijklmnopqrstuvwxyz'`. - * - * The length of the alphabet corresponds to the maximum value of the base argument that can be - * passed to the BigNumber constructor or `toString`. There is no maximum length, but it must be - * at least 2 characters long, and it must not contain a repeated character, or `'.'` - the - * decimal separator for all values whatever their base. - * - * ```ts - * // duodecimal (base 12) - * BigNumber.config({ ALPHABET: '0123456789TE' }) - * x = new BigNumber('T', 12) - * x.toString() // '10' - * x.toString(12) // 'T' - * ``` - */ - ALPHABET?: string; - } - - /** - * See `FORMAT` and `toFormat`. - */ - declare interface Format { - /** - * The decimal separator. - */ - decimalSeparator?: string; - - /** - * The grouping separator of the integer part. - */ - groupSeparator?: string; - - /** - * The primary grouping size of the integer part. - */ - groupSize?: number; - - /** - * The secondary grouping size of the integer part. - */ - secondaryGroupSize?: number; - - /** - * The grouping separator of the fraction part. - */ - fractionGroupSeparator?: string; - - /** - * The grouping size of the fraction part. - */ - fractionGroupSize?: number; - } - - declare type Instance = BigNumber; - declare type ModuloMode = 0 | 1 | 3 | 6 | 9; - declare type RoundingMode = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8; - declare type Value = string | number | BigNumber; - declare type Constructor = typeof BigNumber; - - declare class BigNumber { - /** - * The coefficient of the value of this BigNumber, an array of base 1e14 integer numbers. - */ - c: number[]; - - /** - * The exponent of the value of this BigNumber, an integer number, -1000000000 to 1000000000. - */ - e: number; - - /** - * The sign of the value of this BigNumber, -1 or 1. - */ - s: number; - - /** - * Returns a new instance of a BigNumber object with value `n`, where `n` is a numeric value in - * the specified `base`, or base 10 if `base` is omitted or is `null` or `undefined`. - - ```ts - x = new BigNumber(123.4567) // '123.4567' - // 'new' is optional - y = BigNumber(x) // '123.4567' - ``` - - If `n` is a base 10 value it can be in normal (fixed-point) or exponential notation. - Values in other bases must be in normal notation. Values in any base can have fraction digits, - i.e. digits after the decimal point. - - ```ts - new BigNumber(43210) // '43210' - new BigNumber('4.321e+4') // '43210' - new BigNumber('-735.0918e-430') // '-7.350918e-428' - new BigNumber('123412421.234324', 5) // '607236.557696' - ``` - - Signed `0`, signed `Infinity` and `NaN` are supported. - - ```ts - new BigNumber('-Infinity') // '-Infinity' - new BigNumber(NaN) // 'NaN' - new BigNumber(-0) // '0' - new BigNumber('.5') // '0.5' - new BigNumber('+2') // '2' - ``` - - String values in hexadecimal literal form, e.g. `'0xff'`, are valid, as are string values with - the octal and binary prefixs `'0o'` and `'0b'`. String values in octal literal form without the - prefix will be interpreted as decimals, e.g. `'011'` is interpreted as 11, not 9. - - ```ts - new BigNumber(-10110100.1, 2) // '-180.5' - new BigNumber('-0b10110100.1') // '-180.5' - new BigNumber('ff.8', 16) // '255.5' - new BigNumber('0xff.8') // '255.5' - ``` - - If a base is specified, `n` is rounded according to the current `DECIMAL_PLACES` and - `ROUNDING_MODE` settings. This includes base 10, so don't include a `base` parameter for decimal - values unless this behaviour is desired. - - ```ts - BigNumber.config({ DECIMAL_PLACES: 5 }) - new BigNumber(1.23456789) // '1.23456789' - new BigNumber(1.23456789, 10) // '1.23457' - ``` - - An error is thrown if `base` is invalid. - - There is no limit to the number of digits of a value of type string (other than that of - JavaScript's maximum array size). See `RANGE` to set the maximum and minimum possible exponent - value of a BigNumber. - - ```ts - new BigNumber('5032485723458348569331745.33434346346912144534543') - new BigNumber('4.321e10000000') - ``` - - BigNumber `NaN` is returned if `n` is invalid (unless `BigNumber.DEBUG` is `true`, see below). - - ```ts - new BigNumber('.1*') // 'NaN' - new BigNumber('blurgh') // 'NaN' - new BigNumber(9, 2) // 'NaN' - ``` - - To aid in debugging, if `BigNumber.DEBUG` is `true` then an error will be thrown on an - invalid `n`. An error will also be thrown if `n` is of type number with more than 15 - significant digits, as calling `toString` or `valueOf` on these numbers may not result in the - intended value. - - ```ts - console.log(823456789123456.3) // 823456789123456.2 - new BigNumber(823456789123456.3) // '823456789123456.2' - BigNumber.DEBUG = true - // 'Error: Number has more than 15 significant digits' - new BigNumber(823456789123456.3) - // 'Error: Not a base 2 number' - new BigNumber(9, 2) - ``` - * @param A numeric value. - * @param The base of `n`, integer, 2 to 36 (or `ALPHABET.length`, see `ALPHABET`). - */ - constructor(n: Value, base?: number): BigNumber; - static (n: Value, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the absolute value, i.e. the magnitude, of the value of this - * BigNumber. - - The return value is always exact and unrounded. - - ```ts - x = new BigNumber(-0.8) - x.absoluteValue() // '0.8' - ``` - */ - absoluteValue(): BigNumber; - - /** - * Returns a BigNumber whose value is the absolute value, i.e. the magnitude, of the value of this - * BigNumber. - - The return value is always exact and unrounded. - - ```ts - x = new BigNumber(-0.8) - x.abs() // '0.8' - ``` - */ - abs(): BigNumber; - - /** - * Returns | | - * :-------:|:--------------------------------------------------------------| - 1 | If the value of this BigNumber is greater than the value of `n` - -1 | If the value of this BigNumber is less than the value of `n` - 0 | If this BigNumber and `n` have the same value - `null` | If the value of either this BigNumber or `n` is `NaN` - - ```ts - - x = new BigNumber(Infinity) - y = new BigNumber(5) - x.comparedTo(y) // 1 - x.comparedTo(x.minus(1)) // 0 - y.comparedTo(NaN) // null - y.comparedTo('110', 2) // -1 - ``` - * @param A numeric value. - * @param The base of n. - */ - comparedTo(n: Value, base?: number): number; - - /** - * Returns a BigNumber whose value is the value of this BigNumber rounded by rounding mode - * `roundingMode` to a maximum of `decimalPlaces` decimal places. - - If `decimalPlaces` is omitted, or is `null` or `undefined`, the return value is the number of - decimal places of the value of this BigNumber, or `null` if the value of this BigNumber is - ±`Infinity` or `NaN`. - - If `roundingMode` is omitted, or is `null` or `undefined`, `ROUNDING_MODE` is used. - - Throws if `decimalPlaces` or `roundingMode` is invalid. - - ```ts - x = new BigNumber(1234.56) - x.decimalPlaces() // 2 - x.decimalPlaces(1) // '1234.6' - x.decimalPlaces(2) // '1234.56' - x.decimalPlaces(10) // '1234.56' - x.decimalPlaces(0, 1) // '1234' - x.decimalPlaces(0, 6) // '1235' - x.decimalPlaces(1, 1) // '1234.5' - x.decimalPlaces(1, BigNumber.ROUND_HALF_EVEN) // '1234.6' - x // '1234.56' - y = new BigNumber('9.9e-101') - y.decimalPlaces() // 102 - ``` - * @param Decimal places, integer, 0 to 1e+9. - * @param Rounding mode, integer, 0 to 8. - */ - decimalPlaces(): number; - decimalPlaces( - decimalPlaces: number, - roundingMode?: RoundingMode - ): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber rounded by rounding mode - * `roundingMode` to a maximum of `decimalPlaces` decimal places. - - If `decimalPlaces` is omitted, or is `null` or `undefined`, the return value is the number of - decimal places of the value of this BigNumber, or `null` if the value of this BigNumber is - ±`Infinity` or `NaN`. - - If `roundingMode` is omitted, or is `null` or `undefined`, `ROUNDING_MODE` is used. - - Throws if `decimalPlaces` or `roundingMode` is invalid. - - ```ts - x = new BigNumber(1234.56) - x.dp() // 2 - x.dp(1) // '1234.6' - x.dp(2) // '1234.56' - x.dp(10) // '1234.56' - x.dp(0, 1) // '1234' - x.dp(0, 6) // '1235' - x.dp(1, 1) // '1234.5' - x.dp(1, BigNumber.ROUND_HALF_EVEN) // '1234.6' - x // '1234.56' - y = new BigNumber('9.9e-101') - y.dp() // 102 - ``` - * @param Decimal places, integer, 0 to 1e+9. - * @param Rounding mode, integer, 0 to 8. - */ - dp(): number; - dp(decimalPlaces: number, roundingMode?: RoundingMode): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber divided by `n`, rounded - * according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` settings. - - ```ts - x = new BigNumber(355) - y = new BigNumber(113) - x.dividedBy(y) // '3.14159292035398230088' - x.dividedBy(5) // '71' - x.dividedBy(47, 16) // '5' - ``` - * @param A numeric value. - * @param The base of n. - */ - dividedBy(n: Value, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber divided by `n`, rounded - * according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` settings. - - ```ts - x = new BigNumber(355) - y = new BigNumber(113) - x.div(y) // '3.14159292035398230088' - x.div(5) // '71' - x.div(47, 16) // '5' - ``` - * @param A numeric value. - * @param The base of n. - */ - div(n: Value, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the integer part of dividing the value of this BigNumber by - * `n`. - - ```ts - x = new BigNumber(5) - y = new BigNumber(3) - x.dividedToIntegerBy(y) // '1' - x.dividedToIntegerBy(0.7) // '7' - x.dividedToIntegerBy('0.f', 16) // '5' - ``` - * @param A numeric value. - * @param The base of n. - */ - dividedToIntegerBy(n: Value, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the integer part of dividing the value of this BigNumber by - * `n`. - - ```ts - x = new BigNumber(5) - y = new BigNumber(3) - x.idiv(y) // '1' - x.idiv(0.7) // '7' - x.idiv('0.f', 16) // '5' - ``` - * @param A numeric value. - * @param The base of n. - */ - idiv(n: Value, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber exponentiated by `n`, i.e. - * raised to the power `n`, and optionally modulo a modulus `m`. - - If `n` is negative the result is rounded according to the current `DECIMAL_PLACES` and - `ROUNDING_MODE` settings. - - As the number of digits of the result of the power operation can grow so large so quickly, - e.g. 123.456**10000 has over 50000 digits, the number of significant digits calculated is - limited to the value of the `POW_PRECISION` setting (unless a modulus `m` is specified). - - By default `POW_PRECISION` is set to 0. This means that an unlimited number of significant - digits will be calculated, and that the method's performance will decrease dramatically for - larger exponents. - - If `m` is specified and the value of `m`, `n` and this BigNumber are integers and `n` is - positive, then a fast modular exponentiation algorithm is used, otherwise the operation will - be performed as `x.exponentiatedBy(n).modulo(m)` with a `POW_PRECISION` of 0. - - Throws if `n` is not an integer. - - ```ts - Math.pow(0.7, 2) // 0.48999999999999994 - x = new BigNumber(0.7) - x.exponentiatedBy(2) // '0.49' - BigNumber(3).exponentiatedBy(-2) // '0.11111111111111111111' - ``` - * @param The exponent, an integer. - * @param The modulus. - */ - exponentiatedBy(n: number, m?: Value): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber exponentiated by `n`, i.e. - * raised to the power `n`, and optionally modulo a modulus `m`. - - If `n` is negative the result is rounded according to the current `DECIMAL_PLACES` and - `ROUNDING_MODE` settings. - - As the number of digits of the result of the power operation can grow so large so quickly, - e.g. 123.456**10000 has over 50000 digits, the number of significant digits calculated is - limited to the value of the `POW_PRECISION` setting (unless a modulus `m` is specified). - - By default `POW_PRECISION` is set to 0. This means that an unlimited number of significant - digits will be calculated, and that the method's performance will decrease dramatically for - larger exponents. - - If `m` is specified and the value of `m`, `n` and this BigNumber are integers and `n` is - positive, then a fast modular exponentiation algorithm is used, otherwise the operation will - be performed as `x.pow(n).modulo(m)` with a `POW_PRECISION` of 0. - - Throws if `n` is not an integer. - - ```ts - Math.pow(0.7, 2) // 0.48999999999999994 - x = new BigNumber(0.7) - x.pow(2) // '0.49' - BigNumber(3).pow(-2) // '0.11111111111111111111' - ``` - * @param The exponent, an integer. - * @param The modulus. - */ - pow(n: number, m?: Value): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber rounded to an integer using - * rounding mode `rm`. - - If `rm` is omitted, or is `null` or `undefined`, `ROUNDING_MODE` is used. - - Throws if `rm` is invalid. - - ```ts - x = new BigNumber(123.456) - x.integerValue() // '123' - x.integerValue(BigNumber.ROUND_CEIL) // '124' - y = new BigNumber(-12.7) - y.integerValue() // '-13' - x.integerValue(BigNumber.ROUND_DOWN) // '-12' - ``` - * @param The roundng mode, an integer, 0 to 8. - */ - integerValue(rm?: RoundingMode): BigNumber; - - /** - * Returns `true` if the value of this BigNumber is equal to the value of `n`, otherwise returns - * `false`. - - As with JavaScript, `NaN` does not equal `NaN`. - - ```ts - 0 === 1e-324 // true - x = new BigNumber(0) - x.isEqualTo('1e-324') // false - BigNumber(-0).isEqualTo(x) // true ( -0 === 0 ) - BigNumber(255).isEqualTo('ff', 16) // true - - y = new BigNumber(NaN) - y.isEqualTo(NaN) // false - ``` - * @param A numeric value. - * @param The base of n. - */ - isEqualTo(n: Value, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is equal to the value of `n`, otherwise returns - * `false`. - - As with JavaScript, `NaN` does not equal `NaN`. - - ```ts - 0 === 1e-324 // true - x = new BigNumber(0) - x.eq('1e-324') // false - BigNumber(-0).eq(x) // true ( -0 === 0 ) - BigNumber(255).eq('ff', 16) // true - - y = new BigNumber(NaN) - y.eq(NaN) // false - ``` - * @param A numeric value. - * @param The base of n. - */ - eq(n: Value, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is a finite number, otherwise returns `false`. - * - The only possible non-finite values of a BigNumber are `NaN`, `Infinity` and `-Infinity`. - - ```ts - x = new BigNumber(1) - x.isFinite() // true - y = new BigNumber(Infinity) - y.isFinite() // false - ``` - */ - isFinite(): boolean; - - /** - * Returns `true` if the value of this BigNumber is greater than the value of `n`, otherwise - * returns `false`. - - ```ts - 0.1>(0.3 - 0.2) // true - x = new BigNumber(0.1) - x.isGreaterThan(BigNumber(0.3).minus(0.2)) // false - BigNumber(0).isGreaterThan(x) // false - BigNumber(11, 3).isGreaterThan(11.1, 2) // true - ``` - * @param A numeric value. - * @param The base of n. - */ - isGreaterThan(n: Value, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is greater than the value of `n`, otherwise - * returns `false`. - - ```ts - 0.1>(0.3 - 0 // true - x = new BigNumber(0.1) - x.gt(BigNumber(0.3).minus(0.2)) // false - BigNumber(0).gt(x) // false - BigNumber(11, 3).gt(11.1, 2) // true - ``` - * @param A numeric value. - * @param The base of n. - */ - gt(n: Value, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is greater than or equal to the value of `n`, - * otherwise returns `false`. - - ```ts - (0.3 - 0.2) >= 0.1 // false - x = new BigNumber(0.3).minus(0.2) - x.isGreaterThanOrEqualTo(0.1) // true - BigNumber(1).isGreaterThanOrEqualTo(x) // true - BigNumber(10, 18).isGreaterThanOrEqualTo('i', 36) // true - ``` - * @param A numeric value. - * @param The base of n. - */ - isGreaterThanOrEqualTo(n: Value, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is greater than or equal to the value of `n`, - * otherwise returns `false`. - - ```ts - (0.3 - 0.2) >= 0.1 // false - x = new BigNumber(0.3).minus(0.2) - x.gte(0.1) // true - BigNumber(1).gte(x) // true - BigNumber(10, 18).gte('i', 36) // true - ``` - * @param A numeric value. - * @param The base of n. - */ - gte(n: Value, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is an integer, otherwise returns `false`. - * - ```ts - x = new BigNumber(1) - x.isInteger() // true - y = new BigNumber(123.456) - y.isInteger() // false - ``` - */ - isInteger(): boolean; - - /** - * Returns `true` if the value of this BigNumber is less than the value of `n`, otherwise returns - * `false`. - - ```ts - (0.3 - 0.2)<0.1 // true - x = new BigNumber(0.3).minus(0.2) - x.isLessThan(0.1) // false - BigNumber(0).isLessThan(x) // true - BigNumber(11.1, 2).isLessThan(11, 3) // true - ``` - * @param A numeric value. - * @param The base of n. - */ - isLessThan(n: Value, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is less than the value of `n`, otherwise returns - * `false`. - - ```ts - (0.3 - 0.2)<0.1 // true - x = new BigNumber(0.3).minus(0.2) - x.lt(0.1) // false - BigNumber(0).lt(x) // true - BigNumber(11.1, 2).lt(11, 3) // true - ``` - * @param A numeric value. - * @param The base of n. - */ - lt(n: Value, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is less than or equal to the value of `n`, - * otherwise returns `false`. - - ```ts - 0.1 <= (0.3 - 0.2) // false - x = new BigNumber(0.1) - x.isLessThanOrEqualTo(BigNumber(0.3).minus(0.2)) // true - BigNumber(-1).isLessThanOrEqualTo(x) // true - BigNumber(10, 18).isLessThanOrEqualTo('i', 36) // true - ``` - * @param A numeric value. - * @param The base of n. - */ - isLessThanOrEqualTo(n: Value, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is less than or equal to the value of `n`, - * otherwise returns `false`. - - ```ts - 0.1 <= (0.3 - 0.2) // false - x = new BigNumber(0.1) - x.lte(BigNumber(0.3).minus(0.2)) // true - BigNumber(-1).lte(x) // true - BigNumber(10, 18).lte('i', 36) // true - ``` - * @param A numeric value. - * @param The base of n. - */ - lte(n: Value, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is `NaN`, otherwise returns `false`. - * - ```ts - x = new BigNumber(NaN) - x.isNaN() // true - y = new BigNumber('Infinity') - y.isNaN() // false - ``` - */ - isNaN(): boolean; - - /** - * Returns `true` if the value of this BigNumber is negative, otherwise returns `false`. - * - ```ts - x = new BigNumber(-0) - x.isNegative() // true - y = new BigNumber(2) - y.isNegative() // false - ``` - */ - isNegative(): boolean; - - /** - * Returns `true` if the value of this BigNumber is positive, otherwise returns `false`. - * - ```ts - x = new BigNumber(-0) - x.isPositive() // false - y = new BigNumber(2) - y.isPositive() // true - ``` - */ - isPositive(): boolean; - - /** - * Returns `true` if the value of this BigNumber is zero or minus zero, otherwise returns `false`. - * - ```ts - x = new BigNumber(-0) - x.isZero() // true - ``` - */ - isZero(): boolean; - - /** - * Returns a BigNumber whose value is the value of this BigNumber minus `n`. - * - The return value is always exact and unrounded. - - ```ts - 0.3 - 0.1 // 0.19999999999999998 - x = new BigNumber(0.3) - x.minus(0.1) // '0.2' - x.minus(0.6, 20) // '0' - ``` - * @param A numeric value. - * @param The base of n. - */ - minus(n: Value, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber modulo `n`, i.e. the integer - * remainder of dividing this BigNumber by `n`. - - The value returned, and in particular its sign, is dependent on the value of the `MODULO_MODE` - setting of this BigNumber constructor. If it is 1 (default value), the result will have the - same sign as this BigNumber, and it will match that of Javascript's `%` operator (within the - limits of double precision) and BigDecimal's `remainder` method. - - The return value is always exact and unrounded. - - See `MODULO_MODE` for a description of the other modulo modes. - - ```ts - 1 % 0.9 // 0.09999999999999998 - x = new BigNumber(1) - x.modulo(0.9) // '0.1' - y = new BigNumber(33) - y.modulo('a', 33) // '3' - ``` - * @param A numeric value. - * @param The base of n. - */ - modulo(n: Value, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber modulo `n`, i.e. the integer - * remainder of dividing this BigNumber by `n`. - - The value returned, and in particular its sign, is dependent on the value of the `MODULO_MODE` - setting of this BigNumber constructor. If it is 1 (default value), the result will have the - same sign as this BigNumber, and it will match that of Javascript's `%` operator (within the - limits of double precision) and BigDecimal's `remainder` method. - - The return value is always exact and unrounded. - - See `MODULO_MODE` for a description of the other modulo modes. - - ```ts - 1 % 0.9 // 0.09999999999999998 - x = new BigNumber(1) - x.mod(0.9) // '0.1' - y = new BigNumber(33) - y.mod('a', 33) // '3' - ``` - * @param A numeric value. - * @param The base of n. - */ - mod(n: Value, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber multiplied by `n`. - * - The return value is always exact and unrounded. - - ```ts - 0.6 * 3 // 1.7999999999999998 - x = new BigNumber(0.6) - y = x.multipliedBy(3) // '1.8' - BigNumber('7e+500').multipliedBy(y) // '1.26e+501' - x.multipliedBy('-a', 16) // '-6' - ``` - * @param A numeric value. - * @param The base of n. - */ - multipliedBy(n: Value, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber multiplied by `n`. - * - The return value is always exact and unrounded. - - ```ts - 0.6 * 3 // 1.7999999999999998 - x = new BigNumber(0.6) - y = x.times(3) // '1.8' - BigNumber('7e+500').times(y) // '1.26e+501' - x.times('-a', 16) // '-6' - ``` - * @param A numeric value. - * @param The base of n. - */ - times(n: Value, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber negated, i.e. multiplied by -1. - * - ```ts - x = new BigNumber(1.8) - x.negated() // '-1.8' - y = new BigNumber(-1.3) - y.negated() // '1.3' - ``` - */ - negated(): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber plus `n`. - * - The return value is always exact and unrounded. - - ```ts - 0.1 + 0.2 // 0.30000000000000004 - x = new BigNumber(0.1) - y = x.plus(0.2) // '0.3' - BigNumber(0.7).plus(x).plus(y) // '1' - x.plus('0.1', 8) // '0.225' - ``` - * @param A numeric value. - * @param The base of n. - */ - plus(n: Value, base?: number): BigNumber; - - /** - * Returns the number of significant digits of the value of this BigNumber, or `null` if the value - * of this BigNumber is ±`Infinity` or `NaN`. - - If `includeZeros` is true then any trailing zeros of the integer part of the value of this - BigNumber are counted as significant digits, otherwise they are not. - - Throws if `includeZeros` is invalid. - - ```ts - x = new BigNumber(9876.54321) - x.precision() // 9 - y = new BigNumber(987000) - y.precision(false) // 3 - y.precision(true) // 6 - ``` - * @param Whether to include integer trailing zeros in the significant digit count. - */ - precision(includeZeros?: boolean): number; - - /** - * Returns a BigNumber whose value is the value of this BigNumber rounded to a precision of - * `significantDigits` significant digits using rounding mode `roundingMode`. - - If `roundingMode` is omitted or is `null` or `undefined`, `ROUNDING_MODE` will be used. - - Throws if `significantDigits` or `roundingMode` is invalid. - - ```ts - x = new BigNumber(9876.54321) - x.precision(6) // '9876.54' - x.precision(6, BigNumber.ROUND_UP) // '9876.55' - x.precision(2) // '9900' - x.precision(2, 1) // '9800' - x // '9876.54321' - ``` - * @param Significant digits, integer, 1 to 1e+9. - * @param Rounding mode, integer, 0 to 8. - */ - precision( - significantDigits: number, - roundingMode?: RoundingMode - ): BigNumber; - - /** - * Returns the number of significant digits of the value of this BigNumber, - * or `null` if the value of this BigNumber is ±`Infinity` or `NaN`. - - If `includeZeros` is true then any trailing zeros of the integer part of - the value of this BigNumber are counted as significant digits, otherwise - they are not. - - Throws if `includeZeros` is invalid. - - ```ts - x = new BigNumber(9876.54321) - x.sd() // 9 - y = new BigNumber(987000) - y.sd(false) // 3 - y.sd(true) // 6 - ``` - * @param Whether to include integer trailing zeros in the significant digit count. - */ - sd(includeZeros?: boolean): number; - sd(significantDigits: number, roundingMode?: RoundingMode): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber shifted by `n` places. - * - The shift is of the decimal point, i.e. of powers of ten, and is to the left if `n` is negative - or to the right if `n` is positive. - - The return value is always exact and unrounded. - - Throws if `n` is invalid. - - ```ts - x = new BigNumber(1.23) - x.shiftedBy(3) // '1230' - x.shiftedBy(-3) // '0.00123' - ``` - * @param The shift value, integer, -9007199254740991 to 9007199254740991. - */ - shiftedBy(n: number): BigNumber; - - /** - * Returns a BigNumber whose value is the square root of the value of this BigNumber, rounded - * according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` settings. - - The return value will be correctly rounded, i.e. rounded as if the result was first calculated - to an infinite number of correct digits before rounding. - - ```ts - x = new BigNumber(16) - x.squareRoot() // '4' - y = new BigNumber(3) - y.squareRoot() // '1.73205080756887729353' - ``` - */ - squareRoot(): BigNumber; - - /** - * Returns a BigNumber whose value is the square root of the value of this BigNumber, rounded - * according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` settings. - - The return value will be correctly rounded, i.e. rounded as if the result was first calculated - to an infinite number of correct digits before rounding. - - ```ts - x = new BigNumber(16) - x.sqrt() // '4' - y = new BigNumber(3) - y.sqrt() // '1.73205080756887729353' - ``` - */ - sqrt(): BigNumber; - - /** - * Returns a string representing the value of this BigNumber in exponential notation rounded using - * rounding mode `roundingMode` to `decimalPlaces` decimal places, i.e with one digit before the - decimal point and `decimalPlaces` digits after it. - - If the value of this BigNumber in exponential notation has fewer than `decimalPlaces` fraction - digits, the return value will be appended with zeros accordingly. - - If `decimalPlaces` is omitted, or is `null` or `undefined`, the number of digits after the - decimal point defaults to the minimum number of digits necessary to represent the value - exactly. - - If `roundingMode` is omitted or is `null` or `undefined`, `ROUNDING_MODE` is used. - - Throws if `decimalPlaces` or `roundingMode` is invalid. - - ```ts - x = 45.6 - y = new BigNumber(x) - x.toExponential() // '4.56e+1' - y.toExponential() // '4.56e+1' - x.toExponential(0) // '5e+1' - y.toExponential(0) // '5e+1' - x.toExponential(1) // '4.6e+1' - y.toExponential(1) // '4.6e+1' - y.toExponential(1, 1) // '4.5e+1' (ROUND_DOWN) - x.toExponential(3) // '4.560e+1' - y.toExponential(3) // '4.560e+1' - ``` - * @param Decimal places, integer, 0 to 1e+9. - * @param Rounding mode, integer, 0 to 8. - */ - toExponential(decimalPlaces?: number, roundingMode?: RoundingMode): string; - - /** - * Returns a string representing the value of this BigNumber in normal (fixed-point) notation - * rounded to `decimalPlaces` decimal places using rounding mode `roundingMode`. - - If the value of this BigNumber in normal notation has fewer than `decimalPlaces` fraction - digits, the return value will be appended with zeros accordingly. - - Unlike `Number.prototype.toFixed`, which returns exponential notation if a number is greater or - equal to 10**21, this method will always return normal notation. - - If `decimalPlaces` is omitted or is `null` or `undefined`, the return value will be unrounded - and in normal notation. This is also unlike `Number.prototype.toFixed`, which returns the value - to zero decimal places. It is useful when normal notation is required and the current - `EXPONENTIAL_AT` setting causes `toString` to return exponential notation. - - If `roundingMode` is omitted or is `null` or `undefined`, `ROUNDING_MODE` is used. - - Throws if `decimalPlaces` or `roundingMode` is invalid. - - ```ts - x = 3.456 - y = new BigNumber(x) - x.toFixed() // '3' - y.toFixed() // '3.456' - y.toFixed(0) // '3' - x.toFixed(2) // '3.46' - y.toFixed(2) // '3.46' - y.toFixed(2, 1) // '3.45' (ROUND_DOWN) - x.toFixed(5) // '3.45600' - y.toFixed(5) // '3.45600' - ``` - * @param Decimal places, integer, 0 to 1e+9. - * @param Rounding mode, integer, 0 to 8. - */ - toFixed(decimalPlaces?: number, roundingMode?: RoundingMode): string; - - /** - * Returns a string representing the value of this BigNumber in normal (fixed-point) notation - * rounded to `decimalPlaces` decimal places using rounding mode `roundingMode`, and formatted - according to the properties of the `FORMAT` object. - - The properties of the `FORMAT` object are shown in the examples below. - - If `decimalPlaces` is omitted or is `null` or `undefined`, then the return value is not - rounded to a fixed number of decimal places. - - If `roundingMode` is omitted or is `null` or `undefined`, `ROUNDING_MODE` is used. - - Throws if `decimalPlaces` or `roundingMode` is invalid. - - ```ts - format = { - decimalSeparator: '.', - groupSeparator: ',', - groupSize: 3, - secondaryGroupSize: 0, - fractionGroupSeparator: ' ', - fractionGroupSize: 0 - } - BigNumber.config({ FORMAT: format }) - - x = new BigNumber('123456789.123456789') - x.toFormat() // '123,456,789.123456789' - x.toFormat(1) // '123,456,789.1' - - format.groupSeparator = ' ' - format.fractionGroupSize = 5 - x.toFormat() // '123 456 789.12345 6789' - - BigNumber.config({ - FORMAT: { - decimalSeparator: ',', - groupSeparator: '.', - groupSize: 3, - secondaryGroupSize: 2 - } - }) - - x.toFormat(6) // '12.34.56.789,123' - ``` - * @param Decimal places, integer, 0 to 1e+9. - * @param Rounding mode, integer, 0 to 8. - */ - toFormat(decimalPlaces?: number, roundingMode?: RoundingMode): string; - - /** - * Returns a string array representing the value of this BigNumber as a simple fraction with an - * integer numerator and an integer denominator. The denominator will be a positive non-zero value - less than or equal to `max_denominator`. - - If a maximum denominator, `max_denominator`, is not specified, or is `null` or `undefined`, the - denominator will be the lowest value necessary to represent the number exactly. - - Throws if `max_denominator` is invalid. - - ```ts - x = new BigNumber(1.75) - x.toFraction() // '7, 4' - - pi = new BigNumber('3.14159265358') - pi.toFraction() // '157079632679,50000000000' - pi.toFraction(100000) // '312689, 99532' - pi.toFraction(10000) // '355, 113' - pi.toFraction(100) // '311, 99' - pi.toFraction(10) // '22, 7' - pi.toFraction(1) // '3, 1' - ``` - * @param The maximum denominator, integer>0, or Infinity. - */ - toFraction(max_denominator?: Value): BigNumber[]; - - /** - * As `valueOf`. - */ - toJSON(): string; - - /** - * Returns the value of this BigNumber as a JavaScript primitive number. - * - Using the unary plus operator gives the same result. - - ```ts - x = new BigNumber(456.789) - x.toNumber() // 456.789 - +x // 456.789 - - y = new BigNumber('45987349857634085409857349856430985') - y.toNumber() // 4.598734985763409e+34 - - z = new BigNumber(-0) - 1 / z.toNumber() // -Infinity - 1 / +z // -Infinity - ``` - */ - toNumber(): number; - - /** - * Returns a string representing the value of this BigNumber rounded to `significantDigits` - * significant digits using rounding mode `roundingMode`. - - If `significantDigits` is less than the number of digits necessary to represent the integer - part of the value in normal (fixed-point) notation, then exponential notation is used. - - If `significantDigits` is omitted, or is `null` or `undefined`, then the return value is the - same as `n.toString()`. - - If `roundingMode` is omitted or is `null` or `undefined`, `ROUNDING_MODE` is used. - - Throws if `significantDigits` or `roundingMode` is invalid. - - ```ts - x = 45.6 - y = new BigNumber(x) - x.toPrecision() // '45.6' - y.toPrecision() // '45.6' - x.toPrecision(1) // '5e+1' - y.toPrecision(1) // '5e+1' - y.toPrecision(2, 0) // '4.6e+1' (ROUND_UP) - y.toPrecision(2, 1) // '4.5e+1' (ROUND_DOWN) - x.toPrecision(5) // '45.600' - y.toPrecision(5) // '45.600' - ``` - * @param Significant digits, integer, 1 to 1e+9. - * @param Rounding mode, integer 0 to 8. - */ - toPrecision( - significantDigits?: number, - roundingMode?: RoundingMode - ): string; - - /** - * Returns a string representing the value of this BigNumber in base `base`, or base 10 if `base` - * is omitted or is `null` or `undefined`. - - For bases above 10, and using the default base conversion alphabet (see `ALPHABET`), values - from 10 to 35 are represented by a-z (the same as `Number.prototype.toString`). - - If a base is specified the value is rounded according to the current `DECIMAL_PLACES` and - `ROUNDING_MODE` settings, otherwise it is not. - - If a base is not specified, and this BigNumber has a positive exponent that is equal to or - greater than the positive component of the current `EXPONENTIAL_AT` setting, or a negative - exponent equal to or less than the negative component of the setting, then exponential notation - is returned. - - If `base` is `null` or `undefined` it is ignored. - - Throws if `base` is invalid. - - ```ts - x = new BigNumber(750000) - x.toString() // '750000' - BigNumber.config({ EXPONENTIAL_AT: 5 }) - x.toString() // '7.5e+5' - - y = new BigNumber(362.875) - y.toString(2) // '101101010.111' - y.toString(9) // '442.77777777777777777778' - y.toString(32) // 'ba.s' - - BigNumber.config({ DECIMAL_PLACES: 4 }); - z = new BigNumber('1.23456789') - z.toString() // '1.23456789' - z.toString(10) // '1.2346' - ``` - * @param The base, integer, 2 to 36 (or `ALPHABET.length`, see `ALPHABET`). - */ - toString(base?: number): string; - - /** - * As `toString`, but does not accept a base argument and includes the minus sign for negative - * zero. - - ``ts - x = new BigNumber('-0') - x.toString() // '0' - x.valueOf() // '-0' - y = new BigNumber('1.777e+457') - y.valueOf() // '1.777e+457' - ``` - */ - valueOf(): string; - - /** - * Returns a new independent BigNumber constructor with configuration as described by `object`, or - * with the default configuration if object is `null` or `undefined`. - - Throws if `object` is not an object. - - ```ts - BigNumber.config({ DECIMAL_PLACES: 5 }) - BN = BigNumber.clone({ DECIMAL_PLACES: 9 }) - - x = new BigNumber(1) - y = new BN(1) - - x.div(3) // 0.33333 - y.div(3) // 0.333333333 - - // BN = BigNumber.clone({ DECIMAL_PLACES: 9 }) is equivalent to: - BN = BigNumber.clone() - BN.config({ DECIMAL_PLACES: 9 }) - ``` - * @param The configuration object. - */ - static clone(object?: Config): Constructor; - - /** - * Configures the settings that apply to this BigNumber constructor. - * - The configuration object, `object`, contains any number of the properties shown in the example - below. - - Returns an object with the above properties and their current values. - - Throws if `object` is not an object, or if an invalid value is assigned to one or more of the - properties. - - ```ts - BigNumber.config({ - DECIMAL_PLACES: 40, - ROUNDING_MODE: BigNumber.ROUND_HALF_CEIL, - EXPONENTIAL_AT: [-10, 20], - RANGE: [-500, 500], - CRYPTO: true, - MODULO_MODE: BigNumber.ROUND_FLOOR, - POW_PRECISION: 80, - FORMAT: { - groupSize: 3, - groupSeparator: ' ', - decimalSeparator: ',' - }, - ALPHABET: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_' - }); - - BigNumber.config().DECIMAL_PLACES // 40 - ``` - * @param The configuration object. - */ - static config(object: Config): Config; - - /** - * Returns `true` if `value` is a BigNumber instance, otherwise returns `false`. - * - ```ts - x = 42 - y = new BigNumber(x) - - BigNumber.isBigNumber(x) // false - y instanceof BigNumber // true - BigNumber.isBigNumber(y) // true - - BN = BigNumber.clone(); - z = new BN(x) - z instanceof BigNumber // false - BigNumber.isBigNumber(z) // true - ``` - * @param The value to test. - */ - static isBigNumber(value: any): boolean; - - /** - * Returns a BigNumber whose value is the maximum of the arguments. - * - Accepts either an argument list or an array of values. - - The return value is always exact and unrounded. - - ```ts - x = new BigNumber('3257869345.0378653') - BigNumber.maximum(4e9, x, '123456789.9') // '4000000000' - - arr = [12, '13', new BigNumber(14)] - BigNumber.maximum(arr) // '14' - ``` - * @param A numeric value. - */ - static maximum(...n: Value[]): BigNumber; - - /** - * Returns a BigNumber whose value is the maximum of the arguments. - * - Accepts either an argument list or an array of values. - - The return value is always exact and unrounded. - - ```ts - x = new BigNumber('3257869345.0378653') - BigNumber.max(4e9, x, '123456789.9') // '4000000000' - - arr = [12, '13', new BigNumber(14)] - BigNumber.max(arr) // '14' - ``` - * @param A numeric value. - */ - static max(...n: Value[]): BigNumber; - - /** - * Returns a BigNumber whose value is the minimum of the arguments. - * - Accepts either an argument list or an array of values. - - The return value is always exact and unrounded. - - ```ts - x = new BigNumber('3257869345.0378653') - BigNumber.minimum(4e9, x, '123456789.9') // '123456789.9' - - arr = [2, new BigNumber(-14), '-15.9999', -12] - BigNumber.minimum(arr) // '-15.9999' - ``` - * @param A numeric value. - */ - static minimum(...n: Value[]): BigNumber; - - /** - * Returns a BigNumber whose value is the minimum of the arguments. - * - Accepts either an argument list or an array of values. - - The return value is always exact and unrounded. - - ```ts - x = new BigNumber('3257869345.0378653') - BigNumber.min(4e9, x, '123456789.9') // '123456789.9' - - arr = [2, new BigNumber(-14), '-15.9999', -12] - BigNumber.min(arr) // '-15.9999' - ``` - * @param A numeric value. - */ - static min(...n: Value[]): BigNumber; - - /** - * Returns a new BigNumber with a pseudo-random value equal to or greater than 0 and less than 1. - * - The return value will have `decimalPlaces` decimal places, or less if trailing zeros are - produced. If `decimalPlaces` is omitted, the current `DECIMAL_PLACES` setting will be used. - - Depending on the value of this BigNumber constructor's `CRYPTO` setting and the support for the - `crypto` object in the host environment, the random digits of the return value are generated by - either `Math.random` (fastest), `crypto.getRandomValues` (Web Cryptography API in recent - browsers) or `crypto.randomBytes` (Node.js). - - If `CRYPTO` is true, i.e. one of the `crypto` methods is to be used, the value of a returned - BigNumber should be cryptographically secure and statistically indistinguishable from a random - value. - - Throws if `decimalPlaces` is invalid. - - ```ts - BigNumber.config({ DECIMAL_PLACES: 10 }) - BigNumber.random() // '0.4117936847' - BigNumber.random(20) // '0.78193327636914089009' - ``` - * @param Decimal places, integer, 0 to 1e+9. - */ - static random(decimalPlaces?: number): BigNumber; - - /** - * Configures the settings that apply to this BigNumber constructor. - * - The configuration object, `object`, contains any number of the properties shown in the example - below. - - Returns an object with the above properties and their current values. - - Throws if `object` is not an object, or if an invalid value is assigned to one or more of the - properties. - - ```ts - BigNumber.set({ - DECIMAL_PLACES: 40, - ROUNDING_MODE: BigNumber.ROUND_HALF_CEIL, - EXPONENTIAL_AT: [-10, 20], - RANGE: [-500, 500], - CRYPTO: true, - MODULO_MODE: BigNumber.ROUND_FLOOR, - POW_PRECISION: 80, - FORMAT: { - groupSize: 3, - groupSeparator: ' ', - decimalSeparator: ',' - }, - ALPHABET: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_' - }); - - BigNumber.set().DECIMAL_PLACES // 40 - ``` - * @param The configuration object. - */ - static set(object: Config): Config; - - /** - * Rounds away from zero. - */ - static ROUND_UP: 0; - - /** - * Rounds towards zero. - */ - static ROUND_DOWN: 1; - - /** - * Rounds towards Infinity. - */ - static ROUND_CEIL: 2; - - /** - * Rounds towards -Infinity. - */ - static ROUND_FLOOR: 3; - - /** - * Rounds towards nearest neighbour. If equidistant, rounds away from zero . - */ - static ROUND_HALF_UP: 4; - - /** - * Rounds towards nearest neighbour. If equidistant, rounds towards zero. - */ - static ROUND_HALF_DOWN: 5; - - /** - * Rounds towards nearest neighbour. If equidistant, rounds towards even neighbour. - */ - static ROUND_HALF_EVEN: 6; - - /** - * Rounds towards nearest neighbour. If equidistant, rounds towards Infinity. - */ - static ROUND_HALF_CEIL: 7; - - /** - * Rounds towards nearest neighbour. If equidistant, rounds towards -Infinity. - */ - static ROUND_HALF_FLOOR: 8; - - /** - * See `MODULO_MODE`. - */ - static EUCLID: 9; - - /** - * To aid in debugging, if a `BigNumber.DEBUG` property is `true` then an error will be thrown - * on an invalid `Value`. - - ```ts - // No error, and BigNumber NaN is returned. - new BigNumber('blurgh') // 'NaN' - new BigNumber(9, 2) // 'NaN' - BigNumber.DEBUG = true - new BigNumber('blurgh') // '[BigNumber Error] Not a number' - new BigNumber(9, 2) // '[BigNumber Error] Not a base 2 number' - ``` - - An error will also be thrown if a `Value` is of type number with more than 15 - significant digits, as calling `toString` or `valueOf` on such numbers may not result - in the intended value. - - ```ts - console.log(823456789123456.3) // 823456789123456.2 - // No error, and the returned BigNumber does not have the same value as the number literal. - new BigNumber(823456789123456.3) // '823456789123456.2' - BigNumber.DEBUG = true - new BigNumber(823456789123456.3) - // '[BigNumber Error] Number primitive has more than 15 significant digits' - ``` - */ - static DEBUG: boolean; - } - - declare var BigNumber: typeof BigNumber; -} diff --git a/flow-typed/npm/bluebird_v3.x.x.js b/flow-typed/npm/bluebird_v3.x.x.js deleted file mode 100644 index 81c2c4dd97..0000000000 --- a/flow-typed/npm/bluebird_v3.x.x.js +++ /dev/null @@ -1,330 +0,0 @@ -// flow-typed signature: 55f6f471f003e310f0b2cf093203660e -// flow-typed version: 7472df5490/bluebird_v3.x.x/flow_>=v0.104.x - -type Bluebird$RangeError = Error; -type Bluebird$CancellationErrors = Error; -type Bluebird$TimeoutError = Error; -type Bluebird$RejectionError = Error; -type Bluebird$OperationalError = Error; - -type Bluebird$ConcurrencyOption = { concurrency: number, ... }; -type Bluebird$SpreadOption = { spread: boolean, ... }; -type Bluebird$MultiArgsOption = { multiArgs: boolean, ... }; -type Bluebird$BluebirdConfig = { - warnings?: boolean, - longStackTraces?: boolean, - cancellation?: boolean, - monitoring?: boolean, - ... -}; - -declare class Bluebird$PromiseInspection { - isCancelled(): boolean; - isFulfilled(): boolean; - isRejected(): boolean; - pending(): boolean; - reason(): any; - value(): T; -} - -type Bluebird$PromisifyOptions = {| - multiArgs?: boolean, - context: any -|}; - -declare type Bluebird$PromisifyAllOptions = { - suffix?: string, - filter?: ( - name: string, - func: Function, - target?: any, - passesDefaultFilter?: boolean - ) => boolean, - // The promisifier gets a reference to the original method and should return a function which returns a promise - promisifier?: (originalMethod: Function) => () => Bluebird$Promise, - ... -}; - -declare type $Promisable = Promise | T; - -declare class Bluebird$Disposable {} - -declare class Bluebird$Promise<+R> extends Promise { - static RangeError: Class; - static CancellationErrors: Class; - static TimeoutError: Class; - static RejectionError: Class; - static OperationalError: Class; - - static Defer: Class; - static PromiseInspection: Class>; - - static all>(promises: Promise): Bluebird$Promise< - $TupleMap(p: Promise | V) => V> - >; - static all>(promises: T): Bluebird$Promise< - $TupleMap(p: Promise | V) => V> - >; - static props( - input: Object | Map<*, *> | $Promisable> - ): Bluebird$Promise<*>; - static any>( - Promises: Iterable | $Promisable> - ): Bluebird$Promise; - static race>( - Promises: Iterable | $Promisable> - ): Bluebird$Promise; - static reject(error?: any): Bluebird$Promise; - static resolve(): Bluebird$Promise; - static resolve(object: Promise): Bluebird$Promise; - static resolve(object: T): Bluebird$Promise; - static some>( - Promises: Iterable | $Promisable>, - count: number - ): Bluebird$Promise>; - static join( - value1: $Promisable, - handler: (a: A) => $Promisable - ): Bluebird$Promise; - static join( - value1: $Promisable, - value2: $Promisable, - handler: (a: A, b: B) => $Promisable - ): Bluebird$Promise; - static join( - value1: $Promisable, - value2: $Promisable, - value3: $Promisable, - handler: (a: A, b: B, c: C) => $Promisable - ): Bluebird$Promise; - static map>( - Promises: Iterable | $Promisable>, - mapper: (item: T, index: number, arrayLength: number) => $Promisable, - options?: Bluebird$ConcurrencyOption - ): Bluebird$Promise>; - static mapSeries>( - Promises: Iterable | $Promisable>, - mapper: (item: T, index: number, arrayLength: number) => $Promisable - ): Bluebird$Promise>; - static reduce>( - Promises: Iterable | $Promisable>, - reducer: ( - total: U, - current: T, - index: number, - arrayLength: number - ) => $Promisable, - initialValue?: $Promisable - ): Bluebird$Promise; - static filter>( - Promises: Iterable | $Promisable>, - filterer: ( - item: T, - index: number, - arrayLength: number - ) => $Promisable, - option?: Bluebird$ConcurrencyOption - ): Bluebird$Promise>; - static each>( - Promises: Iterable | $Promisable>, - iterator: ( - item: T, - index: number, - arrayLength: number - ) => $Promisable - ): Bluebird$Promise>; - static try( - fn: () => $Promisable, - args: ?Array, - ctx: ?any - ): Bluebird$Promise; - static attempt( - fn: () => $Promisable, - args: ?Array, - ctx: ?any - ): Bluebird$Promise; - static delay(ms: number, value: $Promisable): Bluebird$Promise; - static delay(ms: number): Bluebird$Promise; - static config(config: Bluebird$BluebirdConfig): void; - - static defer(): Bluebird$Defer; - static setScheduler( - scheduler: (callback: (...args: Array) => void) => void - ): void; - static promisify( - nodeFunction: Function, - receiver?: Bluebird$PromisifyOptions - ): Function; - static promisifyAll( - target: Object | Array, - options?: Bluebird$PromisifyAllOptions - ): void; - - static coroutine(generatorFunction: Function): Function; - static spawn(generatorFunction: Function): Promise; - - // It doesn't seem possible to have type-generics for a variable number of arguments. - // Handle up to 3 arguments, then just give up and accept 'any'. - static method>(fn: () => R): () => Bluebird$Promise; - static method, A>( - fn: (a: A) => R - ): (a: A) => Bluebird$Promise; - static method, A, B>( - fn: (a: A, b: B) => R - ): (a: A, b: B) => Bluebird$Promise; - static method, A, B, C>( - fn: (a: A, b: B, c: C) => R - ): (a: A, b: B, c: C) => Bluebird$Promise; - static method>( - fn: (...args: any) => R - ): (...args: any) => Bluebird$Promise; - - static cast(value: $Promisable): Bluebird$Promise; - // static bind(ctx: any): Bluebird$Promise; - static is(value: any): boolean; - static longStackTraces(): void; - - static onPossiblyUnhandledRejection(handler: (reason: any) => any): void; - static fromCallback( - resolver: (fn: (error: ?Error, value?: T) => any) => any, - options?: Bluebird$MultiArgsOption - ): Bluebird$Promise; - - constructor( - callback: ( - resolve: (result?: $Promisable) => void, - reject: (error?: any) => void, - onCancel?: (fn?: () => void) => void, - ) => mixed - ): void; - then(onFulfill: null | void, onReject: null | void): Bluebird$Promise; - then( - onFulfill: null | void, - onReject: (error: any) => Promise | U - ): Bluebird$Promise; - then( - onFulfill: (value: R) => Promise | U, - onReject: null | void | ((error: any) => Promise | U) - ): Bluebird$Promise; - catch(onReject: null | void): Promise; - catch(onReject?: (error: any) => $Promisable): Bluebird$Promise; - catch( - err: Class, - onReject: (error: ErrorT) => $Promisable - ): Bluebird$Promise; - catch( - err1: Class, - err2: Class, - onReject: (error: ErrorT) => $Promisable - ): Bluebird$Promise; - catch( - err1: Class, - err2: Class, - err3: Class, - onReject: (error: ErrorT) => $Promisable - ): Bluebird$Promise; - caught( - err: Class, - onReject: (error: Error) => $Promisable - ): Bluebird$Promise; - caught( - err1: Class, - err2: Class, - onReject: (error: ErrorT) => $Promisable - ): Bluebird$Promise; - caught( - err1: Class, - err2: Class, - err3: Class, - onReject: (error: ErrorT) => $Promisable - ): Bluebird$Promise; - caught(onReject: (error: any) => $Promisable): Bluebird$Promise; - - error(onReject?: (error: any) => ?$Promisable): Bluebird$Promise; - done( - onFulfill?: (value: R) => mixed, - onReject?: (error: any) => mixed - ): void; - finally(onDone?: (value: R) => mixed): Bluebird$Promise; - lastly(onDone?: (value: R) => mixed): Bluebird$Promise; - tap(onDone?: (value: R) => mixed): Bluebird$Promise; - delay(ms: number): Bluebird$Promise; - timeout(ms: number, message?: string): Bluebird$Promise; - cancel(): void; - - // bind(ctx: any): Bluebird$Promise; - call(propertyName: string, ...args: Array): Bluebird$Promise; - throw(reason: Error): Bluebird$Promise; - thenThrow(reason: Error): Bluebird$Promise; - all(): Bluebird$Promise>; - any(): Bluebird$Promise; - some(count: number): Bluebird$Promise>; - race(): Bluebird$Promise; - map( - mapper: (item: T, index: number, arrayLength: number) => $Promisable, - options?: Bluebird$ConcurrencyOption - ): Bluebird$Promise>; - mapSeries( - mapper: (item: T, index: number, arrayLength: number) => $Promisable - ): Bluebird$Promise>; - reduce( - reducer: ( - total: T, - item: U, - index: number, - arrayLength: number - ) => $Promisable, - initialValue?: $Promisable - ): Bluebird$Promise; - filter( - filterer: ( - item: T, - index: number, - arrayLength: number - ) => $Promisable, - options?: Bluebird$ConcurrencyOption - ): Bluebird$Promise>; - each( - iterator: (item: T, index: number, arrayLength: number) => $Promisable - ): Bluebird$Promise>; - asCallback( - callback: (error: ?any, value?: T) => any, - options?: Bluebird$SpreadOption - ): void; - return(value: T): Bluebird$Promise; - thenReturn(value: T): Bluebird$Promise; - spread(...args: Array): Bluebird$Promise<*>; - - reflect(): Bluebird$Promise>; - - isFulfilled(): boolean; - isRejected(): boolean; - isPending(): boolean; - isResolved(): boolean; - - value(): R; - reason(): any; - - disposer( - disposer: (value: R, promise: Promise<*>) => void - ): Bluebird$Disposable; - - static using( - disposable: Bluebird$Disposable, - handler: (value: T) => $Promisable - ): Bluebird$Promise; - - suppressUnhandledRejections(): void; -} - -declare class Bluebird$Defer { - promise: Bluebird$Promise<*>; - resolve: (value: any) => any; - reject: (value: any) => any; -} - -declare module "bluebird" { - declare module.exports: typeof Bluebird$Promise; - - declare type Disposable = Bluebird$Disposable; -} diff --git a/flow-typed/npm/lodash_v4.x.x.js b/flow-typed/npm/lodash_v4.x.x.js deleted file mode 100644 index 0dc3b4bf4a..0000000000 --- a/flow-typed/npm/lodash_v4.x.x.js +++ /dev/null @@ -1,6117 +0,0 @@ -// flow-typed signature: 61f6aff2b7a4c2d2b48136a10568f722 -// flow-typed version: 173a6441ff/lodash_v4.x.x/flow_>=v0.104.x - -declare module "lodash" { - declare type Path = $ReadOnlyArray | string | number; - declare type __CurriedFunction1 = (...r: [AA]) => R; - declare type CurriedFunction1 = __CurriedFunction1; - - declare type __CurriedFunction2 = (( - ...r: [AA] - ) => CurriedFunction1) & - ((...r: [AA, BB]) => R); - declare type CurriedFunction2 = __CurriedFunction2; - - declare type __CurriedFunction3 = (( - ...r: [AA] - ) => CurriedFunction2) & - ((...r: [AA, BB]) => CurriedFunction1) & - ((...r: [AA, BB, CC]) => R); - declare type CurriedFunction3 = __CurriedFunction3< - A, - B, - C, - R, - *, - *, - * - >; - - declare type __CurriedFunction4< - A, - B, - C, - D, - R, - AA: A, - BB: B, - CC: C, - DD: D - > = ((...r: [AA]) => CurriedFunction3) & - ((...r: [AA, BB]) => CurriedFunction2) & - ((...r: [AA, BB, CC]) => CurriedFunction1) & - ((...r: [AA, BB, CC, DD]) => R); - declare type CurriedFunction4 = __CurriedFunction4< - A, - B, - C, - D, - R, - *, - *, - *, - * - >; - - declare type __CurriedFunction5< - A, - B, - C, - D, - E, - R, - AA: A, - BB: B, - CC: C, - DD: D, - EE: E - > = ((...r: [AA]) => CurriedFunction4) & - ((...r: [AA, BB]) => CurriedFunction3) & - ((...r: [AA, BB, CC]) => CurriedFunction2) & - ((...r: [AA, BB, CC, DD]) => CurriedFunction1) & - ((...r: [AA, BB, CC, DD, EE]) => R); - declare type CurriedFunction5 = __CurriedFunction5< - A, - B, - C, - D, - E, - R, - *, - *, - *, - *, - * - >; - - declare type __CurriedFunction6< - A, - B, - C, - D, - E, - F, - R, - AA: A, - BB: B, - CC: C, - DD: D, - EE: E, - FF: F - > = ((...r: [AA]) => CurriedFunction5) & - ((...r: [AA, BB]) => CurriedFunction4) & - ((...r: [AA, BB, CC]) => CurriedFunction3) & - ((...r: [AA, BB, CC, DD]) => CurriedFunction2) & - ((...r: [AA, BB, CC, DD, EE]) => CurriedFunction1) & - ((...r: [AA, BB, CC, DD, EE, FF]) => R); - declare type CurriedFunction6 = __CurriedFunction6< - A, - B, - C, - D, - E, - F, - R, - *, - *, - *, - *, - *, - * - >; - - declare type Curry = (((...r: [A]) => R) => CurriedFunction1) & - (((...r: [A, B]) => R) => CurriedFunction2) & - (((...r: [A, B, C]) => R) => CurriedFunction3) & - (( - (...r: [A, B, C, D]) => R - ) => CurriedFunction4) & - (( - (...r: [A, B, C, D, E]) => R - ) => CurriedFunction5) & - (( - (...r: [A, B, C, D, E, F]) => R - ) => CurriedFunction6); - - declare type UnaryFn = (a: A) => R; - - declare type TemplateSettings = { - escape?: RegExp, - evaluate?: RegExp, - imports?: Object, - interpolate?: RegExp, - variable?: string, - ... - }; - - declare type TruncateOptions = { - length?: number, - omission?: string, - separator?: RegExp | string, - ... - }; - - declare type Cancelable = { - cancel: () => void, - flush: () => mixed, - ... - }; - - declare type DebounceOptions = { - leading?: boolean, - maxWait?: number, - trailing?: boolean, - ... - }; - - declare type ThrottleOptions = { - leading?: boolean, - trailing?: boolean, - ... - }; - - // using opaque type for object key is not supported by Flow atm: https://github.com/facebook/flow/issues/5407 - declare type Key = string | number; - declare type IndexerObject = { [key: K]: V, ... }; - declare type ReadOnlyIndexerObject = $ReadOnly>; - declare type NestedArray = Array>; - declare type Collection = $ReadOnlyArray | ReadOnlyIndexerObject; - - declare type matchesIterateeShorthand = { [Key]: any, ... }; - declare type matchesPropertyIterateeShorthand = [string, any]; - declare type propertyIterateeShorthand = string; - - declare type OPredicate = - | ((value: A, key: string, object: O) => any) - | matchesIterateeShorthand - | matchesPropertyIterateeShorthand - | propertyIterateeShorthand; - - declare type IterateeWithResult = - | ((value: V, key: K, object: O) => R) - | string; - - declare type OIterateeWithResult = - | ReadOnlyIndexerObject - | IterateeWithResult; - declare type OIteratee = OIterateeWithResult; - - declare type AFlatMapIteratee = - | ((item: V, index: number, array: O) => $ReadOnlyArray | R) - | string - declare type OFlatMapIteratee = IterateeWithResult | R>; - - declare type Predicate = - | ((value: T, index: number, array: Array) => any) - | matchesIterateeShorthand - | matchesPropertyIterateeShorthand - | propertyIterateeShorthand; - - declare type _ValueOnlyIteratee = (value: T) => mixed; - declare type ValueOnlyIteratee = _ValueOnlyIteratee | string; - declare type _Iteratee = ( - item: T, - index: number, - array: ?Array - ) => mixed; - declare type Iteratee = _Iteratee | Object | string; - declare type Comparator = (item: T, item2: T) => boolean; - - declare type ReadOnlyMapIterator = - | ((item: T, index: number, array: $ReadOnlyArray) => U) - | propertyIterateeShorthand; - - declare type OMapIterator = - | ((item: T, key: string, object: O) => U) - | propertyIterateeShorthand; - - declare class Lodash { - // Array - chunk(array?: ?$ReadOnlyArray, size?: ?number): Array>; - compact(array?: ?$ReadOnlyArray): Array; - concat( - base?: ?$ReadOnlyArray, - ...elements: $ReadOnlyArray - ): Array; - difference( - array?: ?$ReadOnlyArray, - ...values: $ReadOnlyArray> - ): Array; - differenceBy( - array?: ?$ReadOnlyArray, - values?: ?$ReadOnlyArray, - iteratee?: ?ValueOnlyIteratee - ): Array; - differenceWith( - array?: ?$ReadOnlyArray, - values?: ?$ReadOnlyArray, - comparator?: ?(item: T, item2: U) => boolean - ): Array; - drop(array?: ?$ReadOnlyArray, n?: ?number): Array; - dropRight(array?: ?$ReadOnlyArray, n?: ?number): Array; - dropRightWhile(array?: ?$ReadOnlyArray, predicate?: ?Predicate): Array; - dropWhile(array?: ?$ReadOnlyArray, predicate?: ?Predicate): Array; - fill( - array?: ?Array, - value?: ?U, - start?: ?number, - end?: ?number - ): Array; - findIndex( - array: $ReadOnlyArray, - predicate?: ?Predicate, - fromIndex?: ?number - ): number; - findIndex( - array: void | null, - predicate?: ?Predicate, - fromIndex?: ?number - ): -1; - findLastIndex( - array: $ReadOnlyArray, - predicate?: ?Predicate, - fromIndex?: ?number - ): number; - findLastIndex( - array: void | null, - predicate?: ?Predicate, - fromIndex?: ?number - ): -1; - // alias of _.head - first(array: ?$ReadOnlyArray): T; - flatten(array?: ?$ReadOnlyArray<$ReadOnlyArray | X>): Array; - flattenDeep(array?: ?$ReadOnlyArray): Array; - flattenDepth(array?: ?$ReadOnlyArray, depth?: ?number): Array; - fromPairs(pairs?: ?$ReadOnlyArray<[A, B]>): {| [key: A]: B |}; - head(array: ?$ReadOnlyArray): T; - indexOf(array: $ReadOnlyArray, value: T, fromIndex?: number): number; - indexOf(array: void | null, value?: ?T, fromIndex?: ?number): -1; - initial(array: ?$ReadOnlyArray): Array; - intersection(...arrays?: Array<$ReadOnlyArray>): Array; - //Workaround until (...parameter: T, parameter2: U) works - intersectionBy( - a1?: ?$ReadOnlyArray, - iteratee?: ?ValueOnlyIteratee - ): Array; - intersectionBy( - a1?: ?$ReadOnlyArray, - a2?: ?$ReadOnlyArray, - iteratee?: ?ValueOnlyIteratee - ): Array; - intersectionBy( - a1?: ?$ReadOnlyArray, - a2?: ?$ReadOnlyArray, - a3?: ?$ReadOnlyArray, - iteratee?: ?ValueOnlyIteratee - ): Array; - intersectionBy( - a1?: ?$ReadOnlyArray, - a2?: ?$ReadOnlyArray, - a3?: ?$ReadOnlyArray, - a4?: ?$ReadOnlyArray, - iteratee?: ?ValueOnlyIteratee - ): Array; - //Workaround until (...parameter: T, parameter2: U) works - intersectionWith( - a1?: ?$ReadOnlyArray, - comparator?: ?Comparator - ): Array; - intersectionWith( - a1?: ?$ReadOnlyArray, - a2?: ?$ReadOnlyArray, - comparator?: ?Comparator - ): Array; - intersectionWith( - a1?: ?$ReadOnlyArray, - a2?: ?$ReadOnlyArray, - a3?: ?$ReadOnlyArray, - comparator?: ?Comparator - ): Array; - intersectionWith( - a1?: ?$ReadOnlyArray, - a2?: ?$ReadOnlyArray, - a3?: ?$ReadOnlyArray, - a4?: ?$ReadOnlyArray, - comparator?: ?Comparator - ): Array; - join(array: $ReadOnlyArray, separator?: ?string): string; - join(array: void | null, separator?: ?string): ""; - last(array: ?$ReadOnlyArray): T; - lastIndexOf(array: $ReadOnlyArray, value?: ?T, fromIndex?: ?number): number; - lastIndexOf(array: void | null, value?: ?T, fromIndex?: ?number): -1; - nth(array: $ReadOnlyArray, n?: ?number): T; - nth(array: void | null, n?: ?number): void; - pull(array: Array, ...values?: $ReadOnlyArray): Array; - pull(array: T, ...values?: $ReadOnlyArray): T; - pullAll(array: Array, values?: ?$ReadOnlyArray): Array; - pullAll(array: T, values?: ?$ReadOnlyArray): T; - pullAllBy( - array: Array, - values?: ?$ReadOnlyArray, - iteratee?: ?ValueOnlyIteratee - ): Array; - pullAllBy( - array: T, - values?: ?$ReadOnlyArray, - iteratee?: ?ValueOnlyIteratee - ): T; - pullAllWith( - array: T, - values?: ?$ReadOnlyArray, - comparator?: ?Function - ): T; - pullAllWith(array: Array, values?: ?($ReadOnlyArray), comparator?: ?Function): Array; - pullAt(array?: ?Array, ...indexed?: $ReadOnlyArray): Array; - pullAt(array?: ?Array, indexed?: ?$ReadOnlyArray): Array; - remove(array?: ?Array, predicate?: ?Predicate): Array; - reverse(array: Array): Array; - reverse(array: T): T; - slice( - array?: ?$ReadOnlyArray, - start?: ?number, - end?: ?number - ): Array; - sortedIndex(array: $ReadOnlyArray, value: T): number; - sortedIndex(array: void | null, value: ?T): 0; - sortedIndexBy( - array: $ReadOnlyArray, - value?: ?T, - iteratee?: ?ValueOnlyIteratee - ): number; - sortedIndexBy( - array: void | null, - value?: ?T, - iteratee?: ?ValueOnlyIteratee - ): 0; - sortedIndexOf(array: $ReadOnlyArray, value: T): number; - sortedIndexOf(array: void | null, value?: ?T): -1; - sortedLastIndex(array: $ReadOnlyArray, value: T): number; - sortedLastIndex(array: void | null, value?: ?T): 0; - sortedLastIndexBy( - array: $ReadOnlyArray, - value: T, - iteratee?: ValueOnlyIteratee - ): number; - sortedLastIndexBy( - array: void | null, - value?: ?T, - iteratee?: ?ValueOnlyIteratee - ): 0; - sortedLastIndexOf(array: $ReadOnlyArray, value: T): number; - sortedLastIndexOf(array: void | null, value?: ?T): -1; - sortedUniq(array?: ?$ReadOnlyArray): Array; - sortedUniqBy( - array?: ?$ReadOnlyArray, - iteratee?: ?ValueOnlyIteratee - ): Array; - tail(array?: ?$ReadOnlyArray): Array; - take(array?: ?$ReadOnlyArray, n?: ?number): Array; - takeRight(array?: ?$ReadOnlyArray, n?: ?number): Array; - takeRightWhile(array?: ?$ReadOnlyArray, predicate?: ?Predicate): Array; - takeWhile(array?: ?$ReadOnlyArray, predicate?: ?Predicate): Array; - union(...arrays?: Array<$ReadOnlyArray>): Array; - //Workaround until (...parameter: T, parameter2: U) works - unionBy( - a1?: ?$ReadOnlyArray, - iteratee?: ?ValueOnlyIteratee - ): Array; - unionBy( - a1?: ?$ReadOnlyArray, - a2: $ReadOnlyArray, - iteratee?: ValueOnlyIteratee - ): Array; - unionBy( - a1: $ReadOnlyArray, - a2: $ReadOnlyArray, - a3: $ReadOnlyArray, - iteratee?: ValueOnlyIteratee - ): Array; - unionBy( - a1: $ReadOnlyArray, - a2: $ReadOnlyArray, - a3: $ReadOnlyArray, - a4: $ReadOnlyArray, - iteratee?: ValueOnlyIteratee - ): Array; - //Workaround until (...parameter: T, parameter2: U) works - unionWith(a1?: ?$ReadOnlyArray, comparator?: ?Comparator): Array; - unionWith( - a1: $ReadOnlyArray, - a2: $ReadOnlyArray, - comparator?: Comparator - ): Array; - unionWith( - a1: $ReadOnlyArray, - a2: $ReadOnlyArray, - a3: $ReadOnlyArray, - comparator?: Comparator - ): Array; - unionWith( - a1: $ReadOnlyArray, - a2: $ReadOnlyArray, - a3: $ReadOnlyArray, - a4: $ReadOnlyArray, - comparator?: Comparator - ): Array; - uniq(array?: ?$ReadOnlyArray): Array; - uniqBy(array?: ?$ReadOnlyArray, iteratee?: ?ValueOnlyIteratee): Array; - uniqWith(array?: ?$ReadOnlyArray, comparator?: ?Comparator): Array; - unzip(array?: ?$ReadOnlyArray): Array; - unzipWith(array: ?$ReadOnlyArray, iteratee?: ?Iteratee): Array; - without(array?: ?$ReadOnlyArray, ...values?: Array): Array; - xor(...array: $ReadOnlyArray<$ReadOnlyArray>): Array; - //Workaround until (...parameter: T, parameter2: U) works - xorBy(a1?: ?$ReadOnlyArray, iteratee?: ?ValueOnlyIteratee): Array; - xorBy( - a1: $ReadOnlyArray, - a2: $ReadOnlyArray, - iteratee?: ValueOnlyIteratee - ): Array; - xorBy( - a1: $ReadOnlyArray, - a2: $ReadOnlyArray, - a3: $ReadOnlyArray, - iteratee?: ValueOnlyIteratee - ): Array; - xorBy( - a1: $ReadOnlyArray, - a2: $ReadOnlyArray, - a3: $ReadOnlyArray, - a4: $ReadOnlyArray, - iteratee?: ValueOnlyIteratee - ): Array; - //Workaround until (...parameter: T, parameter2: U) works - xorWith(a1?: ?$ReadOnlyArray, comparator?: ?Comparator): Array; - xorWith( - a1: $ReadOnlyArray, - a2: $ReadOnlyArray, - comparator?: Comparator - ): Array; - xorWith( - a1: $ReadOnlyArray, - a2: $ReadOnlyArray, - a3: $ReadOnlyArray, - comparator?: Comparator - ): Array; - xorWith( - a1: $ReadOnlyArray, - a2: $ReadOnlyArray, - a3: $ReadOnlyArray, - a4: $ReadOnlyArray, - comparator?: Comparator - ): Array; - zip(a1?: ?($ReadOnlyArray), a2?: ?($ReadOnlyArray)): Array<[A, B]>; - zip(a1: $ReadOnlyArray, a2: $ReadOnlyArray, a3: $ReadOnlyArray): Array<[A, B, C]>; - zip(a1: $ReadOnlyArray, a2: $ReadOnlyArray, a3: $ReadOnlyArray, a4: $ReadOnlyArray): Array<[A, B, C, D]>; - zip( - a1: $ReadOnlyArray, - a2: $ReadOnlyArray, - a3: $ReadOnlyArray, - a4: $ReadOnlyArray, - a5: $ReadOnlyArray - ): Array<[A, B, C, D, E]>; - - zipObject(props: $ReadOnlyArray, values?: ?$ReadOnlyArray): { [key: K]: V, ... }; - zipObject(props: void | null, values?: ?$ReadOnlyArray): {...}; - zipObjectDeep(props: $ReadOnlyArray, values?: ?any): Object; - zipObjectDeep(props: void | null, values?: ?any): {...}; - - zipWith(a1?: ?$ReadOnlyArray): Array<[A]>; - zipWith(a1: $ReadOnlyArray, iteratee: (A) => T): Array; - - zipWith(a1: $ReadOnlyArray, a2: $ReadOnlyArray): Array<[A, B]>; - zipWith( - a1: $ReadOnlyArray, - a2: $ReadOnlyArray, - iteratee: (A, B) => T - ): Array; - - zipWith( - a1: $ReadOnlyArray, - a2: $ReadOnlyArray, - a3: $ReadOnlyArray - ): Array<[A, B, C]>; - zipWith( - a1: $ReadOnlyArray, - a2: $ReadOnlyArray, - a3: $ReadOnlyArray, - iteratee: (A, B, C) => T - ): Array; - - zipWith( - a1: $ReadOnlyArray, - a2: $ReadOnlyArray, - a3: $ReadOnlyArray, - a4: $ReadOnlyArray - ): Array<[A, B, C, D]>; - zipWith( - a1: $ReadOnlyArray, - a2: $ReadOnlyArray, - a3: $ReadOnlyArray, - a4: $ReadOnlyArray, - iteratee: (A, B, C, D) => T - ): Array; - - // Collection - countBy(array: $ReadOnlyArray, iteratee?: ?ValueOnlyIteratee): { [string]: number, ... }; - countBy(array: void | null, iteratee?: ?ValueOnlyIteratee): {...}; - countBy(string: string, iteratee?: ?ValueOnlyIteratee): { [string]: number, ... }; - countBy(object: ReadOnlyIndexerObject, iteratee?: ?ValueOnlyIteratee): { [string]: number, ... }; - // alias of _.forEach - each | $ReadOnlyArray | string | void | null>(collection: T, iteratee?: ?IterateeWithResult): T; - // alias of _.forEachRight - eachRight | $ReadOnlyArray | string | void | null>(collection: T, iteratee?: ?IterateeWithResult): T; - every(array?: ?$ReadOnlyArray, iteratee?: ?Iteratee): boolean; - every(str: string, iteratee?: ?Iteratee): boolean; - every>(object: T, iteratee?: OIterateeWithResult): boolean; - filter(array?: ?$ReadOnlyArray, predicate?: ?Predicate): Array; - filter>( - object: T, - predicate?: OPredicate - ): Array; - find( - array: $ReadOnlyArray, - predicate?: ?Predicate, - fromIndex?: ?number - ): T | void; - find( - array: void | null, - predicate?: ?Predicate, - fromIndex?: ?number - ): void; - find>( - object: T, - predicate?: ?OPredicate, - fromIndex?: ?number - ): R; - findLast( - array: $ReadOnlyArray, - predicate?: ?Predicate, - fromIndex?: ?number - ): T | void; - findLast( - array: void | null, - predicate?: ?Predicate, - fromIndex?: ?number - ): void; - findLast>( - object: T, - predicate?: ?OPredicate, - fromIndex?: ?number - ): R; - flatMap = Array>( - array: T, - iteratee?: ?AFlatMapIteratee - ): Array; - flatMap | string = IndexerObject>( - object: T, - iteratee?: ?OFlatMapIteratee - ): Array; - flatMapDeep = Array>( - array: T, - iteratee?: ?AFlatMapIteratee - ): Array; - flatMapDeep | string = IndexerObject>( - object: T, - iteratee?: ?OFlatMapIteratee - ): Array; - flatMapDepth = Array>( - array: T, - iteratee?: ?AFlatMapIteratee, - depth?: ?number - ): Array; - flatMapDepth | string = IndexerObject>( - object: T, - iteratee?: ?OFlatMapIteratee, - depth?: ?number - ): Array; - forEach | $ReadOnlyArray | string | void | null>(collection: T, iteratee?: ?IterateeWithResult): T; - forEachRight | $ReadOnlyArray | string | void | null>(collection: T, iteratee?: ?IterateeWithResult): T; - groupBy( - array: $ReadOnlyArray, - iteratee?: ?ValueOnlyIteratee - ): { [key: V]: Array, ... }; - groupBy(array: void | null, iteratee?: ?ValueOnlyIteratee): {...}; - groupBy>( - object: T, - iteratee?: ValueOnlyIteratee - ): { [key: V]: Array, ... }; - includes( - array: $ReadOnlyArray, - value: T, - fromIndex?: ?number - ): boolean; - includes(array: void | null, value?: ?T, fromIndex?: ?number): false; - includes(object: ReadOnlyIndexerObject, value: A, fromIndex?: number): boolean; - includes(str: string, value: string, fromIndex?: number): boolean; - invokeMap( - array?: ?$ReadOnlyArray, - path?: ?((value: T) => Path) | Path, - ...args?: $ReadOnlyArray - ): Array; - invokeMap( - object: ReadOnlyIndexerObject, - path: ((value: any) => Path) | Path, - ...args?: $ReadOnlyArray - ): Array; - keyBy( - array: $ReadOnlyArray, - iteratee?: ?ValueOnlyIteratee - ): { [key: V]: T, ... }; - keyBy(array: void | null, iteratee?: ?ValueOnlyIteratee<*>): {...}; - keyBy>( - object: T, - iteratee?: ?ValueOnlyIteratee - ): { [key: V]: A, ... }; - map( - array?: ?$ReadOnlyArray, - iteratee?: ?ReadOnlyMapIterator - ): Array; - map, U>( - object: ?T, - iteratee?: OMapIterator - ): Array; - map( - str: ?string, - iteratee?: (char: string, index: number, str: string) => any - ): string; - orderBy( - array: $ReadOnlyArray, - iteratees?: ?$ReadOnlyArray> | ?string, - orders?: ?$ReadOnlyArray<"asc" | "desc"> | ?string - ): Array; - orderBy( - array: null | void, - iteratees?: ?$ReadOnlyArray> | ?string, - orders?: ?$ReadOnlyArray<"asc" | "desc"> | ?string - ): Array; - orderBy>( - object: T, - iteratees?: $ReadOnlyArray> | string, - orders?: $ReadOnlyArray<"asc" | "desc"> | string - ): Array; - partition( - array?: ?$ReadOnlyArray, - predicate?: ?Predicate - ): [Array, Array]; - partition>( - object: T, - predicate?: OPredicate - ): [Array, Array]; - reduce( - array: $ReadOnlyArray, - iteratee?: ( - accumulator: U, - value: T, - index: number, - array: ?Array - ) => U, - accumulator?: U - ): U; - reduce( - array: void | null, - iteratee?: ?( - accumulator: U, - value: T, - index: any, - array: ?Array - ) => U, - accumulator?: U - ): U; - reduce, U>( - object: T, - iteratee?: (accumulator: U, value: any, key: string, object: T) => U, - accumulator?: U - ): U; - reduceRight( - array: void | null, - iteratee?: ?( - accumulator: U, - value: T, - index: any, - array: ?Array - ) => U, - accumulator?: U - ): U; - reduceRight( - array: $ReadOnlyArray, - iteratee?: ?( - accumulator: U, - value: T, - index: number, - array: ?Array - ) => U, - accumulator?: ?U - ): U; - reduceRight, U>( - object: T, - iteratee?: ?(accumulator: U, value: any, key: string, object: T) => U, - accumulator?: ?U - ): U; - reject(array?: ?$ReadOnlyArray, predicate?: ?Predicate): Array; - reject>( - object?: ?T, - predicate?: ?OPredicate - ): Array; - sample(collection: ?Collection): T; - sampleSize(collection?: ?Collection, n?: ?number): Array; - shuffle(array?: ?Collection): Array; - size(collection?: ?Collection | string): number; - some(array: void | null, predicate?: ?Predicate): false; - some(array: ?$ReadOnlyArray, predicate?: Predicate): boolean; - some>( - object?: ?T, - predicate?: OPredicate - ): boolean; - sortBy( - array: ?$ReadOnlyArray, - ...iteratees?: $ReadOnlyArray> - ): Array; - sortBy( - array: ?$ReadOnlyArray, - iteratees?: $ReadOnlyArray> - ): Array; - sortBy>( - object: T, - ...iteratees?: $ReadOnlyArray> - ): Array; - sortBy>( - object: T, - iteratees?: $ReadOnlyArray> - ): Array; - - // Date - now(): number; - - // Function - after(n: number, fn: Function): Function; - ary(func: Function, n?: number): Function; - before(n: number, fn: Function): Function; - bind) => any>(func: F, thisArg: any, ...partials: $ReadOnlyArray): F; - bindKey(obj?: ?Object, key?: ?string, ...partials?: $ReadOnlyArray): Function; - curry: Curry; - curry(func: Function, arity?: number): Function; - curryRight(func: Function, arity?: number): Function; - debounce) => any>( - func: F, - wait?: number, - options?: DebounceOptions - ): F & Cancelable; - defer(func: (...$ReadOnlyArray) => any, ...args?: $ReadOnlyArray): TimeoutID; - delay(func: Function, wait: number, ...args?: $ReadOnlyArray): TimeoutID; - flip(func: (...$ReadOnlyArray) => R): (...Array) => R; - memoize(func: (...A) => R, resolver?: (...A) => any): (...A) => R; - negate(predicate: (...A) => R): (...A) => boolean; - once) => any>(func: F): F; - overArgs(func?: ?Function, ...transforms?: $ReadOnlyArray): Function; - overArgs(func?: ?Function, transforms?: ?$ReadOnlyArray): Function; - partial(func: (...$ReadOnlyArray) => R, ...partials: $ReadOnlyArray): (...Array) => R; - partialRight(func: (...$ReadOnlyArray) => R, ...partials: $ReadOnlyArray): (...Array) => R; - partialRight(func: (...$ReadOnlyArray) => R, partials: $ReadOnlyArray): (...Array) => R; - rearg(func: Function, ...indexes: $ReadOnlyArray): Function; - rearg(func: Function, indexes: $ReadOnlyArray): Function; - rest(func: Function, start?: number): Function; - spread(func: Function): Function; - throttle) => any>( - func: F, - wait?: number, - options?: ThrottleOptions - ): F & Cancelable; - unary) => any>(func: F): F; - wrap(value?: any, wrapper?: ?Function): Function; - - // Lang - castArray(): Array; - castArray(value: T): Array; - castArray>(value: T): T; - clone(value: T): T; - cloneDeep(value: T): T; - cloneDeepWith( - value: T, - customizer?: ?(value: T, key: number | string, object: T, stack: any) => U - ): U; - cloneWith( - value: T, - customizer?: ?(value: T, key: number | string, object: T, stack: any) => U - ): U; - conformsTo>( - source: T, - predicates: T & $ReadOnly<{ [key: string]: (x: any) => boolean, ... }> - ): boolean; - eq(value: any, other: any): boolean; - gt(value: any, other: any): boolean; - gte(value: any, other: any): boolean; - isArguments(value: void | null): false; - isArguments(value: any): boolean; - isArray(value: $ReadOnlyArray): true; - isArray(value: any): false; - isArrayBuffer(value: ArrayBuffer): true; - isArrayBuffer(value: any): false; - isArrayLike(value: $ReadOnlyArray | string | { length: number, ... }): true; - isArrayLike(value: any): false; - isArrayLikeObject(value: { length: number, ... } | $ReadOnlyArray): true; - isArrayLikeObject(value: any): false; - isBoolean(value: boolean): true; - isBoolean(value: any): false; - isBuffer(value: void | null): false; - isBuffer(value: any): boolean; - isDate(value: Date): true; - isDate(value: any): false; - isElement(value: Element): true; - isElement(value: any): false; - isEmpty(value: void | null | "" | {...} | [] | number | boolean): true; - isEmpty(value: any): boolean; - isEqual(value: any, other: any): boolean; - isEqualWith( - value?: ?T, - other?: ?U, - customizer?: ?( - objValue: any, - otherValue: any, - key: number | string, - object: T, - other: U, - stack: any - ) => boolean | void - ): boolean; - isError(value: Error): true; - isError(value: any): false; - isFinite(value: number): boolean; - isFinite(value: any): false; - isFunction(value: Function): true; - isFunction(value: any): false; - isInteger(value: number): boolean; - isInteger(value: any): false; - isLength(value: void | null): false; - isLength(value: any): boolean; - isMap(value: Map): true; - isMap(value: any): false; - isMatch(object?: ?Object, source?: ?Object): boolean; - isMatchWith( - object?: ?T, - source?: ?U, - customizer?: ?( - objValue: any, - srcValue: any, - key: number | string, - object: T, - source: U - ) => boolean | void - ): boolean; - isNaN(value: number): boolean; - isNaN(value: any): false; - isNative(value: number | string | void | null | Object): false; - isNative(value: any): boolean; - isNil(value: void | null): true; - isNil(value: any): false; - isNull(value: null): true; - isNull(value: any): false; - isNumber(value: number): true; - isNumber(value: any): false; - isObject(value: any): boolean; - isObjectLike(value: void | null): false; - isObjectLike(value: any): boolean; - isPlainObject(value: any): boolean; - isRegExp(value: RegExp): true; - isRegExp(value: any): false; - isSafeInteger(value: number): boolean; - isSafeInteger(value: any): false; - isSet(value: Set): true; - isSet(value: any): false; - isString(value: string): true; - isString(value: any): false; - isSymbol(value: Symbol): true; - isSymbol(value: any): false; - isTypedArray(value: $TypedArray): true; - isTypedArray(value: any): false; - isUndefined(value: void): true; - isUndefined(value: any): false; - isWeakMap(value: WeakMap): true; - isWeakMap(value: any): false; - isWeakSet(value: WeakSet): true; - isWeakSet(value: any): false; - lt(value: any, other: any): boolean; - lte(value: any, other: any): boolean; - toArray(value: any): Array; - toFinite(value: void | null): 0; - toFinite(value: any): number; - toInteger(value: void | null): 0; - toInteger(value: any): number; - toLength(value: void | null): 0; - toLength(value: any): number; - toNumber(value: void | null): 0; - toNumber(value: any): number; - toPlainObject(value: any): Object; - toSafeInteger(value: void | null): 0; - toSafeInteger(value: any): number; - toString(value: void | null): ""; - toString(value: any): string; - - // Math - add(augend: number, addend: number): number; - ceil(number: number, precision?: number): number; - divide(dividend: number, divisor: number): number; - floor(number: number, precision?: number): number; - max(array: ?$ReadOnlyArray): T; - maxBy(array: ?$ReadOnlyArray, iteratee?: Iteratee): T; - mean(array: $ReadOnlyArray<*>): number; - meanBy(array: $ReadOnlyArray, iteratee?: Iteratee): number; - min(array: ?$ReadOnlyArray): T; - minBy(array: ?$ReadOnlyArray, iteratee?: Iteratee): T; - multiply(multiplier: number, multiplicand: number): number; - round(number: number, precision?: number): number; - subtract(minuend: number, subtrahend: number): number; - sum(array: $ReadOnlyArray<*>): number; - sumBy(array: $ReadOnlyArray, iteratee?: Iteratee): number; - - // number - clamp(number?: number, lower?: ?number, upper?: ?number): number; - clamp(number: ?number, lower?: ?number, upper?: ?number): 0; - inRange(number: number, start?: number, end: number): boolean; - random(lower?: number, upper?: number, floating?: boolean): number; - - // Object - assign(object?: ?Object, ...sources?: $ReadOnlyArray): Object; - assignIn(): {...}; - assignIn(a: A, b: B): A & B; - assignIn(a: A, b: B, c: C): A & B & C; - assignIn(a: A, b: B, c: C, d: D): A & B & C & D; - assignIn(a: A, b: B, c: C, d: D, e: E): A & B & C & D & E; - assignInWith(): {...}; - assignInWith( - object: T, - s1: A, - customizer?: ( - objValue: any, - srcValue: any, - key: string, - object: T, - source: A - ) => any | void - ): Object; - assignInWith( - object: T, - s1: A, - s2: B, - customizer?: ( - objValue: any, - srcValue: any, - key: string, - object: T, - source: A | B - ) => any | void - ): Object; - assignInWith( - object: T, - s1: A, - s2: B, - s3: C, - customizer?: ( - objValue: any, - srcValue: any, - key: string, - object: T, - source: A | B | C - ) => any | void - ): Object; - assignInWith( - object: T, - s1: A, - s2: B, - s3: C, - s4: D, - customizer?: ( - objValue: any, - srcValue: any, - key: string, - object: T, - source: A | B | C | D - ) => any | void - ): Object; - assignWith(): {...}; - assignWith( - object: T, - s1: A, - customizer?: ( - objValue: any, - srcValue: any, - key: string, - object: T, - source: A - ) => any | void - ): Object; - assignWith( - object: T, - s1: A, - s2: B, - customizer?: ( - objValue: any, - srcValue: any, - key: string, - object: T, - source: A | B - ) => any | void - ): Object; - assignWith( - object: T, - s1: A, - s2: B, - s3: C, - customizer?: ( - objValue: any, - srcValue: any, - key: string, - object: T, - source: A | B | C - ) => any | void - ): Object; - assignWith( - object: T, - s1: A, - s2: B, - s3: C, - s4: D, - customizer?: ( - objValue: any, - srcValue: any, - key: string, - object: T, - source: A | B | C | D - ) => any | void - ): Object; - at(object?: ?Object, ...paths: $ReadOnlyArray): Array; - at(object?: ?Object, paths: $ReadOnlyArray): Array; - create(prototype: void | null, properties: void | null): {...}; - create(prototype: T, properties: Object): T; - create(prototype: any, properties: void | null): {...}; - defaults(object?: ?Object, ...sources?: $ReadOnlyArray): Object; - defaultsDeep(object?: ?Object, ...sources?: $ReadOnlyArray): Object; - // alias for _.toPairs - entries(object?: ?Object): Array<[string, any]>; - // alias for _.toPairsIn - entriesIn(object?: ?Object): Array<[string, any]>; - // alias for _.assignIn - extend(a?: ?A, b?: ?B): A & B; - extend(a: A, b: B, c: C): A & B & C; - extend(a: A, b: B, c: C, d: D): A & B & C & D; - extend(a: A, b: B, c: C, d: D, e: E): A & B & C & D & E; - // alias for _.assignInWith - extendWith( - object?: ?T, - s1?: ?A, - customizer?: ?( - objValue: any, - srcValue: any, - key: string, - object: T, - source: A - ) => any | void - ): Object; - extendWith( - object: T, - s1: A, - s2: B, - customizer?: ( - objValue: any, - srcValue: any, - key: string, - object: T, - source: A | B - ) => any | void - ): Object; - extendWith( - object: T, - s1: A, - s2: B, - s3: C, - customizer?: ( - objValue: any, - srcValue: any, - key: string, - object: T, - source: A | B | C - ) => any | void - ): Object; - extendWith( - object: T, - s1: A, - s2: B, - s3: C, - s4: D, - customizer?: ( - objValue: any, - srcValue: any, - key: string, - object: T, - source: A | B | C | D - ) => any | void - ): Object; - findKey>( - object: T, - predicate?: ?OPredicate - ): string | void; - findKey>( - object: void | null, - predicate?: ?OPredicate - ): void; - findLastKey>( - object: T, - predicate?: ?OPredicate - ): string | void; - findLastKey>( - object: void | null, - predicate?: ?OPredicate - ): void; - forIn(object: Object, iteratee?: ?OIteratee<*>): Object; - forIn(object: void | null, iteratee?: ?OIteratee<*>): null; - forInRight(object: Object, iteratee?: ?OIteratee<*>): Object; - forInRight(object: void | null, iteratee?: ?OIteratee<*>): null; - forOwn(object: Object, iteratee?: ?OIteratee<*>): Object; - forOwn(object: void | null, iteratee?: ?OIteratee<*>): null; - forOwnRight(object: Object, iteratee?: ?OIteratee<*>): Object; - forOwnRight(object: void | null, iteratee?: ?OIteratee<*>): null; - functions(object?: ?Object): Array; - functionsIn(object?: ?Object): Array; - get( - object?: ?Object | ?$ReadOnlyArray | void | null, - path?: ?Path, - defaultValue?: any - ): any; - has(object: Object, path: Path): boolean; - has(object: Object, path: void | null): false; - has(object: void | null, path?: ?Path): false; - hasIn(object: Object, path: Path): boolean; - hasIn(object: Object, path: void | null): false; - hasIn(object: void | null, path?: ?Path): false; - invert(object: Object, multiVal?: ?boolean): Object; - invert(object: void | null, multiVal?: ?boolean): {...}; - invertBy(object: Object, iteratee?: ?Function): Object; - invertBy(object: void | null, iteratee?: ?Function): {...}; - invoke( - object?: ?Object, - path?: ?Path, - ...args?: $ReadOnlyArray - ): any; - keys(object?: ?ReadOnlyIndexerObject): Array; - keys(object?: ?Object): Array; - keysIn(object?: ?Object): Array; - mapKeys(object: Object, iteratee?: ?OIteratee<*>): Object; - mapKeys(object: void | null, iteratee?: ?OIteratee<*>): {...}; - mapValues(object: Object, iteratee?: ?OIteratee<*>): Object; - mapValues(object: void | null, iteratee?: ?OIteratee<*>): {...}; - merge(object?: ?Object, ...sources?: $ReadOnlyArray): Object; - mergeWith(): {...}; - mergeWith( - object: T, - customizer?: ( - objValue: any, - srcValue: any, - key: string, - object: T, - source: A - ) => any | void - ): Object; - mergeWith( - object: T, - s1: A, - s2: B, - customizer?: ( - objValue: any, - srcValue: any, - key: string, - object: T, - source: A | B - ) => any | void - ): Object; - mergeWith( - object: T, - s1: A, - s2: B, - s3: C, - customizer?: ( - objValue: any, - srcValue: any, - key: string, - object: T, - source: A | B | C - ) => any | void - ): Object; - mergeWith( - object: T, - s1: A, - s2: B, - s3: C, - s4: D, - customizer?: ( - objValue: any, - srcValue: any, - key: string, - object: T, - source: A | B | C | D - ) => any | void - ): Object; - omit(object?: ?Object, ...props: $ReadOnlyArray): Object; - omit(object?: ?Object, props: $ReadOnlyArray): Object; - omitBy>( - object: $ReadOnly, - predicate?: ?OPredicate - ): Object; - omitBy(object: void | null, predicate?: ?OPredicate): {...}; - pick(object?: ?Object, ...props: $ReadOnlyArray): Object; - pick(object?: ?Object, props: $ReadOnlyArray): Object; - pickBy>( - object: $ReadOnly, - predicate?: ?OPredicate - ): Object; - pickBy(object: void | null, predicate?: ?OPredicate): {...}; - result( - object?: ?Object, - path?: ?Path, - defaultValue?: any - ): any; - set(object: Object, path?: ?Path, value: any): Object; - set( - object: T, - path?: ?Path, - value?: ?any - ): T; - setWith( - object: T, - path?: ?Path, - value: any, - customizer?: (nsValue: any, key: string, nsObject: T) => any - ): Object; - setWith( - object: T, - path?: ?Path, - value?: ?any, - customizer?: ?(nsValue: any, key: string, nsObject: T) => any - ): T; - toPairs(object?: ?Object | $ReadOnlyArray<*>): Array<[string, any]>; - toPairsIn(object?: ?Object): Array<[string, any]>; - transform( - collection: Object | $ReadOnlyArray, - iteratee?: ?OIteratee<*>, - accumulator?: any - ): any; - transform( - collection: void | null, - iteratee?: ?OIteratee<*>, - accumulator?: ?any - ): {...}; - unset(object: void | null, path?: ?Path): true; - unset(object: Object, path?: ?Path): boolean; - update(object: Object, path: Path, updater: Function): Object; - update( - object: T, - path?: ?Path, - updater?: ?Function - ): T; - updateWith( - object: Object, - path?: ?Path, - updater?: ?Function, - customizer?: ?Function - ): Object; - updateWith( - object: T, - path?: ?Path, - updater?: ?Function, - customizer?: ?Function - ): T; - values(object?: ?Object): Array; - valuesIn(object?: ?Object): Array; - - // Seq - // harder to read, but this is _() - (value: any): any; - chain(value: T): any; - tap(value: T, interceptor: (value: T) => any): T; - thru(value: T1, interceptor: (value: T1) => T2): T2; - // TODO: _.prototype.* - - // String - camelCase(string: string): string; - camelCase(string: void | null): ""; - capitalize(string: string): string; - capitalize(string: void | null): ""; - deburr(string: string): string; - deburr(string: void | null): ""; - endsWith(string: string, target?: string, position?: ?number): boolean; - endsWith(string: void | null, target?: ?string, position?: ?number): false; - escape(string: string): string; - escape(string: void | null): ""; - escapeRegExp(string: string): string; - escapeRegExp(string: void | null): ""; - kebabCase(string: string): string; - kebabCase(string: void | null): ""; - lowerCase(string: string): string; - lowerCase(string: void | null): ""; - lowerFirst(string: string): string; - lowerFirst(string: void | null): ""; - pad(string?: ?string, length?: ?number, chars?: ?string): string; - padEnd(string?: ?string, length?: ?number, chars?: ?string): string; - padStart(string?: ?string, length?: ?number, chars?: ?string): string; - parseInt(string: string, radix?: ?number): number; - repeat(string: string, n?: ?number): string; - repeat(string: void | null, n?: ?number): ""; - replace( - string: string, - pattern: RegExp | string, - replacement: ((string: string) => string) | string - ): string; - replace( - string: void | null, - pattern?: ?RegExp | ?string, - replacement: ?((string: string) => string) | ?string - ): ""; - snakeCase(string: string): string; - snakeCase(string: void | null): ""; - split( - string?: ?string, - separator?: ?RegExp | ?string, - limit?: ?number - ): Array; - startCase(string: string): string; - startCase(string: void | null): ""; - startsWith(string: string, target?: string, position?: number): boolean; - startsWith( - string: void | null, - target?: ?string, - position?: ?number - ): false; - template(string?: ?string, options?: ?TemplateSettings): Function; - toLower(string: string): string; - toLower(string: void | null): ""; - toUpper(string: string): string; - toUpper(string: void | null): ""; - trim(string: string, chars?: string): string; - trim(string: void | null, chars?: ?string): ""; - trimEnd(string: string, chars?: ?string): string; - trimEnd(string: void | null, chars?: ?string): ""; - trimStart(string: string, chars?: ?string): string; - trimStart(string: void | null, chars?: ?string): ""; - truncate(string: string, options?: TruncateOptions): string; - truncate(string: void | null, options?: ?TruncateOptions): ""; - unescape(string: string): string; - unescape(string: void | null): ""; - upperCase(string: string): string; - upperCase(string: void | null): ""; - upperFirst(string: string): string; - upperFirst(string: void | null): ""; - words(string?: ?string, pattern?: ?RegExp | ?string): Array; - - // Util - attempt(func: Function, ...args: $ReadOnlyArray): any; - bindAll(object: Object, methodNames?: ?$ReadOnlyArray): Object; - bindAll(object: T, methodNames?: ?$ReadOnlyArray): T; - bindAll(object: Object, ...methodNames: $ReadOnlyArray): Object; - cond(pairs?: ?NestedArray): Function; - conforms(source?: ?Object): Function; - constant(value: T): () => T; - defaultTo(value: T1, defaultValue: T2): T2; - defaultTo( - value: T1, - defaultValue: T2 - ): T1; - // NaN is a number instead of its own type, otherwise it would behave like null/void - defaultTo(value: T1, defaultValue: T2): T1 | T2; - flow: $ComposeReverse & ((funcs: $ReadOnlyArray) => Function); - flowRight: $Compose & ((funcs: $ReadOnlyArray) => Function); - identity(value: T): T; - iteratee(func?: any): Function; - matches(source?: ?Object): Function; - matchesProperty(path?: ?Path, srcValue: any): Function; - method(path?: ?Path, ...args?: $ReadOnlyArray): Function; - methodOf(object?: ?Object, ...args?: $ReadOnlyArray): Function; - mixin( - object?: T, - source: Object, - options?: { chain: boolean, ... } - ): T; - noConflict(): Lodash; - noop(...args: $ReadOnlyArray): void; - nthArg(n?: ?number): Function; - over(...iteratees: $ReadOnlyArray): Function; - over(iteratees: $ReadOnlyArray): Function; - overEvery(...predicates: $ReadOnlyArray): Function; - overEvery(predicates: $ReadOnlyArray): Function; - overSome(...predicates: $ReadOnlyArray): Function; - overSome(predicates: $ReadOnlyArray): Function; - property(path?: ?Path): Function; - propertyOf(object?: ?Object): Function; - range(start: number, end: number, step?: number): Array; - range(end: number, step?: number): Array; - rangeRight(start?: ?number, end?: ?number, step?: ?number): Array; - rangeRight(end?: ?number, step?: ?number): Array; - runInContext(context?: ?Object): Function; - - stubArray(): Array<*>; - stubFalse(): false; - stubObject(): {...}; - stubString(): ""; - stubTrue(): true; - times(n?: ?number, ...rest?: $ReadOnlyArray): Array; - times(n: number, iteratee: (i: number) => T): Array; - toPath(value: any): Array; - uniqueId(prefix?: ?string): string; - - // Properties - VERSION: string; - templateSettings: TemplateSettings; - } - - declare module.exports: Lodash; -} - -declare module "lodash/fp" { - declare type Path = $ReadOnlyArray | string | number; - declare type __CurriedFunction1 = (...r: [AA]) => R; - declare type CurriedFunction1 = __CurriedFunction1; - - declare type __CurriedFunction2 = (( - ...r: [AA] - ) => CurriedFunction1) & - ((...r: [AA, BB]) => R); - declare type CurriedFunction2 = __CurriedFunction2; - - declare type __CurriedFunction3 = (( - ...r: [AA] - ) => CurriedFunction2) & - ((...r: [AA, BB]) => CurriedFunction1) & - ((...r: [AA, BB, CC]) => R); - declare type CurriedFunction3 = __CurriedFunction3< - A, - B, - C, - R, - *, - *, - * - >; - - declare type __CurriedFunction4< - A, - B, - C, - D, - R, - AA: A, - BB: B, - CC: C, - DD: D - > = ((...r: [AA]) => CurriedFunction3) & - ((...r: [AA, BB]) => CurriedFunction2) & - ((...r: [AA, BB, CC]) => CurriedFunction1) & - ((...r: [AA, BB, CC, DD]) => R); - declare type CurriedFunction4 = __CurriedFunction4< - A, - B, - C, - D, - R, - *, - *, - *, - * - >; - - declare type __CurriedFunction5< - A, - B, - C, - D, - E, - R, - AA: A, - BB: B, - CC: C, - DD: D, - EE: E - > = ((...r: [AA]) => CurriedFunction4) & - ((...r: [AA, BB]) => CurriedFunction3) & - ((...r: [AA, BB, CC]) => CurriedFunction2) & - ((...r: [AA, BB, CC, DD]) => CurriedFunction1) & - ((...r: [AA, BB, CC, DD, EE]) => R); - declare type CurriedFunction5 = __CurriedFunction5< - A, - B, - C, - D, - E, - R, - *, - *, - *, - *, - * - >; - - declare type __CurriedFunction6< - A, - B, - C, - D, - E, - F, - R, - AA: A, - BB: B, - CC: C, - DD: D, - EE: E, - FF: F - > = ((...r: [AA]) => CurriedFunction5) & - ((...r: [AA, BB]) => CurriedFunction4) & - ((...r: [AA, BB, CC]) => CurriedFunction3) & - ((...r: [AA, BB, CC, DD]) => CurriedFunction2) & - ((...r: [AA, BB, CC, DD, EE]) => CurriedFunction1) & - ((...r: [AA, BB, CC, DD, EE, FF]) => R); - declare type CurriedFunction6 = __CurriedFunction6< - A, - B, - C, - D, - E, - F, - R, - *, - *, - *, - *, - *, - * - >; - - declare type Curry = (((...r: [A]) => R) => CurriedFunction1) & - (((...r: [A, B]) => R) => CurriedFunction2) & - (((...r: [A, B, C]) => R) => CurriedFunction3) & - (( - (...r: [A, B, C, D]) => R - ) => CurriedFunction4) & - (( - (...r: [A, B, C, D, E]) => R - ) => CurriedFunction5) & - (( - (...r: [A, B, C, D, E, F]) => R - ) => CurriedFunction6); - - declare type UnaryFn = (a: A) => R; - - declare type TemplateSettings = { - escape?: RegExp, - evaluate?: RegExp, - imports?: Object, - interpolate?: RegExp, - variable?: string, - ... - }; - - declare type TruncateOptions = { - length?: number, - omission?: string, - separator?: RegExp | string, - ... - }; - - declare type DebounceOptions = { - leading?: boolean, - maxWait?: number, - trailing?: boolean, - ... - }; - - declare type ThrottleOptions = { - leading?: boolean, - trailing?: boolean, - ... - }; - - declare type Key = string | number; - declare type ReadOnlyIndexerObject = $ReadOnly<{ [id: K]: V, ... }> - declare type NestedArray = Array>; - declare type Collection = $ReadOnlyArray | ReadOnlyIndexerObject; - - declare type matchesIterateeShorthand = { [Key]: any, ... }; - declare type matchesPropertyIterateeShorthand = [string, any]; - declare type propertyIterateeShorthand = string; - - declare type OPredicate = - | ((value: A) => any) - | matchesIterateeShorthand - | matchesPropertyIterateeShorthand - | propertyIterateeShorthand; - - declare type IterateeWithResult = - | ((value: V) => R) - | string; - - declare type OIterateeWithResult = - | ReadOnlyIndexerObject - | IterateeWithResult; - declare type OIteratee = OIterateeWithResult; - - declare type Predicate = - | ((value: T) => any) - | matchesIterateeShorthand - | matchesPropertyIterateeShorthand - | propertyIterateeShorthand; - - declare type _ValueOnlyIteratee = (value: T) => mixed; - declare type ValueOnlyIteratee = _ValueOnlyIteratee | string; - declare type _Iteratee = (item: T) => mixed; - declare type Iteratee = _Iteratee | Object | string; - declare type AFlatMapIteratee = - | ((item: T) => Array) - | string; - declare type OFlatMapIteratee = IterateeWithResult>; - declare type Comparator = (item: T, item2: T) => boolean; - - declare type MapIterator = ((item: T) => U) | propertyIterateeShorthand; - - declare type OMapIterator = - | ((item: T) => U) - | propertyIterateeShorthand; - - declare class Lodash { - // Array - chunk(size: number): (array: $ReadOnlyArray) => Array>; - chunk(size: number, array: $ReadOnlyArray): Array>; - compact(array?: ?$ReadOnlyArray): Array; - concat | T, B: Array | U>( - base: A - ): (elements: B) => Array; - concat | T, B: Array | U>( - base: A, - elements: B - ): Array; - difference(values: $ReadOnlyArray): (array: $ReadOnlyArray) => Array; - difference(values: $ReadOnlyArray, array: $ReadOnlyArray): Array; - differenceBy( - iteratee: ValueOnlyIteratee - ): ((values: $ReadOnlyArray) => (array: $ReadOnlyArray) => Array) & - ((values: $ReadOnlyArray, array: $ReadOnlyArray) => Array); - differenceBy( - iteratee: ValueOnlyIteratee, - values: $ReadOnlyArray - ): (array: $ReadOnlyArray) => Array; - differenceBy( - iteratee: ValueOnlyIteratee, - values: $ReadOnlyArray, - array: $ReadOnlyArray - ): Array; - differenceWith( - comparator: Comparator - ): ((first: $ReadOnlyArray) => (second: $ReadOnlyArray) => Array) & - ((first: $ReadOnlyArray, second: $ReadOnlyArray) => Array); - differenceWith( - comparator: Comparator, - first: $ReadOnlyArray - ): (second: $ReadOnlyArray) => Array; - differenceWith( - comparator: Comparator, - first: $ReadOnlyArray, - second: $ReadOnlyArray - ): Array; - drop(n: number): (array: $ReadOnlyArray) => Array; - drop(n: number, array: $ReadOnlyArray): Array; - dropLast(n: number): (array: $ReadOnlyArray) => Array; - dropLast(n: number, array: $ReadOnlyArray): Array; - dropRight(n: number): (array: $ReadOnlyArray) => Array; - dropRight(n: number, array: $ReadOnlyArray): Array; - dropRightWhile(predicate: Predicate): (array: $ReadOnlyArray) => Array; - dropRightWhile(predicate: Predicate, array: $ReadOnlyArray): Array; - dropWhile(predicate: Predicate): (array: $ReadOnlyArray) => Array; - dropWhile(predicate: Predicate, array: $ReadOnlyArray): Array; - dropLastWhile(predicate: Predicate): (array: $ReadOnlyArray) => Array; - dropLastWhile(predicate: Predicate, array: $ReadOnlyArray): Array; - fill( - start: number - ): (( - end: number - ) => ((value: U) => (array: Array) => Array) & - ((value: U, array: Array) => Array)) & - ((end: number, value: U) => (array: Array) => Array) & - ((end: number, value: U, array: Array) => Array); - fill( - start: number, - end: number - ): ((value: U) => (array: Array) => Array) & - ((value: U, array: Array) => Array); - fill( - start: number, - end: number, - value: U - ): (array: Array) => Array; - fill( - start: number, - end: number, - value: U, - array: Array - ): Array; - findIndex(predicate: Predicate): (array: $ReadOnlyArray) => number; - findIndex(predicate: Predicate, array: $ReadOnlyArray): number; - findIndexFrom( - predicate: Predicate - ): ((fromIndex: number) => (array: $ReadOnlyArray) => number) & - ((fromIndex: number, array: $ReadOnlyArray) => number); - findIndexFrom( - predicate: Predicate, - fromIndex: number - ): (array: $ReadOnlyArray) => number; - findIndexFrom( - predicate: Predicate, - fromIndex: number, - array: $ReadOnlyArray - ): number; - findLastIndex( - predicate: Predicate - ): (array: $ReadOnlyArray) => number; - findLastIndex(predicate: Predicate, array: $ReadOnlyArray): number; - findLastIndexFrom( - predicate: Predicate - ): ((fromIndex: number) => (array: $ReadOnlyArray) => number) & - ((fromIndex: number, array: $ReadOnlyArray) => number); - findLastIndexFrom( - predicate: Predicate, - fromIndex: number - ): (array: $ReadOnlyArray) => number; - findLastIndexFrom( - predicate: Predicate, - fromIndex: number, - array: $ReadOnlyArray - ): number; - // alias of _.head - first(array: $ReadOnlyArray): T; - flatten(array: $ReadOnlyArray<$ReadOnlyArray | X>): Array; - unnest(array: $ReadOnlyArray<$ReadOnlyArray | X>): Array; - flattenDeep(array: $ReadOnlyArray): Array; - flattenDepth(depth: number): (array: $ReadOnlyArray) => Array; - flattenDepth(depth: number, array: $ReadOnlyArray): Array; - fromPairs(pairs: $ReadOnlyArray<[A, B]>): {| [key: A]: B |}; - head(array: $ReadOnlyArray): T; - indexOf(value: T): (array: $ReadOnlyArray) => number; - indexOf(value: T, array: $ReadOnlyArray): number; - indexOfFrom( - value: T - ): ((fromIndex: number) => (array: $ReadOnlyArray) => number) & - ((fromIndex: number, array: $ReadOnlyArray) => number); - indexOfFrom(value: T, fromIndex: number): (array: $ReadOnlyArray) => number; - indexOfFrom(value: T, fromIndex: number, array: $ReadOnlyArray): number; - initial(array: $ReadOnlyArray): Array; - init(array: $ReadOnlyArray): Array; - intersection(a1: $ReadOnlyArray): (a2: $ReadOnlyArray) => Array; - intersection(a1: $ReadOnlyArray, a2: $ReadOnlyArray): Array; - intersectionBy( - iteratee: ValueOnlyIteratee - ): ((a1: $ReadOnlyArray) => (a2: $ReadOnlyArray) => Array) & - ((a1: $ReadOnlyArray, a2: $ReadOnlyArray) => Array); - intersectionBy( - iteratee: ValueOnlyIteratee, - a1: $ReadOnlyArray - ): (a2: $ReadOnlyArray) => Array; - intersectionBy( - iteratee: ValueOnlyIteratee, - a1: $ReadOnlyArray, - a2: $ReadOnlyArray - ): Array; - intersectionWith( - comparator: Comparator - ): ((a1: $ReadOnlyArray) => (a2: $ReadOnlyArray) => Array) & - ((a1: $ReadOnlyArray, a2: $ReadOnlyArray) => Array); - intersectionWith( - comparator: Comparator, - a1: $ReadOnlyArray - ): (a2: $ReadOnlyArray) => Array; - intersectionWith( - comparator: Comparator, - a1: $ReadOnlyArray, - a2: $ReadOnlyArray - ): Array; - join(separator: string): (array: $ReadOnlyArray) => string; - join(separator: string, array: $ReadOnlyArray): string; - last(array: $ReadOnlyArray): T; - lastIndexOf(value: T): (array: $ReadOnlyArray) => number; - lastIndexOf(value: T, array: $ReadOnlyArray): number; - lastIndexOfFrom( - value: T - ): ((fromIndex: number) => (array: $ReadOnlyArray) => number) & - ((fromIndex: number, array: $ReadOnlyArray) => number); - lastIndexOfFrom( - value: T, - fromIndex: number - ): (array: $ReadOnlyArray) => number; - lastIndexOfFrom(value: T, fromIndex: number, array: $ReadOnlyArray): number; - nth(n: number): (array: $ReadOnlyArray) => T; - nth(n: number, array: $ReadOnlyArray): T; - pull(value: T): (array: Array) => Array; - pull(value: T, array: Array): Array; - pullAll(values: $ReadOnlyArray): (array: Array) => Array; - pullAll(values: $ReadOnlyArray, array: Array): Array; - pullAllBy( - iteratee: ValueOnlyIteratee - ): ((values: $ReadOnlyArray) => (array: Array) => Array) & - ((values: $ReadOnlyArray, array: Array) => Array); - pullAllBy( - iteratee: ValueOnlyIteratee, - values: $ReadOnlyArray - ): (array: Array) => Array; - pullAllBy( - iteratee: ValueOnlyIteratee, - values: $ReadOnlyArray, - array: Array - ): Array; - pullAllWith( - comparator: Function - ): ((values: Array) => (array: Array) => Array) & - ((values: Array, array: Array) => Array); - pullAllWith(comparator: Function, values: Array): (array: Array) => Array; - pullAllWith(comparator: Function, values: Array, array: Array): Array; - pullAt(indexed: Array): (array: Array) => Array; - pullAt(indexed: Array, array: Array): Array; - remove(predicate: Predicate): (array: Array) => Array; - remove(predicate: Predicate, array: Array): Array; - reverse(array: Array): Array; - slice( - start: number - ): ((end: number) => (array: $ReadOnlyArray) => Array) & - ((end: number, array: $ReadOnlyArray) => Array); - slice(start: number, end: number): (array: $ReadOnlyArray) => Array; - slice(start: number, end: number, array: $ReadOnlyArray): Array; - sortedIndex(value: T): (array: $ReadOnlyArray) => number; - sortedIndex(value: T, array: $ReadOnlyArray): number; - sortedIndexBy( - iteratee: ValueOnlyIteratee - ): ((value: T) => (array: $ReadOnlyArray) => number) & - ((value: T, array: $ReadOnlyArray) => number); - sortedIndexBy( - iteratee: ValueOnlyIteratee, - value: T - ): (array: $ReadOnlyArray) => number; - sortedIndexBy( - iteratee: ValueOnlyIteratee, - value: T, - array: $ReadOnlyArray - ): number; - sortedIndexOf(value: T): (array: $ReadOnlyArray) => number; - sortedIndexOf(value: T, array: $ReadOnlyArray): number; - sortedLastIndex(value: T): (array: $ReadOnlyArray) => number; - sortedLastIndex(value: T, array: $ReadOnlyArray): number; - sortedLastIndexBy( - iteratee: ValueOnlyIteratee - ): ((value: T) => (array: $ReadOnlyArray) => number) & - ((value: T, array: $ReadOnlyArray) => number); - sortedLastIndexBy( - iteratee: ValueOnlyIteratee, - value: T - ): (array: $ReadOnlyArray) => number; - sortedLastIndexBy( - iteratee: ValueOnlyIteratee, - value: T, - array: $ReadOnlyArray - ): number; - sortedLastIndexOf(value: T): (array: $ReadOnlyArray) => number; - sortedLastIndexOf(value: T, array: $ReadOnlyArray): number; - sortedUniq(array: $ReadOnlyArray): Array; - sortedUniqBy(iteratee: ValueOnlyIteratee, array: $ReadOnlyArray): Array; - tail(array: $ReadOnlyArray): Array; - take(n: number): (array: $ReadOnlyArray) => Array; - take(n: number, array: $ReadOnlyArray): Array; - takeRight(n: number): (array: $ReadOnlyArray) => Array; - takeRight(n: number, array: $ReadOnlyArray): Array; - takeLast(n: number): (array: $ReadOnlyArray) => Array; - takeLast(n: number, array: $ReadOnlyArray): Array; - takeRightWhile(predicate: Predicate): (array: $ReadOnlyArray) => Array; - takeRightWhile(predicate: Predicate, array: $ReadOnlyArray): Array; - takeLastWhile(predicate: Predicate): (array: $ReadOnlyArray) => Array; - takeLastWhile(predicate: Predicate, array: $ReadOnlyArray): Array; - takeWhile(predicate: Predicate): (array: $ReadOnlyArray) => Array; - takeWhile(predicate: Predicate, array: $ReadOnlyArray): Array; - union(a1: $ReadOnlyArray): (a2: $ReadOnlyArray) => Array; - union(a1: $ReadOnlyArray, a2: $ReadOnlyArray): Array; - unionBy( - iteratee: ValueOnlyIteratee - ): ((a1: $ReadOnlyArray) => (a2: $ReadOnlyArray) => Array) & - ((a1: $ReadOnlyArray, a2: $ReadOnlyArray) => Array); - unionBy( - iteratee: ValueOnlyIteratee, - a1: $ReadOnlyArray - ): (a2: $ReadOnlyArray) => Array; - unionBy( - iteratee: ValueOnlyIteratee, - a1: $ReadOnlyArray, - a2: $ReadOnlyArray - ): Array; - unionWith( - comparator: Comparator - ): ((a1: $ReadOnlyArray) => (a2: $ReadOnlyArray) => Array) & - ((a1: $ReadOnlyArray, a2: $ReadOnlyArray) => Array); - unionWith( - comparator: Comparator, - a1: $ReadOnlyArray - ): (a2: $ReadOnlyArray) => Array; - unionWith( - comparator: Comparator, - a1: $ReadOnlyArray, - a2: $ReadOnlyArray - ): Array; - uniq(array: $ReadOnlyArray): Array; - uniqBy(iteratee: ValueOnlyIteratee): (array: $ReadOnlyArray) => Array; - uniqBy(iteratee: ValueOnlyIteratee, array: $ReadOnlyArray): Array; - uniqWith(comparator: Comparator): (array: $ReadOnlyArray) => Array; - uniqWith(comparator: Comparator, array: $ReadOnlyArray): Array; - unzip(array: $ReadOnlyArray): Array; - unzipWith(iteratee: Iteratee): (array: $ReadOnlyArray) => Array; - unzipWith(iteratee: Iteratee, array: $ReadOnlyArray): Array; - without(values: $ReadOnlyArray): (array: $ReadOnlyArray) => Array; - without(values: $ReadOnlyArray, array: $ReadOnlyArray): Array; - xor(a1: $ReadOnlyArray): (a2: $ReadOnlyArray) => Array; - xor(a1: $ReadOnlyArray, a2: $ReadOnlyArray): Array; - symmetricDifference(a1: $ReadOnlyArray): (a2: $ReadOnlyArray) => Array; - symmetricDifference(a1: $ReadOnlyArray, a2: $ReadOnlyArray): Array; - xorBy( - iteratee: ValueOnlyIteratee - ): ((a1: $ReadOnlyArray) => (a2: $ReadOnlyArray) => Array) & - ((a1: $ReadOnlyArray, a2: $ReadOnlyArray) => Array); - xorBy( - iteratee: ValueOnlyIteratee, - a1: $ReadOnlyArray - ): (a2: $ReadOnlyArray) => Array; - xorBy( - iteratee: ValueOnlyIteratee, - a1: $ReadOnlyArray, - a2: $ReadOnlyArray - ): Array; - symmetricDifferenceBy( - iteratee: ValueOnlyIteratee - ): ((a1: $ReadOnlyArray) => (a2: $ReadOnlyArray) => Array) & - ((a1: $ReadOnlyArray, a2: $ReadOnlyArray) => Array); - symmetricDifferenceBy( - iteratee: ValueOnlyIteratee, - a1: $ReadOnlyArray - ): (a2: $ReadOnlyArray) => Array; - symmetricDifferenceBy( - iteratee: ValueOnlyIteratee, - a1: $ReadOnlyArray, - a2: $ReadOnlyArray - ): Array; - xorWith( - comparator: Comparator - ): ((a1: $ReadOnlyArray) => (a2: $ReadOnlyArray) => Array) & - ((a1: $ReadOnlyArray, a2: $ReadOnlyArray) => Array); - xorWith( - comparator: Comparator, - a1: $ReadOnlyArray - ): (a2: $ReadOnlyArray) => Array; - xorWith(comparator: Comparator, a1: $ReadOnlyArray, a2: $ReadOnlyArray): Array; - symmetricDifferenceWith( - comparator: Comparator - ): ((a1: $ReadOnlyArray) => (a2: $ReadOnlyArray) => Array) & - ((a1: $ReadOnlyArray, a2: $ReadOnlyArray) => Array); - symmetricDifferenceWith( - comparator: Comparator, - a1: $ReadOnlyArray - ): (a2: $ReadOnlyArray) => Array; - symmetricDifferenceWith( - comparator: Comparator, - a1: $ReadOnlyArray, - a2: $ReadOnlyArray - ): Array; - zip(a1: $ReadOnlyArray): (a2: $ReadOnlyArray) => Array<[A, B]>; - zip(a1: $ReadOnlyArray, a2: $ReadOnlyArray): Array<[A, B]>; - zipAll(arrays: $ReadOnlyArray<$ReadOnlyArray>): Array; - zipObject(props?: $ReadOnlyArray): (values?: $ReadOnlyArray) => { [key: K]: V, ... }; - zipObject(props?: $ReadOnlyArray, values?: $ReadOnlyArray): { [key: K]: V, ... }; - zipObj(props: $ReadOnlyArray): (values: $ReadOnlyArray) => Object; - zipObj(props: $ReadOnlyArray, values: $ReadOnlyArray): Object; - zipObjectDeep(props: $ReadOnlyArray): (values: any) => Object; - zipObjectDeep(props: $ReadOnlyArray, values: any): Object; - zipWith( - iteratee: Iteratee - ): ((a1: NestedArray) => (a2: NestedArray) => Array) & - ((a1: NestedArray, a2: NestedArray) => Array); - zipWith( - iteratee: Iteratee, - a1: NestedArray - ): (a2: NestedArray) => Array; - zipWith( - iteratee: Iteratee, - a1: NestedArray, - a2: NestedArray - ): Array; - - // Collection - countBy( - iteratee: ValueOnlyIteratee - ): (collection: Collection) => { [string]: number, ... }; - countBy( - iteratee: ValueOnlyIteratee, - collection: Collection - ): { [string]: number, ... }; - // alias of _.forEach - each( - iteratee: Iteratee | OIteratee - ): (collection: Collection) => Array; - each( - iteratee: Iteratee | OIteratee, - collection: Collection - ): Array; - // alias of _.forEachRight - eachRight( - iteratee: Iteratee | OIteratee - ): (collection: Collection) => Array; - eachRight( - iteratee: Iteratee | OIteratee, - collection: Collection - ): Array; - every( - iteratee: Iteratee | OIteratee - ): (collection: Collection) => boolean; - every( - iteratee: Iteratee | OIteratee, - collection: Collection - ): boolean; - all( - iteratee: Iteratee | OIteratee - ): (collection: Collection) => boolean; - all( - iteratee: Iteratee | OIteratee, - collection: Collection - ): boolean; - filter( - predicate: Predicate | OPredicate - ): (collection: Collection) => Array; - filter( - predicate: Predicate | OPredicate, - collection: Collection - ): Array; - find( - predicate: Predicate | OPredicate - ): (collection: Collection) => T | void; - find( - predicate: Predicate | OPredicate, - collection: Collection - ): T | void; - findFrom( - predicate: Predicate | OPredicate - ): (( - fromIndex: number - ) => (collection: Collection) => T | void) & - (( - fromIndex: number, - collection: Collection - ) => T | void); - findFrom( - predicate: Predicate | OPredicate, - fromIndex: number - ): (collection: Collection) => T | void; - findFrom( - predicate: Predicate | OPredicate, - fromIndex: number, - collection: Collection - ): T | void; - findLast( - predicate: Predicate | OPredicate - ): (collection: Collection) => T | void; - findLast( - predicate: Predicate | OPredicate, - collection: Collection - ): T | void; - findLastFrom( - predicate: Predicate | OPredicate - ): (( - fromIndex: number - ) => (collection: Collection) => T | void) & - (( - fromIndex: number, - collection: Collection - ) => T | void); - findLastFrom( - predicate: Predicate | OPredicate, - fromIndex: number - ): (collection: Collection) => T | void; - findLastFrom( - predicate: Predicate | OPredicate, - fromIndex: number, - collection: Collection - ): T | void; - flatMap( - iteratee: AFlatMapIteratee | OFlatMapIteratee - ): (collection: Collection) => Array; - flatMap( - iteratee: AFlatMapIteratee | OFlatMapIteratee, - collection: Collection - ): Array; - flatMapDeep( - iteratee: AFlatMapIteratee | OFlatMapIteratee - ): (collection: Collection) => Array; - flatMapDeep( - iteratee: AFlatMapIteratee | OFlatMapIteratee, - collection: Collection - ): Array; - flatMapDepth( - iteratee: AFlatMapIteratee | OFlatMapIteratee - ): (( - depth: number - ) => (collection: Collection) => Array) & - ((depth: number, collection: Collection) => Array); - flatMapDepth( - iteratee: AFlatMapIteratee | OFlatMapIteratee, - depth: number - ): (collection: Collection) => Array; - flatMapDepth( - iteratee: AFlatMapIteratee | OFlatMapIteratee, - depth: number, - collection: Collection - ): Array; - forEach( - iteratee: Iteratee | OIteratee - ): (collection: Collection) => Array; - forEach( - iteratee: Iteratee | OIteratee, - collection: Collection - ): Array; - forEachRight( - iteratee: Iteratee | OIteratee - ): (collection: Collection) => Array; - forEachRight( - iteratee: Iteratee | OIteratee, - collection: Collection - ): Array; - groupBy( - iteratee: ValueOnlyIteratee - ): ( - collection: Collection - ) => { [key: V]: Array, ... }; - groupBy( - iteratee: ValueOnlyIteratee, - collection: Collection - ): { [key: V]: Array, ... }; - includes(value: T): (collection: Collection) => boolean; - includes(value: T, collection: Collection): boolean; - includes(value: string): (str: string) => boolean; - includes(value: string, str: string): boolean; - contains(value: string): (str: string) => boolean; - contains(value: string, str: string): boolean; - contains(value: T): (collection: Collection) => boolean; - contains(value: T, collection: Collection): boolean; - includesFrom( - value: string - ): ((fromIndex: number) => (str: string) => boolean) & - ((fromIndex: number, str: string) => boolean); - includesFrom(value: string, fromIndex: number): (str: string) => boolean; - includesFrom(value: string, fromIndex: number, str: string): boolean; - includesFrom( - value: T - ): ((fromIndex: number) => (collection: $ReadOnlyArray) => boolean) & - ((fromIndex: number, collection: $ReadOnlyArray) => boolean); - includesFrom( - value: T, - fromIndex: number - ): (collection: $ReadOnlyArray) => boolean; - includesFrom(value: T, fromIndex: number, collection: $ReadOnlyArray): boolean; - invokeMap( - path: ((value: T) => Path) | Path - ): (collection: Collection) => Array; - invokeMap( - path: ((value: T) => Path) | Path, - collection: Collection - ): Array; - invokeArgsMap( - path: ((value: T) => Path) | Path - ): (( - collection: Collection - ) => (args: $ReadOnlyArray) => Array) & - (( - collection: Collection, - args: $ReadOnlyArray - ) => Array); - invokeArgsMap( - path: ((value: T) => Path) | Path, - collection: Collection - ): (args: $ReadOnlyArray) => Array; - invokeArgsMap( - path: ((value: T) => Path) | Path, - collection: Collection, - args: $ReadOnlyArray - ): Array; - keyBy( - iteratee: ValueOnlyIteratee - ): (collection: Collection) => { [key: V]: T, ... }; - keyBy( - iteratee: ValueOnlyIteratee, - collection: Collection - ): { [key: V]: T, ... }; - indexBy( - iteratee: ValueOnlyIteratee - ): (collection: Collection) => { [key: V]: T, ... }; - indexBy( - iteratee: ValueOnlyIteratee, - collection: Collection - ): { [key: V]: T, ... }; - map( - iteratee: MapIterator | OMapIterator - ): (collection: Collection) => Array; - map( - iteratee: MapIterator | OMapIterator, - collection: Collection - ): Array; - map(iteratee: (char: string) => any): (str: string) => string; - map(iteratee: (char: string) => any, str: string): string; - pluck( - iteratee: MapIterator | OMapIterator - ): (collection: Collection) => Array; - pluck( - iteratee: MapIterator | OMapIterator, - collection: Collection - ): Array; - pluck(iteratee: (char: string) => any): (str: string) => string; - pluck(iteratee: (char: string) => any, str: string): string; - orderBy( - iteratees: $ReadOnlyArray | OIteratee<*>> | string - ): (( - orders: $ReadOnlyArray<"asc" | "desc"> | string - ) => (collection: Collection) => Array) & - (( - orders: $ReadOnlyArray<"asc" | "desc"> | string, - collection: Collection - ) => Array); - orderBy( - iteratees: $ReadOnlyArray | OIteratee<*>> | string, - orders: $ReadOnlyArray<"asc" | "desc"> | string - ): (collection: Collection) => Array; - orderBy( - iteratees: $ReadOnlyArray | OIteratee<*>> | string, - orders: $ReadOnlyArray<"asc" | "desc"> | string, - collection: Collection - ): Array; - partition( - predicate: Predicate | OPredicate - ): (collection: Collection) => [Array, Array]; - partition( - predicate: Predicate | OPredicate, - collection: Collection - ): [Array, Array]; - reduce( - iteratee: (accumulator: U, value: T) => U - ): ((accumulator: U) => (collection: Collection) => U) & - ((accumulator: U, collection: Collection) => U); - reduce( - iteratee: (accumulator: U, value: T) => U, - accumulator: U - ): (collection: Collection) => U; - reduce( - iteratee: (accumulator: U, value: T) => U, - accumulator: U, - collection: Collection - ): U; - reduceRight( - iteratee: (value: T, accumulator: U) => U - ): ((accumulator: U) => (collection: Collection) => U) & - ((accumulator: U, collection: Collection) => U); - reduceRight( - iteratee: (value: T, accumulator: U) => U, - accumulator: U - ): (collection: Collection) => U; - reduceRight( - iteratee: (value: T, accumulator: U) => U, - accumulator: U, - collection: Collection - ): U; - reject( - predicate: Predicate | OPredicate - ): (collection: Collection) => Array; - reject( - predicate: Predicate | OPredicate, - collection: Collection - ): Array; - sample(collection: Collection): T; - sampleSize( - n: number - ): (collection: Collection) => Array; - sampleSize(n: number, collection: Collection): Array; - shuffle(collection: Collection): Array; - size(collection: $ReadOnlyArray | Object | string): number; - some( - predicate: Predicate | OPredicate - ): (collection: Collection) => boolean; - some( - predicate: Predicate | OPredicate, - collection: Collection - ): boolean; - any( - predicate: Predicate | OPredicate - ): (collection: Collection) => boolean; - any( - predicate: Predicate | OPredicate, - collection: Collection - ): boolean; - sortBy( - iteratees: - | $ReadOnlyArray | OIteratee> - | Iteratee - | OIteratee - ): (collection: Collection) => Array; - sortBy( - iteratees: - | $ReadOnlyArray | OIteratee> - | Iteratee - | OIteratee, - collection: Collection - ): Array; - - // Date - now(): number; - - // Function - after(fn: Function): (n: number) => Function; - after(fn: Function, n: number): Function; - ary(func: Function): Function; - nAry(n: number): (func: Function) => Function; - nAry(n: number, func: Function): Function; - before(fn: Function): (n: number) => Function; - before(fn: Function, n: number): Function; - bind(func: Function): (thisArg: any) => Function; - bind(func: Function, thisArg: any): Function; - bindKey(obj: Object): (key: string) => Function; - bindKey(obj: Object, key: string): Function; - curry: Curry; - curryN(arity: number): (func: Function) => Function; - curryN(arity: number, func: Function): Function; - curryRight(func: Function): Function; - curryRightN(arity: number): (func: Function) => Function; - curryRightN(arity: number, func: Function): Function; - debounce(wait: number): (func: (...A) => R) => (...A) => R; - debounce(wait: number, func: (...A) => R): (...A) => R; - defer(func: (...$ReadOnlyArray) => any): TimeoutID; - delay(wait: number): (func: Function) => TimeoutID; - delay(wait: number, func: Function): TimeoutID; - flip(func: Function): Function; - memoize(func: F): F; - negate(predicate: (...A) => R): (...A) => boolean; - complement(predicate: Function): Function; - once(func: Function): Function; - overArgs(func: Function): (transforms: $ReadOnlyArray) => Function; - overArgs(func: Function, transforms: $ReadOnlyArray): Function; - useWith(func: Function): (transforms: $ReadOnlyArray) => Function; - useWith(func: Function, transforms: $ReadOnlyArray): Function; - partial(func: Function): (partials: $ReadOnlyArray) => Function; - partial(func: Function, partials: $ReadOnlyArray): Function; - partialRight(func: Function): (partials: $ReadOnlyArray) => Function; - partialRight(func: Function, partials: $ReadOnlyArray): Function; - rearg(indexes: $ReadOnlyArray): (func: Function) => Function; - rearg(indexes: $ReadOnlyArray, func: Function): Function; - rest(func: Function): Function; - unapply(func: Function): Function; - restFrom(start: number): (func: Function) => Function; - restFrom(start: number, func: Function): Function; - spread(func: Function): Function; - apply(func: Function): Function; - spreadFrom(start: number): (func: Function) => Function; - spreadFrom(start: number, func: Function): Function; - throttle(wait: number): (func: (...A) => R) => (...A) => R; - throttle(wait: number, func: (...A) => R): (...A) => R; - unary(func: (T, ...$ReadOnlyArray) => R): (T) => R; - wrap(wrapper: Function): (value: any) => Function; - wrap(wrapper: Function, value: any): Function; - - // Lang - castArray(): Array; - castArray(value: T): Array; - castArray>(value: T): T; - clone(value: T): T; - cloneDeep(value: T): T; - cloneDeepWith( - customizer: (value: T, key: number | string, object: T, stack: any) => U - ): (value: T) => U; - cloneDeepWith( - customizer: (value: T, key: number | string, object: T, stack: any) => U, - value: T - ): U; - cloneWith( - customizer: (value: T, key: number | string, object: T, stack: any) => U - ): (value: T) => U; - cloneWith( - customizer: (value: T, key: number | string, object: T, stack: any) => U, - value: T - ): U; - conformsTo>( - predicates: T & $ReadOnly<{ [key: string]: (x: any) => boolean, ... }> - ): (source: T) => boolean; - conformsTo>( - predicates: T & $ReadOnly<{ [key: string]: (x: any) => boolean, ... }>, - source: T - ): boolean; - where>( - predicates: T & $ReadOnly<{ [key: string]: (x: any) => boolean, ... }> - ): (source: T) => boolean; - where>( - predicates: T & $ReadOnly<{ [key: string]: (x: any) => boolean, ... }>, - source: T - ): boolean; - conforms>( - predicates: T & $ReadOnly<{ [key: string]: (x: any) => boolean, ... }> - ): (source: T) => boolean; - conforms>( - predicates: T & $ReadOnly<{ [key: string]: (x: any) => boolean, ... }>, - source: T - ): boolean; - eq(value: any): (other: any) => boolean; - eq(value: any, other: any): boolean; - identical(value: any): (other: any) => boolean; - identical(value: any, other: any): boolean; - gt(value: any): (other: any) => boolean; - gt(value: any, other: any): boolean; - gte(value: any): (other: any) => boolean; - gte(value: any, other: any): boolean; - isArguments(value: any): boolean; - isArray(value: any): boolean; - isArrayBuffer(value: any): boolean; - isArrayLike(value: any): boolean; - isArrayLikeObject(value: any): boolean; - isBoolean(value: any): boolean; - isBuffer(value: any): boolean; - isDate(value: any): boolean; - isElement(value: any): boolean; - isEmpty(value: any): boolean; - isEqual(value: any): (other: any) => boolean; - isEqual(value: any, other: any): boolean; - equals(value: any): (other: any) => boolean; - equals(value: any, other: any): boolean; - isEqualWith( - customizer: ( - objValue: any, - otherValue: any, - key: number | string, - object: T, - other: U, - stack: any - ) => boolean | void - ): ((value: T) => (other: U) => boolean) & - ((value: T, other: U) => boolean); - isEqualWith( - customizer: ( - objValue: any, - otherValue: any, - key: number | string, - object: T, - other: U, - stack: any - ) => boolean | void, - value: T - ): (other: U) => boolean; - isEqualWith( - customizer: ( - objValue: any, - otherValue: any, - key: number | string, - object: T, - other: U, - stack: any - ) => boolean | void, - value: T, - other: U - ): boolean; - isError(value: any): boolean; - isFinite(value: any): boolean; - isFunction(value: any): boolean; - isInteger(value: any): boolean; - isLength(value: any): boolean; - isMap(value: any): boolean; - isMatch(source: Object): (object: Object) => boolean; - isMatch(source: Object, object: Object): boolean; - whereEq(source: Object): (object: Object) => boolean; - whereEq(source: Object, object: Object): boolean; - isMatchWith( - customizer: ( - objValue: any, - srcValue: any, - key: number | string, - object: T, - source: U - ) => boolean | void - ): ((source: U) => (object: T) => boolean) & - ((source: U, object: T) => boolean); - isMatchWith( - customizer: ( - objValue: any, - srcValue: any, - key: number | string, - object: T, - source: U - ) => boolean | void, - source: U - ): (object: T) => boolean; - isMatchWith( - customizer: ( - objValue: any, - srcValue: any, - key: number | string, - object: T, - source: U - ) => boolean | void, - source: U, - object: T - ): boolean; - isNaN(value: any): boolean; - isNative(value: any): boolean; - isNil(value: any): boolean; - isNull(value: any): boolean; - isNumber(value: any): boolean; - isObject(value: any): boolean; - isObjectLike(value: any): boolean; - isPlainObject(value: any): boolean; - isRegExp(value: any): boolean; - isSafeInteger(value: any): boolean; - isSet(value: any): boolean; - isString(value: string): true; - isString(value: any): false; - isSymbol(value: any): boolean; - isTypedArray(value: any): boolean; - isUndefined(value: any): boolean; - isWeakMap(value: any): boolean; - isWeakSet(value: any): boolean; - lt(value: any): (other: any) => boolean; - lt(value: any, other: any): boolean; - lte(value: any): (other: any) => boolean; - lte(value: any, other: any): boolean; - toArray(value: any): Array; - toFinite(value: any): number; - toInteger(value: any): number; - toLength(value: any): number; - toNumber(value: any): number; - toPlainObject(value: any): Object; - toSafeInteger(value: any): number; - toString(value: any): string; - - // Math - add(augend: number): (addend: number) => number; - add(augend: number, addend: number): number; - ceil(number: number): number; - divide(dividend: number): (divisor: number) => number; - divide(dividend: number, divisor: number): number; - floor(number: number): number; - max(array: $ReadOnlyArray): T; - maxBy(iteratee: Iteratee): (array: $ReadOnlyArray) => T; - maxBy(iteratee: Iteratee, array: $ReadOnlyArray): T; - mean(array: $ReadOnlyArray<*>): number; - meanBy(iteratee: Iteratee): (array: $ReadOnlyArray) => number; - meanBy(iteratee: Iteratee, array: $ReadOnlyArray): number; - min(array: $ReadOnlyArray): T; - minBy(iteratee: Iteratee): (array: $ReadOnlyArray) => T; - minBy(iteratee: Iteratee, array: $ReadOnlyArray): T; - multiply(multiplier: number): (multiplicand: number) => number; - multiply(multiplier: number, multiplicand: number): number; - round(number: number): number; - subtract(minuend: number): (subtrahend: number) => number; - subtract(minuend: number, subtrahend: number): number; - sum(array: $ReadOnlyArray<*>): number; - sumBy(iteratee: Iteratee): (array: $ReadOnlyArray) => number; - sumBy(iteratee: Iteratee, array: $ReadOnlyArray): number; - - // number - clamp( - lower: number - ): ((upper: number) => (number: number) => number) & - ((upper: number, number: number) => number); - clamp(lower: number, upper: number): (number: number) => number; - clamp(lower: number, upper: number, number: number): number; - inRange( - start: number - ): ((end: number) => (number: number) => boolean) & - ((end: number, number: number) => boolean); - inRange(start: number, end: number): (number: number) => boolean; - inRange(start: number, end: number, number: number): boolean; - random(lower: number): (upper: number) => number; - random(lower: number, upper: number): number; - - // Object - assign(object: Object): (source: Object) => Object; - assign(object: Object, source: Object): Object; - assignAll(objects: Array): Object; - assignInAll(objects: Array): Object; - extendAll(objects: Array): Object; - assignIn(a: A): (b: B) => A & B; - assignIn(a: A, b: B): A & B; - assignInWith( - customizer: ( - objValue: any, - srcValue: any, - key: string, - object: T, - source: A - ) => any | void - ): ((object: T) => (s1: A) => Object) & ((object: T, s1: A) => Object); - assignInWith( - customizer: ( - objValue: any, - srcValue: any, - key: string, - object: T, - source: A - ) => any | void, - object: T - ): (s1: A) => Object; - assignInWith( - customizer: ( - objValue: any, - srcValue: any, - key: string, - object: T, - source: A - ) => any | void, - object: T, - s1: A - ): Object; - assignWith( - customizer: ( - objValue: any, - srcValue: any, - key: string, - object: T, - source: A - ) => any | void - ): ((object: T) => (s1: A) => Object) & ((object: T, s1: A) => Object); - assignWith( - customizer: ( - objValue: any, - srcValue: any, - key: string, - object: T, - source: A - ) => any | void, - object: T - ): (s1: A) => Object; - assignWith( - customizer: ( - objValue: any, - srcValue: any, - key: string, - object: T, - source: A - ) => any | void, - object: T, - s1: A - ): Object; - assignInAllWith( - customizer: ( - objValue: any, - srcValue: any, - key: string, - object: Object, - source: Object - ) => any | void - ): (objects: Array) => Object; - assignInAllWith( - customizer: ( - objValue: any, - srcValue: any, - key: string, - object: Object, - source: Object - ) => any | void, - objects: Array - ): Object; - extendAllWith( - customizer: ( - objValue: any, - srcValue: any, - key: string, - object: Object, - source: Object - ) => any | void - ): (objects: Array) => Object; - extendAllWith( - customizer: ( - objValue: any, - srcValue: any, - key: string, - object: Object, - source: Object - ) => any | void, - objects: Array - ): Object; - assignAllWith( - customizer: ( - objValue: any, - srcValue: any, - key: string, - object: Object, - source: Object - ) => any | void - ): (objects: Array) => Object; - assignAllWith( - customizer: ( - objValue: any, - srcValue: any, - key: string, - object: Object, - source: Object - ) => any | void, - objects: Array - ): Object; - at(paths: $ReadOnlyArray): (object: Object) => Array; - at(paths: $ReadOnlyArray, object: Object): Array; - props(paths: $ReadOnlyArray): (object: Object) => Array; - props(paths: $ReadOnlyArray, object: Object): Array; - paths(paths: $ReadOnlyArray): (object: Object) => Array; - paths(paths: $ReadOnlyArray, object: Object): Array; - create(prototype: T): T; - defaults(source: Object): (object: Object) => Object; - defaults(source: Object, object: Object): Object; - defaultsAll(objects: Array): Object; - defaultsDeep(source: Object): (object: Object) => Object; - defaultsDeep(source: Object, object: Object): Object; - defaultsDeepAll(objects: Array): Object; - // alias for _.toPairs - entries(object: Object): Array<[string, any]>; - // alias for _.toPairsIn - entriesIn(object: Object): Array<[string, any]>; - // alias for _.assignIn - extend(a: A): (b: B) => A & B; - extend(a: A, b: B): A & B; - // alias for _.assignInWith - extendWith( - customizer: ( - objValue: any, - srcValue: any, - key: string, - object: T, - source: A - ) => any | void - ): ((object: T) => (s1: A) => Object) & ((object: T, s1: A) => Object); - extendWith( - customizer: ( - objValue: any, - srcValue: any, - key: string, - object: T, - source: A - ) => any | void, - object: T - ): (s1: A) => Object; - extendWith( - customizer: ( - objValue: any, - srcValue: any, - key: string, - object: T, - source: A - ) => any | void, - object: T, - s1: A - ): Object; - findKey>( - predicate: OPredicate - ): (object: T) => string | void; - findKey>( - predicate: OPredicate, - object: T - ): string | void; - findLastKey>( - predicate: OPredicate - ): (object: T) => string | void; - findLastKey>( - predicate: OPredicate, - object: T - ): string | void; - forIn(iteratee: OIteratee<*>): (object: Object) => Object; - forIn(iteratee: OIteratee<*>, object: Object): Object; - forInRight(iteratee: OIteratee<*>): (object: Object) => Object; - forInRight(iteratee: OIteratee<*>, object: Object): Object; - forOwn(iteratee: OIteratee<*>): (object: Object) => Object; - forOwn(iteratee: OIteratee<*>, object: Object): Object; - forOwnRight(iteratee: OIteratee<*>): (object: Object) => Object; - forOwnRight(iteratee: OIteratee<*>, object: Object): Object; - functions(object: Object): Array; - functionsIn(object: Object): Array; - get( - path: Path - ): (object: Object | $ReadOnlyArray | void | null) => any; - get( - path: Path, - object: Object | $ReadOnlyArray | void | null - ): any; - prop(path: Path): (object: Object | $ReadOnlyArray) => any; - prop(path: Path, object: Object | $ReadOnlyArray): any; - path(path: Path): (object: Object | $ReadOnlyArray) => any; - path(path: Path, object: Object | $ReadOnlyArray): any; - getOr( - defaultValue: any - ): (( - path: Path - ) => (object: Object | $ReadOnlyArray) => any) & - (( - path: Path, - object: Object | $ReadOnlyArray | void | null - ) => any); - getOr( - defaultValue: any, - path: Path - ): (object: Object | $ReadOnlyArray | void | null) => any; - getOr( - defaultValue: any, - path: Path, - object: Object | $ReadOnlyArray | void | null - ): any; - propOr( - defaultValue: any - ): (( - path: Path - ) => (object: Object | $ReadOnlyArray) => any) & - ((path: Path, object: Object | $ReadOnlyArray) => any); - propOr( - defaultValue: any, - path: Path - ): (object: Object | $ReadOnlyArray) => any; - propOr( - defaultValue: any, - path: Path, - object: Object | $ReadOnlyArray - ): any; - pathOr( - defaultValue: any - ): (( - path: Path - ) => (object: Object | $ReadOnlyArray) => any) & - ((path: Path, object: Object | $ReadOnlyArray) => any); - pathOr( - defaultValue: any, - path: Path - ): (object: Object | $ReadOnlyArray) => any; - pathOr( - defaultValue: any, - path: Path, - object: Object | $ReadOnlyArray - ): any; - has(path: Path): (object: Object) => boolean; - has(path: Path, object: Object): boolean; - hasIn(path: Path): (object: Object) => boolean; - hasIn(path: Path, object: Object): boolean; - invert(object: Object): Object; - invertObj(object: Object): Object; - invertBy(iteratee: Function): (object: Object) => Object; - invertBy(iteratee: Function, object: Object): Object; - invoke(path: Path): (object: Object) => any; - invoke(path: Path, object: Object): any; - invokeArgs( - path: Path - ): ((object: Object) => (args: Array) => any) & - ((object: Object, args: Array) => any); - invokeArgs( - path: Path, - object: Object - ): (args: Array) => any; - invokeArgs( - path: Path, - object: Object, - args: Array - ): any; - keys(object: ReadOnlyIndexerObject): Array; - keys(object: Object): Array; - keysIn(object: Object): Array; - mapKeys(iteratee: OIteratee<*>): (object: Object) => Object; - mapKeys(iteratee: OIteratee<*>, object: Object): Object; - mapValues(iteratee: OIteratee<*>): (object: Object) => Object; - mapValues(iteratee: OIteratee<*>, object: Object): Object; - merge(object: Object): (source: Object) => Object; - merge(object: Object, source: Object): Object; - mergeAll(objects: $ReadOnlyArray): Object; - mergeWith( - customizer: ( - objValue: any, - srcValue: any, - key: string, - object: T, - source: A | B - ) => any | void - ): ((object: T) => (s1: A) => Object) & ((object: T, s1: A) => Object); - mergeWith( - customizer: ( - objValue: any, - srcValue: any, - key: string, - object: T, - source: A | B - ) => any | void, - object: T - ): (s1: A) => Object; - mergeWith( - customizer: ( - objValue: any, - srcValue: any, - key: string, - object: T, - source: A | B - ) => any | void, - object: T, - s1: A - ): Object; - mergeAllWith( - customizer: ( - objValue: any, - srcValue: any, - key: string, - object: Object, - source: Object - ) => any | void - ): (objects: $ReadOnlyArray) => Object; - mergeAllWith( - customizer: ( - objValue: any, - srcValue: any, - key: string, - object: Object, - source: Object - ) => any | void, - objects: $ReadOnlyArray - ): Object; - omit(props: $ReadOnlyArray): (object: Object) => Object; - omit(props: $ReadOnlyArray, object: Object): Object; - omitAll(props: $ReadOnlyArray): (object: Object) => Object; - omitAll(props: $ReadOnlyArray, object: Object): Object; - omitBy>( - predicate: OPredicate - ): (object: T) => Object; - omitBy>(predicate: OPredicate, object: T): Object; - pick(...props: $ReadOnlyArray): Object; - pick(props: $ReadOnlyArray, object: Object): Object; - pick(...props: $ReadOnlyArray): (object: Object) => Object; - pick(props: $ReadOnlyArray): (object: Object) => Object; - pickAll(props: $ReadOnlyArray): (object: Object) => Object; - pickAll(props: $ReadOnlyArray, object: Object): Object; - pickBy>( - predicate: OPredicate - ): (object: T) => Object; - pickBy>(predicate: OPredicate, object: T): Object; - result(path: Path): (object: Object) => any; - result(path: Path, object: Object): any; - set( - path: Path - ): ((value: any) => (object: Object) => Object) & - ((value: any, object: Object) => Object); - set(path: Path, value: any): (object: Object) => Object; - set(path: Path, value: any, object: Object): Object; - assoc( - path: Path - ): ((value: any) => (object: Object) => Object) & - ((value: any, object: Object) => Object); - assoc(path: Path, value: any): (object: Object) => Object; - assoc(path: Path, value: any, object: Object): Object; - assocPath( - path: Path - ): ((value: any) => (object: Object) => Object) & - ((value: any, object: Object) => Object); - assocPath( - path: Path, - value: any - ): (object: Object) => Object; - assocPath(path: Path, value: any, object: Object): Object; - setWith( - customizer: (nsValue: any, key: string, nsObject: T) => any - ): (( - path: Path - ) => ((value: any) => (object: T) => Object) & - ((value: any, object: T) => Object)) & - ((path: Path, value: any) => (object: T) => Object) & - ((path: Path, value: any, object: T) => Object); - setWith( - customizer: (nsValue: any, key: string, nsObject: T) => any, - path: Path - ): ((value: any) => (object: T) => Object) & - ((value: any, object: T) => Object); - setWith( - customizer: (nsValue: any, key: string, nsObject: T) => any, - path: Path, - value: any - ): (object: T) => Object; - setWith( - customizer: (nsValue: any, key: string, nsObject: T) => any, - path: Path, - value: any, - object: T - ): Object; - toPairs(object: Object | $ReadOnlyArray<*>): Array<[string, any]>; - toPairsIn(object: Object): Array<[string, any]>; - transform( - iteratee: OIteratee<*> - ): (( - accumulator: any - ) => (collection: Object | $ReadOnlyArray) => any) & - ((accumulator: any, collection: Object | $ReadOnlyArray) => any); - transform( - iteratee: OIteratee<*>, - accumulator: any - ): (collection: Object | $ReadOnlyArray) => any; - transform( - iteratee: OIteratee<*>, - accumulator: any, - collection: Object | $ReadOnlyArray - ): any; - unset(path: Path): (object: Object) => Object; - unset(path: Path, object: Object): Object; - dissoc(path: Path): (object: Object) => Object; - dissoc(path: Path, object: Object): Object; - dissocPath(path: Path): (object: Object) => Object; - dissocPath(path: Path, object: Object): Object; - update( - path: Path - ): ((updater: Function) => (object: Object) => Object) & - ((updater: Function, object: Object) => Object); - update( - path: Path, - updater: Function - ): (object: Object) => Object; - update(path: Path, updater: Function, object: Object): Object; - updateWith( - customizer: Function - ): (( - path: Path - ) => ((updater: Function) => (object: Object) => Object) & - ((updater: Function, object: Object) => Object)) & - (( - path: Path, - updater: Function - ) => (object: Object) => Object) & - ((path: Path, updater: Function, object: Object) => Object); - updateWith( - customizer: Function, - path: Path - ): ((updater: Function) => (object: Object) => Object) & - ((updater: Function, object: Object) => Object); - updateWith( - customizer: Function, - path: Path, - updater: Function - ): (object: Object) => Object; - updateWith( - customizer: Function, - path: Path, - updater: Function, - object: Object - ): Object; - values(object: Object): Array; - valuesIn(object: Object): Array; - - tap(interceptor: (value: T) => any): (value: T) => T; - tap(interceptor: (value: T) => any, value: T): T; - thru(interceptor: (value: T1) => T2): (value: T1) => T2; - thru(interceptor: (value: T1) => T2, value: T1): T2; - - // String - camelCase(string: string): string; - capitalize(string: string): string; - deburr(string: string): string; - endsWith(target: string): (string: string) => boolean; - endsWith(target: string, string: string): boolean; - escape(string: string): string; - escapeRegExp(string: string): string; - kebabCase(string: string): string; - lowerCase(string: string): string; - lowerFirst(string: string): string; - pad(length: number): (string: string) => string; - pad(length: number, string: string): string; - padChars( - chars: string - ): ((length: number) => (string: string) => string) & - ((length: number, string: string) => string); - padChars(chars: string, length: number): (string: string) => string; - padChars(chars: string, length: number, string: string): string; - padEnd(length: number): (string: string) => string; - padEnd(length: number, string: string): string; - padCharsEnd( - chars: string - ): ((length: number) => (string: string) => string) & - ((length: number, string: string) => string); - padCharsEnd(chars: string, length: number): (string: string) => string; - padCharsEnd(chars: string, length: number, string: string): string; - padStart(length: number): (string: string) => string; - padStart(length: number, string: string): string; - padCharsStart( - chars: string - ): ((length: number) => (string: string) => string) & - ((length: number, string: string) => string); - padCharsStart(chars: string, length: number): (string: string) => string; - padCharsStart(chars: string, length: number, string: string): string; - parseInt(radix: number): (string: string) => number; - parseInt(radix: number, string: string): number; - repeat(n: number): (string: string) => string; - repeat(n: number, string: string): string; - replace( - pattern: RegExp | string - ): (( - replacement: ((string: string) => string) | string - ) => (string: string) => string) & - (( - replacement: ((string: string) => string) | string, - string: string - ) => string); - replace( - pattern: RegExp | string, - replacement: ((string: string) => string) | string - ): (string: string) => string; - replace( - pattern: RegExp | string, - replacement: ((string: string) => string) | string, - string: string - ): string; - snakeCase(string: string): string; - split(separator: RegExp | string): (string: string) => Array; - split(separator: RegExp | string, string: string): Array; - startCase(string: string): string; - startsWith(target: string): (string: string) => boolean; - startsWith(target: string, string: string): boolean; - template(string: string): Function; - toLower(string: string): string; - toUpper(string: string): string; - trim(string: string): string; - trimChars(chars: string): (string: string) => string; - trimChars(chars: string, string: string): string; - trimEnd(string: string): string; - trimCharsEnd(chars: string): (string: string) => string; - trimCharsEnd(chars: string, string: string): string; - trimStart(string: string): string; - trimCharsStart(chars: string): (string: string) => string; - trimCharsStart(chars: string, string: string): string; - truncate(options: TruncateOptions): (string: string) => string; - truncate(options: TruncateOptions, string: string): string; - unescape(string: string): string; - upperCase(string: string): string; - upperFirst(string: string): string; - words(string: string): Array; - - // Util - attempt(func: Function): any; - bindAll(methodNames: $ReadOnlyArray): (object: Object) => Object; - bindAll(methodNames: $ReadOnlyArray, object: Object): Object; - cond(pairs: NestedArray): Function; - constant(value: T): () => T; - always(value: T): () => T; - defaultTo(defaultValue: T2): (value: T1) => T2; - defaultTo(defaultValue: T2, value: T1): T2; - defaultTo( - defaultValue: T2 - ): (value: T1) => T1; - defaultTo( - defaultValue: T2, - value: T1 - ): T1; - // NaN is a number instead of its own type, otherwise it would behave like null/void - defaultTo(defaultValue: T2): (value: T1) => T1 | T2; - defaultTo(defaultValue: T2, value: T1): T1 | T2; - flow: $ComposeReverse & ((funcs: $ReadOnlyArray) => Function); - pipe: $ComposeReverse & ((funcs: $ReadOnlyArray) => Function); - flowRight: $Compose & ((funcs: $ReadOnlyArray) => Function); - compose: $Compose & ((funcs: $ReadOnlyArray) => Function); - compose(funcs: $ReadOnlyArray): Function; - identity(value: T): T; - iteratee(func: any): Function; - matches(source: Object): (object: Object) => boolean; - matches(source: Object, object: Object): boolean; - matchesProperty(path: Path): (srcValue: any) => Function; - matchesProperty(path: Path, srcValue: any): Function; - propEq(path: Path): (srcValue: any) => Function; - propEq(path: Path, srcValue: any): Function; - pathEq(path: Path): (srcValue: any) => Function; - pathEq(path: Path, srcValue: any): Function; - method(path: Path): Function; - methodOf(object: Object): Function; - mixin( - object: T - ): ((source: Object) => (options: { chain: boolean, ... }) => T) & - ((source: Object, options: { chain: boolean, ... }) => T); - mixin( - object: T, - source: Object - ): (options: { chain: boolean, ... }) => T; - mixin( - object: T, - source: Object, - options: { chain: boolean, ... } - ): T; - noConflict(): Lodash; - noop(...args: $ReadOnlyArray): void; - nthArg(n: number): Function; - over(iteratees: $ReadOnlyArray): Function; - juxt(iteratees: $ReadOnlyArray): Function; - overEvery(predicates: $ReadOnlyArray): Function; - allPass(predicates: $ReadOnlyArray): Function; - overSome(predicates: $ReadOnlyArray): Function; - anyPass(predicates: $ReadOnlyArray): Function; - property( - path: Path - ): (object: Object | $ReadOnlyArray) => any; - property(path: Path, object: Object | $ReadOnlyArray): any; - propertyOf(object: Object): (path: Path) => Function; - propertyOf(object: Object, path: Path): Function; - range(start: number): (end: number) => Array; - range(start: number, end: number): Array; - rangeStep( - step: number - ): ((start: number) => (end: number) => Array) & - ((start: number, end: number) => Array); - rangeStep(step: number, start: number): (end: number) => Array; - rangeStep(step: number, start: number, end: number): Array; - rangeRight(start: number): (end: number) => Array; - rangeRight(start: number, end: number): Array; - rangeStepRight( - step: number - ): ((start: number) => (end: number) => Array) & - ((start: number, end: number) => Array); - rangeStepRight(step: number, start: number): (end: number) => Array; - rangeStepRight(step: number, start: number, end: number): Array; - runInContext(context: Object): Function; - - stubArray(): Array<*>; - stubFalse(): false; - F(): false; - stubObject(): {...}; - stubString(): ""; - stubTrue(): true; - T(): true; - times(iteratee: (i: number) => T): (n: number) => Array; - times(iteratee: (i: number) => T, n: number): Array; - toPath(value: any): Array; - uniqueId(prefix: string): string; - - __: any; - placeholder: any; - - convert(options: { - cap?: boolean, - curry?: boolean, - fixed?: boolean, - immutable?: boolean, - rearg?: boolean, - ... - }): void; - - // Properties - VERSION: string; - templateSettings: TemplateSettings; - } - - declare module.exports: Lodash; -} - -declare module "lodash/chunk" { - declare module.exports: $PropertyType<$Exports<"lodash">, "chunk">; -} - -declare module "lodash/compact" { - declare module.exports: $PropertyType<$Exports<"lodash">, "compact">; -} - -declare module "lodash/concat" { - declare module.exports: $PropertyType<$Exports<"lodash">, "concat">; -} - -declare module "lodash/difference" { - declare module.exports: $PropertyType<$Exports<"lodash">, "difference">; -} - -declare module "lodash/differenceBy" { - declare module.exports: $PropertyType<$Exports<"lodash">, "differenceBy">; -} - -declare module "lodash/differenceWith" { - declare module.exports: $PropertyType<$Exports<"lodash">, "differenceWith">; -} - -declare module "lodash/drop" { - declare module.exports: $PropertyType<$Exports<"lodash">, "drop">; -} - -declare module "lodash/dropRight" { - declare module.exports: $PropertyType<$Exports<"lodash">, "dropRight">; -} - -declare module "lodash/dropRightWhile" { - declare module.exports: $PropertyType<$Exports<"lodash">, "dropRightWhile">; -} - -declare module "lodash/dropWhile" { - declare module.exports: $PropertyType<$Exports<"lodash">, "dropWhile">; -} - -declare module "lodash/fill" { - declare module.exports: $PropertyType<$Exports<"lodash">, "fill">; -} - -declare module "lodash/findIndex" { - declare module.exports: $PropertyType<$Exports<"lodash">, "findIndex">; -} - -declare module "lodash/findLastIndex" { - declare module.exports: $PropertyType<$Exports<"lodash">, "findLastIndex">; -} - -declare module "lodash/first" { - declare module.exports: $PropertyType<$Exports<"lodash">, "first">; -} - -declare module "lodash/flatten" { - declare module.exports: $PropertyType<$Exports<"lodash">, "flatten">; -} - -declare module "lodash/flattenDeep" { - declare module.exports: $PropertyType<$Exports<"lodash">, "flattenDeep">; -} - -declare module "lodash/flattenDepth" { - declare module.exports: $PropertyType<$Exports<"lodash">, "flattenDepth">; -} - -declare module "lodash/fromPairs" { - declare module.exports: $PropertyType<$Exports<"lodash">, "fromPairs">; -} - -declare module "lodash/head" { - declare module.exports: $PropertyType<$Exports<"lodash">, "head">; -} - -declare module "lodash/indexOf" { - declare module.exports: $PropertyType<$Exports<"lodash">, "indexOf">; -} - -declare module "lodash/initial" { - declare module.exports: $PropertyType<$Exports<"lodash">, "initial">; -} - -declare module "lodash/intersection" { - declare module.exports: $PropertyType<$Exports<"lodash">, "intersection">; -} - -declare module "lodash/intersectionBy" { - declare module.exports: $PropertyType<$Exports<"lodash">, "intersectionBy">; -} - -declare module "lodash/intersectionWith" { - declare module.exports: $PropertyType<$Exports<"lodash">, "intersectionWith">; -} - -declare module "lodash/join" { - declare module.exports: $PropertyType<$Exports<"lodash">, "join">; -} - -declare module "lodash/last" { - declare module.exports: $PropertyType<$Exports<"lodash">, "last">; -} - -declare module "lodash/lastIndexOf" { - declare module.exports: $PropertyType<$Exports<"lodash">, "lastIndexOf">; -} - -declare module "lodash/nth" { - declare module.exports: $PropertyType<$Exports<"lodash">, "nth">; -} - -declare module "lodash/pull" { - declare module.exports: $PropertyType<$Exports<"lodash">, "pull">; -} - -declare module "lodash/pullAll" { - declare module.exports: $PropertyType<$Exports<"lodash">, "pullAll">; -} - -declare module "lodash/pullAllBy" { - declare module.exports: $PropertyType<$Exports<"lodash">, "pullAllBy">; -} - -declare module "lodash/pullAllWith" { - declare module.exports: $PropertyType<$Exports<"lodash">, "pullAllWith">; -} - -declare module "lodash/pullAt" { - declare module.exports: $PropertyType<$Exports<"lodash">, "pullAt">; -} - -declare module "lodash/remove" { - declare module.exports: $PropertyType<$Exports<"lodash">, "remove">; -} - -declare module "lodash/reverse" { - declare module.exports: $PropertyType<$Exports<"lodash">, "reverse">; -} - -declare module "lodash/slice" { - declare module.exports: $PropertyType<$Exports<"lodash">, "slice">; -} - -declare module "lodash/sortedIndex" { - declare module.exports: $PropertyType<$Exports<"lodash">, "sortedIndex">; -} - -declare module "lodash/sortedIndexBy" { - declare module.exports: $PropertyType<$Exports<"lodash">, "sortedIndexBy">; -} - -declare module "lodash/sortedIndexOf" { - declare module.exports: $PropertyType<$Exports<"lodash">, "sortedIndexOf">; -} - -declare module "lodash/sortedLastIndex" { - declare module.exports: $PropertyType<$Exports<"lodash">, "sortedLastIndex">; -} - -declare module "lodash/sortedLastIndexBy" { - declare module.exports: $PropertyType< - $Exports<"lodash">, - "sortedLastIndexBy" - >; -} - -declare module "lodash/sortedLastIndexOf" { - declare module.exports: $PropertyType< - $Exports<"lodash">, - "sortedLastIndexOf" - >; -} - -declare module "lodash/sortedUniq" { - declare module.exports: $PropertyType<$Exports<"lodash">, "sortedUniq">; -} - -declare module "lodash/sortedUniqBy" { - declare module.exports: $PropertyType<$Exports<"lodash">, "sortedUniqBy">; -} - -declare module "lodash/tail" { - declare module.exports: $PropertyType<$Exports<"lodash">, "tail">; -} - -declare module "lodash/take" { - declare module.exports: $PropertyType<$Exports<"lodash">, "take">; -} - -declare module "lodash/takeRight" { - declare module.exports: $PropertyType<$Exports<"lodash">, "takeRight">; -} - -declare module "lodash/takeRightWhile" { - declare module.exports: $PropertyType<$Exports<"lodash">, "takeRightWhile">; -} - -declare module "lodash/takeWhile" { - declare module.exports: $PropertyType<$Exports<"lodash">, "takeWhile">; -} - -declare module "lodash/union" { - declare module.exports: $PropertyType<$Exports<"lodash">, "union">; -} - -declare module "lodash/unionBy" { - declare module.exports: $PropertyType<$Exports<"lodash">, "unionBy">; -} - -declare module "lodash/unionWith" { - declare module.exports: $PropertyType<$Exports<"lodash">, "unionWith">; -} - -declare module "lodash/uniq" { - declare module.exports: $PropertyType<$Exports<"lodash">, "uniq">; -} - -declare module "lodash/uniqBy" { - declare module.exports: $PropertyType<$Exports<"lodash">, "uniqBy">; -} - -declare module "lodash/uniqWith" { - declare module.exports: $PropertyType<$Exports<"lodash">, "uniqWith">; -} - -declare module "lodash/unzip" { - declare module.exports: $PropertyType<$Exports<"lodash">, "unzip">; -} - -declare module "lodash/unzipWith" { - declare module.exports: $PropertyType<$Exports<"lodash">, "unzipWith">; -} - -declare module "lodash/without" { - declare module.exports: $PropertyType<$Exports<"lodash">, "without">; -} - -declare module "lodash/xor" { - declare module.exports: $PropertyType<$Exports<"lodash">, "xor">; -} - -declare module "lodash/xorBy" { - declare module.exports: $PropertyType<$Exports<"lodash">, "xorBy">; -} - -declare module "lodash/xorWith" { - declare module.exports: $PropertyType<$Exports<"lodash">, "xorWith">; -} - -declare module "lodash/zip" { - declare module.exports: $PropertyType<$Exports<"lodash">, "zip">; -} - -declare module "lodash/zipObject" { - declare module.exports: $PropertyType<$Exports<"lodash">, "zipObject">; -} - -declare module "lodash/zipObjectDeep" { - declare module.exports: $PropertyType<$Exports<"lodash">, "zipObjectDeep">; -} - -declare module "lodash/zipWith" { - declare module.exports: $PropertyType<$Exports<"lodash">, "zipWith">; -} - -declare module "lodash/countBy" { - declare module.exports: $PropertyType<$Exports<"lodash">, "countBy">; -} - -declare module "lodash/each" { - declare module.exports: $PropertyType<$Exports<"lodash">, "each">; -} - -declare module "lodash/eachRight" { - declare module.exports: $PropertyType<$Exports<"lodash">, "eachRight">; -} - -declare module "lodash/every" { - declare module.exports: $PropertyType<$Exports<"lodash">, "every">; -} - -declare module "lodash/filter" { - declare module.exports: $PropertyType<$Exports<"lodash">, "filter">; -} - -declare module "lodash/find" { - declare module.exports: $PropertyType<$Exports<"lodash">, "find">; -} - -declare module "lodash/findLast" { - declare module.exports: $PropertyType<$Exports<"lodash">, "findLast">; -} - -declare module "lodash/flatMap" { - declare module.exports: $PropertyType<$Exports<"lodash">, "flatMap">; -} - -declare module "lodash/flatMapDeep" { - declare module.exports: $PropertyType<$Exports<"lodash">, "flatMapDeep">; -} - -declare module "lodash/flatMapDepth" { - declare module.exports: $PropertyType<$Exports<"lodash">, "flatMapDepth">; -} - -declare module "lodash/forEach" { - declare module.exports: $PropertyType<$Exports<"lodash">, "forEach">; -} - -declare module "lodash/forEachRight" { - declare module.exports: $PropertyType<$Exports<"lodash">, "forEachRight">; -} - -declare module "lodash/groupBy" { - declare module.exports: $PropertyType<$Exports<"lodash">, "groupBy">; -} - -declare module "lodash/includes" { - declare module.exports: $PropertyType<$Exports<"lodash">, "includes">; -} - -declare module "lodash/invokeMap" { - declare module.exports: $PropertyType<$Exports<"lodash">, "invokeMap">; -} - -declare module "lodash/keyBy" { - declare module.exports: $PropertyType<$Exports<"lodash">, "keyBy">; -} - -declare module "lodash/map" { - declare module.exports: $PropertyType<$Exports<"lodash">, "map">; -} - -declare module "lodash/orderBy" { - declare module.exports: $PropertyType<$Exports<"lodash">, "orderBy">; -} - -declare module "lodash/partition" { - declare module.exports: $PropertyType<$Exports<"lodash">, "partition">; -} - -declare module "lodash/reduce" { - declare module.exports: $PropertyType<$Exports<"lodash">, "reduce">; -} - -declare module "lodash/reduceRight" { - declare module.exports: $PropertyType<$Exports<"lodash">, "reduceRight">; -} - -declare module "lodash/reject" { - declare module.exports: $PropertyType<$Exports<"lodash">, "reject">; -} - -declare module "lodash/sample" { - declare module.exports: $PropertyType<$Exports<"lodash">, "sample">; -} - -declare module "lodash/sampleSize" { - declare module.exports: $PropertyType<$Exports<"lodash">, "sampleSize">; -} - -declare module "lodash/shuffle" { - declare module.exports: $PropertyType<$Exports<"lodash">, "shuffle">; -} - -declare module "lodash/size" { - declare module.exports: $PropertyType<$Exports<"lodash">, "size">; -} - -declare module "lodash/some" { - declare module.exports: $PropertyType<$Exports<"lodash">, "some">; -} - -declare module "lodash/sortBy" { - declare module.exports: $PropertyType<$Exports<"lodash">, "sortBy">; -} - -declare module "lodash/now" { - declare module.exports: $PropertyType<$Exports<"lodash">, "now">; -} - -declare module "lodash/after" { - declare module.exports: $PropertyType<$Exports<"lodash">, "after">; -} - -declare module "lodash/ary" { - declare module.exports: $PropertyType<$Exports<"lodash">, "ary">; -} - -declare module "lodash/before" { - declare module.exports: $PropertyType<$Exports<"lodash">, "before">; -} - -declare module "lodash/bind" { - declare module.exports: $PropertyType<$Exports<"lodash">, "bind">; -} - -declare module "lodash/bindKey" { - declare module.exports: $PropertyType<$Exports<"lodash">, "bindKey">; -} - -declare module "lodash/curry" { - declare module.exports: $PropertyType<$Exports<"lodash">, "curry">; -} - -declare module "lodash/curryRight" { - declare module.exports: $PropertyType<$Exports<"lodash">, "curryRight">; -} - -declare module "lodash/debounce" { - declare module.exports: $PropertyType<$Exports<"lodash">, "debounce">; -} - -declare module "lodash/defer" { - declare module.exports: $PropertyType<$Exports<"lodash">, "defer">; -} - -declare module "lodash/delay" { - declare module.exports: $PropertyType<$Exports<"lodash">, "delay">; -} - -declare module "lodash/flip" { - declare module.exports: $PropertyType<$Exports<"lodash">, "flip">; -} - -declare module "lodash/memoize" { - declare module.exports: $PropertyType<$Exports<"lodash">, "memoize">; -} - -declare module "lodash/negate" { - declare module.exports: $PropertyType<$Exports<"lodash">, "negate">; -} - -declare module "lodash/once" { - declare module.exports: $PropertyType<$Exports<"lodash">, "once">; -} - -declare module "lodash/overArgs" { - declare module.exports: $PropertyType<$Exports<"lodash">, "overArgs">; -} - -declare module "lodash/partial" { - declare module.exports: $PropertyType<$Exports<"lodash">, "partial">; -} - -declare module "lodash/partialRight" { - declare module.exports: $PropertyType<$Exports<"lodash">, "partialRight">; -} - -declare module "lodash/rearg" { - declare module.exports: $PropertyType<$Exports<"lodash">, "rearg">; -} - -declare module "lodash/rest" { - declare module.exports: $PropertyType<$Exports<"lodash">, "rest">; -} - -declare module "lodash/spread" { - declare module.exports: $PropertyType<$Exports<"lodash">, "spread">; -} - -declare module "lodash/throttle" { - declare module.exports: $PropertyType<$Exports<"lodash">, "throttle">; -} - -declare module "lodash/unary" { - declare module.exports: $PropertyType<$Exports<"lodash">, "unary">; -} - -declare module "lodash/wrap" { - declare module.exports: $PropertyType<$Exports<"lodash">, "wrap">; -} - -declare module "lodash/castArray" { - declare module.exports: $PropertyType<$Exports<"lodash">, "castArray">; -} - -declare module "lodash/clone" { - declare module.exports: $PropertyType<$Exports<"lodash">, "clone">; -} - -declare module "lodash/cloneDeep" { - declare module.exports: $PropertyType<$Exports<"lodash">, "cloneDeep">; -} - -declare module "lodash/cloneDeepWith" { - declare module.exports: $PropertyType<$Exports<"lodash">, "cloneDeepWith">; -} - -declare module "lodash/cloneWith" { - declare module.exports: $PropertyType<$Exports<"lodash">, "cloneWith">; -} - -declare module "lodash/conformsTo" { - declare module.exports: $PropertyType<$Exports<"lodash">, "conformsTo">; -} - -declare module "lodash/eq" { - declare module.exports: $PropertyType<$Exports<"lodash">, "eq">; -} - -declare module "lodash/gt" { - declare module.exports: $PropertyType<$Exports<"lodash">, "gt">; -} - -declare module "lodash/gte" { - declare module.exports: $PropertyType<$Exports<"lodash">, "gte">; -} - -declare module "lodash/isArguments" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isArguments">; -} - -declare module "lodash/isArray" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isArray">; -} - -declare module "lodash/isArrayBuffer" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isArrayBuffer">; -} - -declare module "lodash/isArrayLike" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isArrayLike">; -} - -declare module "lodash/isArrayLikeObject" { - declare module.exports: $PropertyType< - $Exports<"lodash">, - "isArrayLikeObject" - >; -} - -declare module "lodash/isBoolean" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isBoolean">; -} - -declare module "lodash/isBuffer" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isBuffer">; -} - -declare module "lodash/isDate" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isDate">; -} - -declare module "lodash/isElement" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isElement">; -} - -declare module "lodash/isEmpty" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isEmpty">; -} - -declare module "lodash/isEqual" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isEqual">; -} - -declare module "lodash/isEqualWith" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isEqualWith">; -} - -declare module "lodash/isError" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isError">; -} - -declare module "lodash/isFinite" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isFinite">; -} - -declare module "lodash/isFunction" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isFunction">; -} - -declare module "lodash/isInteger" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isInteger">; -} - -declare module "lodash/isLength" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isLength">; -} - -declare module "lodash/isMap" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isMap">; -} - -declare module "lodash/isMatch" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isMatch">; -} - -declare module "lodash/isMatchWith" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isMatchWith">; -} - -declare module "lodash/isNaN" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isNaN">; -} - -declare module "lodash/isNative" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isNative">; -} - -declare module "lodash/isNil" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isNil">; -} - -declare module "lodash/isNull" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isNull">; -} - -declare module "lodash/isNumber" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isNumber">; -} - -declare module "lodash/isObject" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isObject">; -} - -declare module "lodash/isObjectLike" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isObjectLike">; -} - -declare module "lodash/isPlainObject" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isPlainObject">; -} - -declare module "lodash/isRegExp" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isRegExp">; -} - -declare module "lodash/isSafeInteger" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isSafeInteger">; -} - -declare module "lodash/isSet" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isSet">; -} - -declare module "lodash/isString" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isString">; -} - -declare module "lodash/isSymbol" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isSymbol">; -} - -declare module "lodash/isTypedArray" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isTypedArray">; -} - -declare module "lodash/isUndefined" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isUndefined">; -} - -declare module "lodash/isWeakMap" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isWeakMap">; -} - -declare module "lodash/isWeakSet" { - declare module.exports: $PropertyType<$Exports<"lodash">, "isWeakSet">; -} - -declare module "lodash/lt" { - declare module.exports: $PropertyType<$Exports<"lodash">, "lt">; -} - -declare module "lodash/lte" { - declare module.exports: $PropertyType<$Exports<"lodash">, "lte">; -} - -declare module "lodash/toArray" { - declare module.exports: $PropertyType<$Exports<"lodash">, "toArray">; -} - -declare module "lodash/toFinite" { - declare module.exports: $PropertyType<$Exports<"lodash">, "toFinite">; -} - -declare module "lodash/toInteger" { - declare module.exports: $PropertyType<$Exports<"lodash">, "toInteger">; -} - -declare module "lodash/toLength" { - declare module.exports: $PropertyType<$Exports<"lodash">, "toLength">; -} - -declare module "lodash/toNumber" { - declare module.exports: $PropertyType<$Exports<"lodash">, "toNumber">; -} - -declare module "lodash/toPlainObject" { - declare module.exports: $PropertyType<$Exports<"lodash">, "toPlainObject">; -} - -declare module "lodash/toSafeInteger" { - declare module.exports: $PropertyType<$Exports<"lodash">, "toSafeInteger">; -} - -declare module "lodash/toString" { - declare module.exports: $PropertyType<$Exports<"lodash">, "toString">; -} - -declare module "lodash/add" { - declare module.exports: $PropertyType<$Exports<"lodash">, "add">; -} - -declare module "lodash/ceil" { - declare module.exports: $PropertyType<$Exports<"lodash">, "ceil">; -} - -declare module "lodash/divide" { - declare module.exports: $PropertyType<$Exports<"lodash">, "divide">; -} - -declare module "lodash/floor" { - declare module.exports: $PropertyType<$Exports<"lodash">, "floor">; -} - -declare module "lodash/max" { - declare module.exports: $PropertyType<$Exports<"lodash">, "max">; -} - -declare module "lodash/maxBy" { - declare module.exports: $PropertyType<$Exports<"lodash">, "maxBy">; -} - -declare module "lodash/mean" { - declare module.exports: $PropertyType<$Exports<"lodash">, "mean">; -} - -declare module "lodash/meanBy" { - declare module.exports: $PropertyType<$Exports<"lodash">, "meanBy">; -} - -declare module "lodash/min" { - declare module.exports: $PropertyType<$Exports<"lodash">, "min">; -} - -declare module "lodash/minBy" { - declare module.exports: $PropertyType<$Exports<"lodash">, "minBy">; -} - -declare module "lodash/multiply" { - declare module.exports: $PropertyType<$Exports<"lodash">, "multiply">; -} - -declare module "lodash/round" { - declare module.exports: $PropertyType<$Exports<"lodash">, "round">; -} - -declare module "lodash/subtract" { - declare module.exports: $PropertyType<$Exports<"lodash">, "subtract">; -} - -declare module "lodash/sum" { - declare module.exports: $PropertyType<$Exports<"lodash">, "sum">; -} - -declare module "lodash/sumBy" { - declare module.exports: $PropertyType<$Exports<"lodash">, "sumBy">; -} - -declare module "lodash/clamp" { - declare module.exports: $PropertyType<$Exports<"lodash">, "clamp">; -} - -declare module "lodash/inRange" { - declare module.exports: $PropertyType<$Exports<"lodash">, "inRange">; -} - -declare module "lodash/random" { - declare module.exports: $PropertyType<$Exports<"lodash">, "random">; -} - -declare module "lodash/assign" { - declare module.exports: $PropertyType<$Exports<"lodash">, "assign">; -} - -declare module "lodash/assignIn" { - declare module.exports: $PropertyType<$Exports<"lodash">, "assignIn">; -} - -declare module "lodash/assignInWith" { - declare module.exports: $PropertyType<$Exports<"lodash">, "assignInWith">; -} - -declare module "lodash/assignWith" { - declare module.exports: $PropertyType<$Exports<"lodash">, "assignWith">; -} - -declare module "lodash/at" { - declare module.exports: $PropertyType<$Exports<"lodash">, "at">; -} - -declare module "lodash/create" { - declare module.exports: $PropertyType<$Exports<"lodash">, "create">; -} - -declare module "lodash/defaults" { - declare module.exports: $PropertyType<$Exports<"lodash">, "defaults">; -} - -declare module "lodash/defaultsDeep" { - declare module.exports: $PropertyType<$Exports<"lodash">, "defaultsDeep">; -} - -declare module "lodash/entries" { - declare module.exports: $PropertyType<$Exports<"lodash">, "entries">; -} - -declare module "lodash/entriesIn" { - declare module.exports: $PropertyType<$Exports<"lodash">, "entriesIn">; -} - -declare module "lodash/extend" { - declare module.exports: $PropertyType<$Exports<"lodash">, "extend">; -} - -declare module "lodash/extendWith" { - declare module.exports: $PropertyType<$Exports<"lodash">, "extendWith">; -} - -declare module "lodash/findKey" { - declare module.exports: $PropertyType<$Exports<"lodash">, "findKey">; -} - -declare module "lodash/findLastKey" { - declare module.exports: $PropertyType<$Exports<"lodash">, "findLastKey">; -} - -declare module "lodash/forIn" { - declare module.exports: $PropertyType<$Exports<"lodash">, "forIn">; -} - -declare module "lodash/forInRight" { - declare module.exports: $PropertyType<$Exports<"lodash">, "forInRight">; -} - -declare module "lodash/forOwn" { - declare module.exports: $PropertyType<$Exports<"lodash">, "forOwn">; -} - -declare module "lodash/forOwnRight" { - declare module.exports: $PropertyType<$Exports<"lodash">, "forOwnRight">; -} - -declare module "lodash/functions" { - declare module.exports: $PropertyType<$Exports<"lodash">, "functions">; -} - -declare module "lodash/functionsIn" { - declare module.exports: $PropertyType<$Exports<"lodash">, "functionsIn">; -} - -declare module "lodash/get" { - declare module.exports: $PropertyType<$Exports<"lodash">, "get">; -} - -declare module "lodash/has" { - declare module.exports: $PropertyType<$Exports<"lodash">, "has">; -} - -declare module "lodash/hasIn" { - declare module.exports: $PropertyType<$Exports<"lodash">, "hasIn">; -} - -declare module "lodash/invert" { - declare module.exports: $PropertyType<$Exports<"lodash">, "invert">; -} - -declare module "lodash/invertBy" { - declare module.exports: $PropertyType<$Exports<"lodash">, "invertBy">; -} - -declare module "lodash/invoke" { - declare module.exports: $PropertyType<$Exports<"lodash">, "invoke">; -} - -declare module "lodash/keys" { - declare module.exports: $PropertyType<$Exports<"lodash">, "keys">; -} - -declare module "lodash/keysIn" { - declare module.exports: $PropertyType<$Exports<"lodash">, "keysIn">; -} - -declare module "lodash/mapKeys" { - declare module.exports: $PropertyType<$Exports<"lodash">, "mapKeys">; -} - -declare module "lodash/mapValues" { - declare module.exports: $PropertyType<$Exports<"lodash">, "mapValues">; -} - -declare module "lodash/merge" { - declare module.exports: $PropertyType<$Exports<"lodash">, "merge">; -} - -declare module "lodash/mergeWith" { - declare module.exports: $PropertyType<$Exports<"lodash">, "mergeWith">; -} - -declare module "lodash/omit" { - declare module.exports: $PropertyType<$Exports<"lodash">, "omit">; -} - -declare module "lodash/omitBy" { - declare module.exports: $PropertyType<$Exports<"lodash">, "omitBy">; -} - -declare module "lodash/pick" { - declare module.exports: $PropertyType<$Exports<"lodash">, "pick">; -} - -declare module "lodash/pickBy" { - declare module.exports: $PropertyType<$Exports<"lodash">, "pickBy">; -} - -declare module "lodash/result" { - declare module.exports: $PropertyType<$Exports<"lodash">, "result">; -} - -declare module "lodash/set" { - declare module.exports: $PropertyType<$Exports<"lodash">, "set">; -} - -declare module "lodash/setWith" { - declare module.exports: $PropertyType<$Exports<"lodash">, "setWith">; -} - -declare module "lodash/toPairs" { - declare module.exports: $PropertyType<$Exports<"lodash">, "toPairs">; -} - -declare module "lodash/toPairsIn" { - declare module.exports: $PropertyType<$Exports<"lodash">, "toPairsIn">; -} - -declare module "lodash/transform" { - declare module.exports: $PropertyType<$Exports<"lodash">, "transform">; -} - -declare module "lodash/unset" { - declare module.exports: $PropertyType<$Exports<"lodash">, "unset">; -} - -declare module "lodash/update" { - declare module.exports: $PropertyType<$Exports<"lodash">, "update">; -} - -declare module "lodash/updateWith" { - declare module.exports: $PropertyType<$Exports<"lodash">, "updateWith">; -} - -declare module "lodash/values" { - declare module.exports: $PropertyType<$Exports<"lodash">, "values">; -} - -declare module "lodash/valuesIn" { - declare module.exports: $PropertyType<$Exports<"lodash">, "valuesIn">; -} - -declare module "lodash/chain" { - declare module.exports: $PropertyType<$Exports<"lodash">, "chain">; -} - -declare module "lodash/tap" { - declare module.exports: $PropertyType<$Exports<"lodash">, "tap">; -} - -declare module "lodash/thru" { - declare module.exports: $PropertyType<$Exports<"lodash">, "thru">; -} - -declare module "lodash/camelCase" { - declare module.exports: $PropertyType<$Exports<"lodash">, "camelCase">; -} - -declare module "lodash/capitalize" { - declare module.exports: $PropertyType<$Exports<"lodash">, "capitalize">; -} - -declare module "lodash/deburr" { - declare module.exports: $PropertyType<$Exports<"lodash">, "deburr">; -} - -declare module "lodash/endsWith" { - declare module.exports: $PropertyType<$Exports<"lodash">, "endsWith">; -} - -declare module "lodash/escape" { - declare module.exports: $PropertyType<$Exports<"lodash">, "escape">; -} - -declare module "lodash/escapeRegExp" { - declare module.exports: $PropertyType<$Exports<"lodash">, "escapeRegExp">; -} - -declare module "lodash/kebabCase" { - declare module.exports: $PropertyType<$Exports<"lodash">, "kebabCase">; -} - -declare module "lodash/lowerCase" { - declare module.exports: $PropertyType<$Exports<"lodash">, "lowerCase">; -} - -declare module "lodash/lowerFirst" { - declare module.exports: $PropertyType<$Exports<"lodash">, "lowerFirst">; -} - -declare module "lodash/pad" { - declare module.exports: $PropertyType<$Exports<"lodash">, "pad">; -} - -declare module "lodash/padEnd" { - declare module.exports: $PropertyType<$Exports<"lodash">, "padEnd">; -} - -declare module "lodash/padStart" { - declare module.exports: $PropertyType<$Exports<"lodash">, "padStart">; -} - -declare module "lodash/parseInt" { - declare module.exports: $PropertyType<$Exports<"lodash">, "parseInt">; -} - -declare module "lodash/repeat" { - declare module.exports: $PropertyType<$Exports<"lodash">, "repeat">; -} - -declare module "lodash/replace" { - declare module.exports: $PropertyType<$Exports<"lodash">, "replace">; -} - -declare module "lodash/snakeCase" { - declare module.exports: $PropertyType<$Exports<"lodash">, "snakeCase">; -} - -declare module "lodash/split" { - declare module.exports: $PropertyType<$Exports<"lodash">, "split">; -} - -declare module "lodash/startCase" { - declare module.exports: $PropertyType<$Exports<"lodash">, "startCase">; -} - -declare module "lodash/startsWith" { - declare module.exports: $PropertyType<$Exports<"lodash">, "startsWith">; -} - -declare module "lodash/template" { - declare module.exports: $PropertyType<$Exports<"lodash">, "template">; -} - -declare module "lodash/toLower" { - declare module.exports: $PropertyType<$Exports<"lodash">, "toLower">; -} - -declare module "lodash/toUpper" { - declare module.exports: $PropertyType<$Exports<"lodash">, "toUpper">; -} - -declare module "lodash/trim" { - declare module.exports: $PropertyType<$Exports<"lodash">, "trim">; -} - -declare module "lodash/trimEnd" { - declare module.exports: $PropertyType<$Exports<"lodash">, "trimEnd">; -} - -declare module "lodash/trimStart" { - declare module.exports: $PropertyType<$Exports<"lodash">, "trimStart">; -} - -declare module "lodash/truncate" { - declare module.exports: $PropertyType<$Exports<"lodash">, "truncate">; -} - -declare module "lodash/unescape" { - declare module.exports: $PropertyType<$Exports<"lodash">, "unescape">; -} - -declare module "lodash/upperCase" { - declare module.exports: $PropertyType<$Exports<"lodash">, "upperCase">; -} - -declare module "lodash/upperFirst" { - declare module.exports: $PropertyType<$Exports<"lodash">, "upperFirst">; -} - -declare module "lodash/words" { - declare module.exports: $PropertyType<$Exports<"lodash">, "words">; -} - -declare module "lodash/attempt" { - declare module.exports: $PropertyType<$Exports<"lodash">, "attempt">; -} - -declare module "lodash/bindAll" { - declare module.exports: $PropertyType<$Exports<"lodash">, "bindAll">; -} - -declare module "lodash/cond" { - declare module.exports: $PropertyType<$Exports<"lodash">, "cond">; -} - -declare module "lodash/conforms" { - declare module.exports: $PropertyType<$Exports<"lodash">, "conforms">; -} - -declare module "lodash/constant" { - declare module.exports: $PropertyType<$Exports<"lodash">, "constant">; -} - -declare module "lodash/defaultTo" { - declare module.exports: $PropertyType<$Exports<"lodash">, "defaultTo">; -} - -declare module "lodash/flow" { - declare module.exports: $PropertyType<$Exports<"lodash">, "flow">; -} - -declare module "lodash/flowRight" { - declare module.exports: $PropertyType<$Exports<"lodash">, "flowRight">; -} - -declare module "lodash/identity" { - declare module.exports: $PropertyType<$Exports<"lodash">, "identity">; -} - -declare module "lodash/iteratee" { - declare module.exports: $PropertyType<$Exports<"lodash">, "iteratee">; -} - -declare module "lodash/matches" { - declare module.exports: $PropertyType<$Exports<"lodash">, "matches">; -} - -declare module "lodash/matchesProperty" { - declare module.exports: $PropertyType<$Exports<"lodash">, "matchesProperty">; -} - -declare module "lodash/method" { - declare module.exports: $PropertyType<$Exports<"lodash">, "method">; -} - -declare module "lodash/methodOf" { - declare module.exports: $PropertyType<$Exports<"lodash">, "methodOf">; -} - -declare module "lodash/mixin" { - declare module.exports: $PropertyType<$Exports<"lodash">, "mixin">; -} - -declare module "lodash/noConflict" { - declare module.exports: $PropertyType<$Exports<"lodash">, "noConflict">; -} - -declare module "lodash/noop" { - declare module.exports: $PropertyType<$Exports<"lodash">, "noop">; -} - -declare module "lodash/nthArg" { - declare module.exports: $PropertyType<$Exports<"lodash">, "nthArg">; -} - -declare module "lodash/over" { - declare module.exports: $PropertyType<$Exports<"lodash">, "over">; -} - -declare module "lodash/overEvery" { - declare module.exports: $PropertyType<$Exports<"lodash">, "overEvery">; -} - -declare module "lodash/overSome" { - declare module.exports: $PropertyType<$Exports<"lodash">, "overSome">; -} - -declare module "lodash/property" { - declare module.exports: $PropertyType<$Exports<"lodash">, "property">; -} - -declare module "lodash/propertyOf" { - declare module.exports: $PropertyType<$Exports<"lodash">, "propertyOf">; -} - -declare module "lodash/range" { - declare module.exports: $PropertyType<$Exports<"lodash">, "range">; -} - -declare module "lodash/rangeRight" { - declare module.exports: $PropertyType<$Exports<"lodash">, "rangeRight">; -} - -declare module "lodash/runInContext" { - declare module.exports: $PropertyType<$Exports<"lodash">, "runInContext">; -} - -declare module "lodash/stubArray" { - declare module.exports: $PropertyType<$Exports<"lodash">, "stubArray">; -} - -declare module "lodash/stubFalse" { - declare module.exports: $PropertyType<$Exports<"lodash">, "stubFalse">; -} - -declare module "lodash/stubObject" { - declare module.exports: $PropertyType<$Exports<"lodash">, "stubObject">; -} - -declare module "lodash/stubString" { - declare module.exports: $PropertyType<$Exports<"lodash">, "stubString">; -} - -declare module "lodash/stubTrue" { - declare module.exports: $PropertyType<$Exports<"lodash">, "stubTrue">; -} - -declare module "lodash/times" { - declare module.exports: $PropertyType<$Exports<"lodash">, "times">; -} - -declare module "lodash/toPath" { - declare module.exports: $PropertyType<$Exports<"lodash">, "toPath">; -} - -declare module "lodash/uniqueId" { - declare module.exports: $PropertyType<$Exports<"lodash">, "uniqueId">; -} - -declare module "lodash/fp/chunk" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "chunk">; -} - -declare module "lodash/fp/compact" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "compact">; -} - -declare module "lodash/fp/concat" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "concat">; -} - -declare module "lodash/fp/difference" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "difference">; -} - -declare module "lodash/fp/differenceBy" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "differenceBy">; -} - -declare module "lodash/fp/differenceWith" { - declare module.exports: $PropertyType< - $Exports<"lodash/fp">, - "differenceWith" - >; -} - -declare module "lodash/fp/drop" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "drop">; -} - -declare module "lodash/fp/dropLast" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "dropLast">; -} - -declare module "lodash/fp/dropRight" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "dropRight">; -} - -declare module "lodash/fp/dropRightWhile" { - declare module.exports: $PropertyType< - $Exports<"lodash/fp">, - "dropRightWhile" - >; -} - -declare module "lodash/fp/dropWhile" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "dropWhile">; -} - -declare module "lodash/fp/dropLastWhile" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "dropLastWhile">; -} - -declare module "lodash/fp/fill" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "fill">; -} - -declare module "lodash/fp/findIndex" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "findIndex">; -} - -declare module "lodash/fp/findIndexFrom" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "findIndexFrom">; -} - -declare module "lodash/fp/findLastIndex" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "findLastIndex">; -} - -declare module "lodash/fp/findLastIndexFrom" { - declare module.exports: $PropertyType< - $Exports<"lodash/fp">, - "findLastIndexFrom" - >; -} - -declare module "lodash/fp/first" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "first">; -} - -declare module "lodash/fp/flatten" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "flatten">; -} - -declare module "lodash/fp/unnest" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "unnest">; -} - -declare module "lodash/fp/flattenDeep" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "flattenDeep">; -} - -declare module "lodash/fp/flattenDepth" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "flattenDepth">; -} - -declare module "lodash/fp/fromPairs" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "fromPairs">; -} - -declare module "lodash/fp/head" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "head">; -} - -declare module "lodash/fp/indexOf" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "indexOf">; -} - -declare module "lodash/fp/indexOfFrom" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "indexOfFrom">; -} - -declare module "lodash/fp/initial" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "initial">; -} - -declare module "lodash/fp/init" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "init">; -} - -declare module "lodash/fp/intersection" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "intersection">; -} - -declare module "lodash/fp/intersectionBy" { - declare module.exports: $PropertyType< - $Exports<"lodash/fp">, - "intersectionBy" - >; -} - -declare module "lodash/fp/intersectionWith" { - declare module.exports: $PropertyType< - $Exports<"lodash/fp">, - "intersectionWith" - >; -} - -declare module "lodash/fp/join" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "join">; -} - -declare module "lodash/fp/last" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "last">; -} - -declare module "lodash/fp/lastIndexOf" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "lastIndexOf">; -} - -declare module "lodash/fp/lastIndexOfFrom" { - declare module.exports: $PropertyType< - $Exports<"lodash/fp">, - "lastIndexOfFrom" - >; -} - -declare module "lodash/fp/nth" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "nth">; -} - -declare module "lodash/fp/pull" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "pull">; -} - -declare module "lodash/fp/pullAll" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "pullAll">; -} - -declare module "lodash/fp/pullAllBy" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "pullAllBy">; -} - -declare module "lodash/fp/pullAllWith" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "pullAllWith">; -} - -declare module "lodash/fp/pullAt" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "pullAt">; -} - -declare module "lodash/fp/remove" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "remove">; -} - -declare module "lodash/fp/reverse" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "reverse">; -} - -declare module "lodash/fp/slice" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "slice">; -} - -declare module "lodash/fp/sortedIndex" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "sortedIndex">; -} - -declare module "lodash/fp/sortedIndexBy" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "sortedIndexBy">; -} - -declare module "lodash/fp/sortedIndexOf" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "sortedIndexOf">; -} - -declare module "lodash/fp/sortedLastIndex" { - declare module.exports: $PropertyType< - $Exports<"lodash/fp">, - "sortedLastIndex" - >; -} - -declare module "lodash/fp/sortedLastIndexBy" { - declare module.exports: $PropertyType< - $Exports<"lodash/fp">, - "sortedLastIndexBy" - >; -} - -declare module "lodash/fp/sortedLastIndexOf" { - declare module.exports: $PropertyType< - $Exports<"lodash/fp">, - "sortedLastIndexOf" - >; -} - -declare module "lodash/fp/sortedUniq" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "sortedUniq">; -} - -declare module "lodash/fp/sortedUniqBy" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "sortedUniqBy">; -} - -declare module "lodash/fp/tail" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "tail">; -} - -declare module "lodash/fp/take" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "take">; -} - -declare module "lodash/fp/takeRight" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "takeRight">; -} - -declare module "lodash/fp/takeLast" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "takeLast">; -} - -declare module "lodash/fp/takeRightWhile" { - declare module.exports: $PropertyType< - $Exports<"lodash/fp">, - "takeRightWhile" - >; -} - -declare module "lodash/fp/takeLastWhile" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "takeLastWhile">; -} - -declare module "lodash/fp/takeWhile" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "takeWhile">; -} - -declare module "lodash/fp/union" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "union">; -} - -declare module "lodash/fp/unionBy" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "unionBy">; -} - -declare module "lodash/fp/unionWith" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "unionWith">; -} - -declare module "lodash/fp/uniq" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "uniq">; -} - -declare module "lodash/fp/uniqBy" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "uniqBy">; -} - -declare module "lodash/fp/uniqWith" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "uniqWith">; -} - -declare module "lodash/fp/unzip" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "unzip">; -} - -declare module "lodash/fp/unzipWith" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "unzipWith">; -} - -declare module "lodash/fp/without" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "without">; -} - -declare module "lodash/fp/xor" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "xor">; -} - -declare module "lodash/fp/symmetricDifference" { - declare module.exports: $PropertyType< - $Exports<"lodash/fp">, - "symmetricDifference" - >; -} - -declare module "lodash/fp/xorBy" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "xorBy">; -} - -declare module "lodash/fp/symmetricDifferenceBy" { - declare module.exports: $PropertyType< - $Exports<"lodash/fp">, - "symmetricDifferenceBy" - >; -} - -declare module "lodash/fp/xorWith" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "xorWith">; -} - -declare module "lodash/fp/symmetricDifferenceWith" { - declare module.exports: $PropertyType< - $Exports<"lodash/fp">, - "symmetricDifferenceWith" - >; -} - -declare module "lodash/fp/zip" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "zip">; -} - -declare module "lodash/fp/zipAll" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "zipAll">; -} - -declare module "lodash/fp/zipObject" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "zipObject">; -} - -declare module "lodash/fp/zipObj" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "zipObj">; -} - -declare module "lodash/fp/zipObjectDeep" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "zipObjectDeep">; -} - -declare module "lodash/fp/zipWith" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "zipWith">; -} - -declare module "lodash/fp/countBy" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "countBy">; -} - -declare module "lodash/fp/each" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "each">; -} - -declare module "lodash/fp/eachRight" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "eachRight">; -} - -declare module "lodash/fp/every" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "every">; -} - -declare module "lodash/fp/all" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "all">; -} - -declare module "lodash/fp/filter" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "filter">; -} - -declare module "lodash/fp/find" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "find">; -} - -declare module "lodash/fp/findFrom" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "findFrom">; -} - -declare module "lodash/fp/findLast" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "findLast">; -} - -declare module "lodash/fp/findLastFrom" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "findLastFrom">; -} - -declare module "lodash/fp/flatMap" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "flatMap">; -} - -declare module "lodash/fp/flatMapDeep" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "flatMapDeep">; -} - -declare module "lodash/fp/flatMapDepth" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "flatMapDepth">; -} - -declare module "lodash/fp/forEach" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "forEach">; -} - -declare module "lodash/fp/forEachRight" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "forEachRight">; -} - -declare module "lodash/fp/groupBy" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "groupBy">; -} - -declare module "lodash/fp/includes" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "includes">; -} - -declare module "lodash/fp/contains" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "contains">; -} - -declare module "lodash/fp/includesFrom" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "includesFrom">; -} - -declare module "lodash/fp/invokeMap" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "invokeMap">; -} - -declare module "lodash/fp/invokeArgsMap" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "invokeArgsMap">; -} - -declare module "lodash/fp/keyBy" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "keyBy">; -} - -declare module "lodash/fp/indexBy" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "indexBy">; -} - -declare module "lodash/fp/map" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "map">; -} - -declare module "lodash/fp/pluck" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "pluck">; -} - -declare module "lodash/fp/orderBy" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "orderBy">; -} - -declare module "lodash/fp/partition" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "partition">; -} - -declare module "lodash/fp/reduce" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "reduce">; -} - -declare module "lodash/fp/reduceRight" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "reduceRight">; -} - -declare module "lodash/fp/reject" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "reject">; -} - -declare module "lodash/fp/sample" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "sample">; -} - -declare module "lodash/fp/sampleSize" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "sampleSize">; -} - -declare module "lodash/fp/shuffle" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "shuffle">; -} - -declare module "lodash/fp/size" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "size">; -} - -declare module "lodash/fp/some" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "some">; -} - -declare module "lodash/fp/any" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "any">; -} - -declare module "lodash/fp/sortBy" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "sortBy">; -} - -declare module "lodash/fp/now" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "now">; -} - -declare module "lodash/fp/after" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "after">; -} - -declare module "lodash/fp/ary" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "ary">; -} - -declare module "lodash/fp/nAry" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "nAry">; -} - -declare module "lodash/fp/before" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "before">; -} - -declare module "lodash/fp/bind" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "bind">; -} - -declare module "lodash/fp/bindKey" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "bindKey">; -} - -declare module "lodash/fp/curry" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "curry">; -} - -declare module "lodash/fp/curryN" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "curryN">; -} - -declare module "lodash/fp/curryRight" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "curryRight">; -} - -declare module "lodash/fp/curryRightN" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "curryRightN">; -} - -declare module "lodash/fp/debounce" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "debounce">; -} - -declare module "lodash/fp/defer" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "defer">; -} - -declare module "lodash/fp/delay" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "delay">; -} - -declare module "lodash/fp/flip" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "flip">; -} - -declare module "lodash/fp/memoize" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "memoize">; -} - -declare module "lodash/fp/negate" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "negate">; -} - -declare module "lodash/fp/complement" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "complement">; -} - -declare module "lodash/fp/once" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "once">; -} - -declare module "lodash/fp/overArgs" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "overArgs">; -} - -declare module "lodash/fp/useWith" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "useWith">; -} - -declare module "lodash/fp/partial" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "partial">; -} - -declare module "lodash/fp/partialRight" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "partialRight">; -} - -declare module "lodash/fp/rearg" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "rearg">; -} - -declare module "lodash/fp/rest" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "rest">; -} - -declare module "lodash/fp/unapply" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "unapply">; -} - -declare module "lodash/fp/restFrom" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "restFrom">; -} - -declare module "lodash/fp/spread" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "spread">; -} - -declare module "lodash/fp/apply" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "apply">; -} - -declare module "lodash/fp/spreadFrom" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "spreadFrom">; -} - -declare module "lodash/fp/throttle" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "throttle">; -} - -declare module "lodash/fp/unary" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "unary">; -} - -declare module "lodash/fp/wrap" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "wrap">; -} - -declare module "lodash/fp/castArray" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "castArray">; -} - -declare module "lodash/fp/clone" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "clone">; -} - -declare module "lodash/fp/cloneDeep" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "cloneDeep">; -} - -declare module "lodash/fp/cloneDeepWith" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "cloneDeepWith">; -} - -declare module "lodash/fp/cloneWith" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "cloneWith">; -} - -declare module "lodash/fp/conformsTo" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "conformsTo">; -} - -declare module "lodash/fp/where" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "where">; -} - -declare module "lodash/fp/conforms" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "conforms">; -} - -declare module "lodash/fp/eq" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "eq">; -} - -declare module "lodash/fp/identical" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "identical">; -} - -declare module "lodash/fp/gt" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "gt">; -} - -declare module "lodash/fp/gte" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "gte">; -} - -declare module "lodash/fp/isArguments" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isArguments">; -} - -declare module "lodash/fp/isArray" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isArray">; -} - -declare module "lodash/fp/isArrayBuffer" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isArrayBuffer">; -} - -declare module "lodash/fp/isArrayLike" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isArrayLike">; -} - -declare module "lodash/fp/isArrayLikeObject" { - declare module.exports: $PropertyType< - $Exports<"lodash/fp">, - "isArrayLikeObject" - >; -} - -declare module "lodash/fp/isBoolean" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isBoolean">; -} - -declare module "lodash/fp/isBuffer" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isBuffer">; -} - -declare module "lodash/fp/isDate" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isDate">; -} - -declare module "lodash/fp/isElement" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isElement">; -} - -declare module "lodash/fp/isEmpty" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isEmpty">; -} - -declare module "lodash/fp/isEqual" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isEqual">; -} - -declare module "lodash/fp/equals" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "equals">; -} - -declare module "lodash/fp/isEqualWith" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isEqualWith">; -} - -declare module "lodash/fp/isError" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isError">; -} - -declare module "lodash/fp/isFinite" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isFinite">; -} - -declare module "lodash/fp/isFunction" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isFunction">; -} - -declare module "lodash/fp/isInteger" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isInteger">; -} - -declare module "lodash/fp/isLength" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isLength">; -} - -declare module "lodash/fp/isMap" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isMap">; -} - -declare module "lodash/fp/isMatch" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isMatch">; -} - -declare module "lodash/fp/whereEq" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "whereEq">; -} - -declare module "lodash/fp/isMatchWith" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isMatchWith">; -} - -declare module "lodash/fp/isNaN" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isNaN">; -} - -declare module "lodash/fp/isNative" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isNative">; -} - -declare module "lodash/fp/isNil" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isNil">; -} - -declare module "lodash/fp/isNull" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isNull">; -} - -declare module "lodash/fp/isNumber" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isNumber">; -} - -declare module "lodash/fp/isObject" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isObject">; -} - -declare module "lodash/fp/isObjectLike" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isObjectLike">; -} - -declare module "lodash/fp/isPlainObject" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isPlainObject">; -} - -declare module "lodash/fp/isRegExp" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isRegExp">; -} - -declare module "lodash/fp/isSafeInteger" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isSafeInteger">; -} - -declare module "lodash/fp/isSet" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isSet">; -} - -declare module "lodash/fp/isString" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isString">; -} - -declare module "lodash/fp/isSymbol" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isSymbol">; -} - -declare module "lodash/fp/isTypedArray" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isTypedArray">; -} - -declare module "lodash/fp/isUndefined" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isUndefined">; -} - -declare module "lodash/fp/isWeakMap" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isWeakMap">; -} - -declare module "lodash/fp/isWeakSet" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isWeakSet">; -} - -declare module "lodash/fp/lt" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "lt">; -} - -declare module "lodash/fp/lte" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "lte">; -} - -declare module "lodash/fp/toArray" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "toArray">; -} - -declare module "lodash/fp/toFinite" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "toFinite">; -} - -declare module "lodash/fp/toInteger" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "toInteger">; -} - -declare module "lodash/fp/toLength" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "toLength">; -} - -declare module "lodash/fp/toNumber" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "toNumber">; -} - -declare module "lodash/fp/toPlainObject" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "toPlainObject">; -} - -declare module "lodash/fp/toSafeInteger" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "toSafeInteger">; -} - -declare module "lodash/fp/toString" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "toString">; -} - -declare module "lodash/fp/add" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "add">; -} - -declare module "lodash/fp/ceil" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "ceil">; -} - -declare module "lodash/fp/divide" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "divide">; -} - -declare module "lodash/fp/floor" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "floor">; -} - -declare module "lodash/fp/max" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "max">; -} - -declare module "lodash/fp/maxBy" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "maxBy">; -} - -declare module "lodash/fp/mean" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "mean">; -} - -declare module "lodash/fp/meanBy" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "meanBy">; -} - -declare module "lodash/fp/min" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "min">; -} - -declare module "lodash/fp/minBy" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "minBy">; -} - -declare module "lodash/fp/multiply" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "multiply">; -} - -declare module "lodash/fp/round" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "round">; -} - -declare module "lodash/fp/subtract" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "subtract">; -} - -declare module "lodash/fp/sum" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "sum">; -} - -declare module "lodash/fp/sumBy" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "sumBy">; -} - -declare module "lodash/fp/clamp" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "clamp">; -} - -declare module "lodash/fp/inRange" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "inRange">; -} - -declare module "lodash/fp/random" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "random">; -} - -declare module "lodash/fp/assign" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "assign">; -} - -declare module "lodash/fp/assignAll" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "assignAll">; -} - -declare module "lodash/fp/assignInAll" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "assignInAll">; -} - -declare module "lodash/fp/extendAll" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "extendAll">; -} - -declare module "lodash/fp/assignIn" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "assignIn">; -} - -declare module "lodash/fp/assignInWith" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "assignInWith">; -} - -declare module "lodash/fp/assignWith" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "assignWith">; -} - -declare module "lodash/fp/assignInAllWith" { - declare module.exports: $PropertyType< - $Exports<"lodash/fp">, - "assignInAllWith" - >; -} - -declare module "lodash/fp/extendAllWith" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "extendAllWith">; -} - -declare module "lodash/fp/assignAllWith" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "assignAllWith">; -} - -declare module "lodash/fp/at" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "at">; -} - -declare module "lodash/fp/props" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "props">; -} - -declare module "lodash/fp/paths" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "paths">; -} - -declare module "lodash/fp/create" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "create">; -} - -declare module "lodash/fp/defaults" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "defaults">; -} - -declare module "lodash/fp/defaultsAll" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "defaultsAll">; -} - -declare module "lodash/fp/defaultsDeep" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "defaultsDeep">; -} - -declare module "lodash/fp/defaultsDeepAll" { - declare module.exports: $PropertyType< - $Exports<"lodash/fp">, - "defaultsDeepAll" - >; -} - -declare module "lodash/fp/entries" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "entries">; -} - -declare module "lodash/fp/entriesIn" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "entriesIn">; -} - -declare module "lodash/fp/extend" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "extend">; -} - -declare module "lodash/fp/extendWith" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "extendWith">; -} - -declare module "lodash/fp/findKey" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "findKey">; -} - -declare module "lodash/fp/findLastKey" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "findLastKey">; -} - -declare module "lodash/fp/forIn" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "forIn">; -} - -declare module "lodash/fp/forInRight" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "forInRight">; -} - -declare module "lodash/fp/forOwn" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "forOwn">; -} - -declare module "lodash/fp/forOwnRight" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "forOwnRight">; -} - -declare module "lodash/fp/functions" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "functions">; -} - -declare module "lodash/fp/functionsIn" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "functionsIn">; -} - -declare module "lodash/fp/get" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "get">; -} - -declare module "lodash/fp/prop" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "prop">; -} - -declare module "lodash/fp/path" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "path">; -} - -declare module "lodash/fp/getOr" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "getOr">; -} - -declare module "lodash/fp/propOr" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "propOr">; -} - -declare module "lodash/fp/pathOr" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "pathOr">; -} - -declare module "lodash/fp/has" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "has">; -} - -declare module "lodash/fp/hasIn" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "hasIn">; -} - -declare module "lodash/fp/invert" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "invert">; -} - -declare module "lodash/fp/invertObj" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "invertObj">; -} - -declare module "lodash/fp/invertBy" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "invertBy">; -} - -declare module "lodash/fp/invoke" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "invoke">; -} - -declare module "lodash/fp/invokeArgs" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "invokeArgs">; -} - -declare module "lodash/fp/keys" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "keys">; -} - -declare module "lodash/fp/keysIn" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "keysIn">; -} - -declare module "lodash/fp/mapKeys" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "mapKeys">; -} - -declare module "lodash/fp/mapValues" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "mapValues">; -} - -declare module "lodash/fp/merge" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "merge">; -} - -declare module "lodash/fp/mergeAll" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "mergeAll">; -} - -declare module "lodash/fp/mergeWith" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "mergeWith">; -} - -declare module "lodash/fp/mergeAllWith" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "mergeAllWith">; -} - -declare module "lodash/fp/omit" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "omit">; -} - -declare module "lodash/fp/omitAll" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "omitAll">; -} - -declare module "lodash/fp/omitBy" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "omitBy">; -} - -declare module "lodash/fp/pick" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "pick">; -} - -declare module "lodash/fp/pickAll" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "pickAll">; -} - -declare module "lodash/fp/pickBy" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "pickBy">; -} - -declare module "lodash/fp/result" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "result">; -} - -declare module "lodash/fp/set" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "set">; -} - -declare module "lodash/fp/assoc" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "assoc">; -} - -declare module "lodash/fp/assocPath" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "assocPath">; -} - -declare module "lodash/fp/setWith" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "setWith">; -} - -declare module "lodash/fp/toPairs" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "toPairs">; -} - -declare module "lodash/fp/toPairsIn" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "toPairsIn">; -} - -declare module "lodash/fp/transform" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "transform">; -} - -declare module "lodash/fp/unset" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "unset">; -} - -declare module "lodash/fp/dissoc" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "dissoc">; -} - -declare module "lodash/fp/dissocPath" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "dissocPath">; -} - -declare module "lodash/fp/update" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "update">; -} - -declare module "lodash/fp/updateWith" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "updateWith">; -} - -declare module "lodash/fp/values" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "values">; -} - -declare module "lodash/fp/valuesIn" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "valuesIn">; -} - -declare module "lodash/fp/tap" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "tap">; -} - -declare module "lodash/fp/thru" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "thru">; -} - -declare module "lodash/fp/camelCase" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "camelCase">; -} - -declare module "lodash/fp/capitalize" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "capitalize">; -} - -declare module "lodash/fp/deburr" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "deburr">; -} - -declare module "lodash/fp/endsWith" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "endsWith">; -} - -declare module "lodash/fp/escape" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "escape">; -} - -declare module "lodash/fp/escapeRegExp" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "escapeRegExp">; -} - -declare module "lodash/fp/kebabCase" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "kebabCase">; -} - -declare module "lodash/fp/lowerCase" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "lowerCase">; -} - -declare module "lodash/fp/lowerFirst" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "lowerFirst">; -} - -declare module "lodash/fp/pad" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "pad">; -} - -declare module "lodash/fp/padChars" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "padChars">; -} - -declare module "lodash/fp/padEnd" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "padEnd">; -} - -declare module "lodash/fp/padCharsEnd" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "padCharsEnd">; -} - -declare module "lodash/fp/padStart" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "padStart">; -} - -declare module "lodash/fp/padCharsStart" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "padCharsStart">; -} - -declare module "lodash/fp/parseInt" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "parseInt">; -} - -declare module "lodash/fp/repeat" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "repeat">; -} - -declare module "lodash/fp/replace" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "replace">; -} - -declare module "lodash/fp/snakeCase" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "snakeCase">; -} - -declare module "lodash/fp/split" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "split">; -} - -declare module "lodash/fp/startCase" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "startCase">; -} - -declare module "lodash/fp/startsWith" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "startsWith">; -} - -declare module "lodash/fp/template" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "template">; -} - -declare module "lodash/fp/toLower" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "toLower">; -} - -declare module "lodash/fp/toUpper" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "toUpper">; -} - -declare module "lodash/fp/trim" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "trim">; -} - -declare module "lodash/fp/trimChars" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "trimChars">; -} - -declare module "lodash/fp/trimEnd" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "trimEnd">; -} - -declare module "lodash/fp/trimCharsEnd" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "trimCharsEnd">; -} - -declare module "lodash/fp/trimStart" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "trimStart">; -} - -declare module "lodash/fp/trimCharsStart" { - declare module.exports: $PropertyType< - $Exports<"lodash/fp">, - "trimCharsStart" - >; -} - -declare module "lodash/fp/truncate" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "truncate">; -} - -declare module "lodash/fp/unescape" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "unescape">; -} - -declare module "lodash/fp/upperCase" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "upperCase">; -} - -declare module "lodash/fp/upperFirst" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "upperFirst">; -} - -declare module "lodash/fp/words" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "words">; -} - -declare module "lodash/fp/attempt" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "attempt">; -} - -declare module "lodash/fp/bindAll" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "bindAll">; -} - -declare module "lodash/fp/cond" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "cond">; -} - -declare module "lodash/fp/constant" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "constant">; -} - -declare module "lodash/fp/always" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "always">; -} - -declare module "lodash/fp/defaultTo" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "defaultTo">; -} - -declare module "lodash/fp/flow" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "flow">; -} - -declare module "lodash/fp/pipe" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "pipe">; -} - -declare module "lodash/fp/flowRight" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "flowRight">; -} - -declare module "lodash/fp/compose" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "compose">; -} - -declare module "lodash/fp/identity" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "identity">; -} - -declare module "lodash/fp/iteratee" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "iteratee">; -} - -declare module "lodash/fp/matches" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "matches">; -} - -declare module "lodash/fp/matchesProperty" { - declare module.exports: $PropertyType< - $Exports<"lodash/fp">, - "matchesProperty" - >; -} - -declare module "lodash/fp/propEq" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "propEq">; -} - -declare module "lodash/fp/pathEq" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "pathEq">; -} - -declare module "lodash/fp/method" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "method">; -} - -declare module "lodash/fp/methodOf" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "methodOf">; -} - -declare module "lodash/fp/mixin" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "mixin">; -} - -declare module "lodash/fp/noConflict" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "noConflict">; -} - -declare module "lodash/fp/noop" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "noop">; -} - -declare module "lodash/fp/nthArg" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "nthArg">; -} - -declare module "lodash/fp/over" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "over">; -} - -declare module "lodash/fp/juxt" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "juxt">; -} - -declare module "lodash/fp/overEvery" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "overEvery">; -} - -declare module "lodash/fp/allPass" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "allPass">; -} - -declare module "lodash/fp/overSome" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "overSome">; -} - -declare module "lodash/fp/anyPass" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "anyPass">; -} - -declare module "lodash/fp/property" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "property">; -} - -declare module "lodash/fp/propertyOf" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "propertyOf">; -} - -declare module "lodash/fp/range" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "range">; -} - -declare module "lodash/fp/rangeStep" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "rangeStep">; -} - -declare module "lodash/fp/rangeRight" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "rangeRight">; -} - -declare module "lodash/fp/rangeStepRight" { - declare module.exports: $PropertyType< - $Exports<"lodash/fp">, - "rangeStepRight" - >; -} - -declare module "lodash/fp/runInContext" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "runInContext">; -} - -declare module "lodash/fp/stubArray" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "stubArray">; -} - -declare module "lodash/fp/stubFalse" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "stubFalse">; -} - -declare module "lodash/fp/F" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "F">; -} - -declare module "lodash/fp/stubObject" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "stubObject">; -} - -declare module "lodash/fp/stubString" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "stubString">; -} - -declare module "lodash/fp/stubTrue" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "stubTrue">; -} - -declare module "lodash/fp/T" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "T">; -} - -declare module "lodash/fp/times" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "times">; -} - -declare module "lodash/fp/toPath" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "toPath">; -} - -declare module "lodash/fp/uniqueId" { - declare module.exports: $PropertyType<$Exports<"lodash/fp">, "uniqueId">; -} diff --git a/flow-typed/npm/react-intl_v2.x.x.js b/flow-typed/npm/react-intl_v2.x.x.js deleted file mode 100644 index 0bb2db1de5..0000000000 --- a/flow-typed/npm/react-intl_v2.x.x.js +++ /dev/null @@ -1,269 +0,0 @@ -// flow-typed signature: 5243ea9e69743c504dd1a4eb277c2895 -// flow-typed version: 2cbbfd7d47/react-intl_v2.x.x/flow_>=v0.104.x - -/** - * Original implementation of this file by @marudor at https://github.com/marudor/flowInterfaces - * Copied here based on intention to merge with flow-typed expressed here: - * https://github.com/marudor/flowInterfaces/issues/6 - */ -// Mostly from https://github.com/yahoo/react-intl/wiki/API#react-intl-api -declare module "react-intl" { - import type { Element, ChildrenArray } from "react"; - - declare type $npm$ReactIntl$LocaleData = { - [key: string]: any, - locale: string, - ... - }; - - declare type $npm$ReactIntl$MessageDescriptor = { - id: string, - description?: string, - defaultMessage?: string, - ... - }; - - declare type $npm$ReactIntl$IntlConfig = { - locale: string, - formats: Object, - messages: { [id: string]: string, ... }, - defaultLocale?: string, - defaultFormats?: Object, - ... - }; - - declare type $npm$ReactIntl$IntlProviderConfig = { - locale?: string, - formats?: Object, - messages?: { [id: string]: string, ... }, - defaultLocale?: string, - defaultFormats?: Object, - ... - }; - - declare type $npm$ReactIntl$IntlFormat = { - formatDate: (value: any, options?: Object) => string, - formatTime: (value: any, options?: Object) => string, - formatRelative: (value: any, options?: Object) => string, - formatNumber: (value: any, options?: Object) => string, - formatPlural: (value: any, options?: Object) => string, - formatMessage: ( - messageDescriptor: $npm$ReactIntl$MessageDescriptor, - values?: Object - ) => string, - formatHTMLMessage: ( - messageDescriptor: $npm$ReactIntl$MessageDescriptor, - values?: Object - ) => string, - ... - }; - - declare type $npm$ReactIntl$IntlShape = {| - ...$Exact<$npm$ReactIntl$IntlConfig>, - ...$Exact<$npm$ReactIntl$IntlFormat>, - ...{| now: () => number |}, - |}; - - declare type $npm$ReactIntl$DateTimeFormatOptions = { - localeMatcher?: "best fit" | "lookup", - formatMatcher?: "basic" | "best fit", - timeZone?: string, - hour12?: boolean, - weekday?: "narrow" | "short" | "long", - era?: "narrow" | "short" | "long", - year?: "numeric" | "2-digit", - month?: "numeric" | "2-digit" | "narrow" | "short" | "long", - day?: "numeric" | "2-digit", - hour?: "numeric" | "2-digit", - minute?: "numeric" | "2-digit", - second?: "numeric" | "2-digit", - timeZoneName?: "short" | "long", - ... - }; - - declare type $npm$ReactIntl$RelativeFormatOptions = { - style?: "best fit" | "numeric", - units?: "second" | "minute" | "hour" | "day" | "month" | "year", - ... - }; - - declare type $npm$ReactIntl$NumberFormatOptions = { - localeMatcher?: "best fit" | "lookup", - style?: "decimal" | "currency" | "percent", - currency?: string, - currencyDisplay?: "symbol" | "code" | "name", - useGrouping?: boolean, - minimumIntegerDigits?: number, - minimumFractionDigits?: number, - maximumFractionDigits?: number, - minimumSignificantDigits?: number, - maximumSignificantDigits?: number, - ... - }; - - declare type $npm$ReactIntl$PluralFormatOptions = { style?: "cardinal" | "ordinal", ... }; - - declare type $npm$ReactIntl$PluralCategoryString = - | "zero" - | "one" - | "two" - | "few" - | "many" - | "other"; - - declare type $npm$ReactIntl$DateParseable = number | string | Date; - // PropType checker - declare function intlShape( - props: Object, - propName: string, - componentName: string - ): void; - declare function addLocaleData( - data: $npm$ReactIntl$LocaleData | Array<$npm$ReactIntl$LocaleData> - ): void; - declare function defineMessages< - T: { [key: string]: $Exact<$npm$ReactIntl$MessageDescriptor>, ... } - >( - messageDescriptors: T - ): T; - - declare type InjectIntlProvidedProps = { intl: $npm$ReactIntl$IntlShape, ... } - - declare type InjectIntlVoidProps = { intl: $npm$ReactIntl$IntlShape | void, ... } - - declare type ComponentWithDefaultProps = - | React$ComponentType - | React$StatelessFunctionalComponent - | ChildrenArray>; - - declare type InjectIntlOptions = { - intlPropName?: string, - withRef?: boolean, - ... - } - - declare class IntlInjectedComponent extends React$Component { - static WrappedComponent: Class>, - static defaultProps: TDefaultProps, - props: TOwnProps - } - - declare type IntlInjectedComponentClass = Class< - IntlInjectedComponent - >; - - declare function injectIntl>( - WrappedComponent: Component, - options?: InjectIntlOptions, - ): React$ComponentType< - $Diff, InjectIntlVoidProps> - >; - - declare function formatMessage( - messageDescriptor: $npm$ReactIntl$MessageDescriptor, - values?: Object - ): string; - declare function formatHTMLMessage( - messageDescriptor: $npm$ReactIntl$MessageDescriptor, - values?: Object - ): string; - declare function formatDate( - value: any, - options?: $npm$ReactIntl$DateTimeFormatOptions & { format: string, ... } - ): string; - declare function formatTime( - value: any, - options?: $npm$ReactIntl$DateTimeFormatOptions & { format: string, ... } - ): string; - declare function formatRelative( - value: any, - options?: $npm$ReactIntl$RelativeFormatOptions & { - format: string, - now: any, - ... - } - ): string; - declare function formatNumber( - value: any, - options?: $npm$ReactIntl$NumberFormatOptions & { format: string, ... } - ): string; - declare function formatPlural( - value: any, - options?: $npm$ReactIntl$PluralFormatOptions - ): $npm$ReactIntl$PluralCategoryString; - - declare class FormattedMessage extends React$Component< - $npm$ReactIntl$MessageDescriptor & { - values?: Object, - tagName?: string, - children?: - | ((...formattedMessage: Array) => React$Node) - | (string => React$Node), - ... - } - > {} - declare class FormattedHTMLMessage extends React$Component< - $npm$ReactIntl$DateTimeFormatOptions & { - values?: Object, - tagName?: string, - children?: (...formattedMessage: Array) => React$Node, - ... - } - > {} - declare class FormattedDate extends React$Component< - $npm$ReactIntl$DateTimeFormatOptions & { - value: $npm$ReactIntl$DateParseable, - format?: string, - children?: (formattedDate: string) => React$Node, - ... - } - > {} - declare class FormattedTime extends React$Component< - $npm$ReactIntl$DateTimeFormatOptions & { - value: $npm$ReactIntl$DateParseable, - format?: string, - children?: (formattedDate: string) => React$Node, - ... - } - > {} - declare class FormattedRelative extends React$Component< - $npm$ReactIntl$RelativeFormatOptions & { - value: $npm$ReactIntl$DateParseable, - format?: string, - updateInterval?: number, - initialNow?: $npm$ReactIntl$DateParseable, - children?: (formattedDate: string) => React$Node, - ... - } - > {} - declare class FormattedNumber extends React$Component< - $npm$ReactIntl$NumberFormatOptions & { - value: number | string, - format?: string, - children?: (formattedNumber: string) => React$Node, - ... - } - > {} - declare class FormattedPlural extends React$Component< - $npm$ReactIntl$PluralFormatOptions & { - value: number | string, - other: React$Node, - zero?: React$Node, - one?: React$Node, - two?: React$Node, - few?: React$Node, - many?: React$Node, - children?: (formattedPlural: React$Node) => React$Node, - ... - } - > {} - declare class IntlProvider extends React$Component< - $npm$ReactIntl$IntlProviderConfig & { - children?: React$Node, - initialNow?: $npm$ReactIntl$DateParseable, - ... - } - > {} - declare type IntlShape = $npm$ReactIntl$IntlShape; - declare type MessageDescriptor = $npm$ReactIntl$MessageDescriptor; -} diff --git a/flow-typed/npm/react-intl_x.x.x.js b/flow-typed/npm/react-intl_x.x.x.js deleted file mode 100644 index e17c6f7a9a..0000000000 --- a/flow-typed/npm/react-intl_x.x.x.js +++ /dev/null @@ -1,271 +0,0 @@ -// flow-typed signature: 5243ea9e69743c504dd1a4eb277c2895 -// flow-typed version: 2cbbfd7d47/react-intl_v2.x.x/flow_>=v0.104.x - -/** - * Original implementation of this file by @marudor at https://github.com/marudor/flowInterfaces - * Copied here based on intention to merge with flow-typed expressed here: - * https://github.com/marudor/flowInterfaces/issues/6 - */ -// Mostly from https://github.com/yahoo/react-intl/wiki/API#react-intl-api -// @flow - -declare module 'react-intl' { - import type {Element, ChildrenArray} from 'react' - - declare type $npm$ReactIntl$LocaleData = { - [key: string]: any, - locale: string, - ... - } - - declare type $npm$ReactIntl$MessageDescriptor = { - id: string, - description?: string, - defaultMessage?: string, - ... - } - - declare type $npm$ReactIntl$IntlConfig = { - locale: string, - formats: Object, - messages: {[id: string]: string, ...}, - defaultLocale?: string, - defaultFormats?: Object, - ... - } - - declare type $npm$ReactIntl$IntlProviderConfig = { - locale?: string, - formats?: Object, - messages?: {[id: string]: string, ...}, - defaultLocale?: string, - defaultFormats?: Object, - ... - } - - declare type $npm$ReactIntl$IntlFormat = { - formatDate: (value: any, options?: Object) => string, - formatTime: (value: any, options?: Object) => string, - formatRelative: (value: any, options?: Object) => string, - formatNumber: (value: any, options?: Object) => string, - formatPlural: (value: any, options?: Object) => string, - formatMessage: (messageDescriptor: $npm$ReactIntl$MessageDescriptor, values?: Object) => string, - formatHTMLMessage: (messageDescriptor: $npm$ReactIntl$MessageDescriptor, values?: Object) => string, - ... - } - - declare type $npm$ReactIntl$IntlShape = {| - ...$Exact<$npm$ReactIntl$IntlConfig>, - ...$Exact<$npm$ReactIntl$IntlFormat>, - ...{|now: () => number|}, - |} - - declare type $npm$ReactIntl$DateTimeFormatOptions = { - localeMatcher?: 'best fit' | 'lookup', - formatMatcher?: 'basic' | 'best fit', - timeZone?: string, - hour12?: boolean, - weekday?: 'narrow' | 'short' | 'long', - era?: 'narrow' | 'short' | 'long', - year?: 'numeric' | '2-digit', - month?: 'numeric' | '2-digit' | 'narrow' | 'short' | 'long', - day?: 'numeric' | '2-digit', - hour?: 'numeric' | '2-digit', - minute?: 'numeric' | '2-digit', - second?: 'numeric' | '2-digit', - timeZoneName?: 'short' | 'long', - ... - } - - declare type $npm$ReactIntl$RelativeFormatOptions = { - style?: 'best fit' | 'numeric', - units?: 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year', - ... - } - - declare type $npm$ReactIntl$NumberFormatOptions = { - localeMatcher?: 'best fit' | 'lookup', - style?: 'decimal' | 'currency' | 'percent', - currency?: string, - currencyDisplay?: 'symbol' | 'code' | 'name', - useGrouping?: boolean, - minimumIntegerDigits?: number, - minimumFractionDigits?: number, - maximumFractionDigits?: number, - minimumSignificantDigits?: number, - maximumSignificantDigits?: number, - ... - } - - declare type $npm$ReactIntl$PluralFormatOptions = {style?: 'cardinal' | 'ordinal', ...} - - declare type $npm$ReactIntl$PluralCategoryString = 'zero' | 'one' | 'two' | 'few' | 'many' | 'other' - - declare type $npm$ReactIntl$DateParseable = number | string | Date - // PropType checker - declare function intlShape(props: Object, propName: string, componentName: string): voi - declare function addLocaleData(data: $npm$ReactIntl$LocaleData | Array<$npm$ReactIntl$LocaleData>): void - declare function defineMessages, ...}>( - messageDescriptors: T, - ): T - - declare type InjectIntlProvidedProps = {intl: $npm$ReactIntl$IntlShape, ...} - - declare type InjectIntlVoidProps = {intl: $npm$ReactIntl$IntlShape | void, ...} - - declare type ComponentWithDefaultProps = - | React$ComponentType - | React$StatelessFunctionalComponent - | ChildrenArray> - - declare type InjectIntlOptions = { - intlPropName?: string, - withRef?: boolean, - ... - } - - declare class IntlInjectedComponent extends React$Component { - static WrappedComponent: Class>; - static defaultProps: TDefaultProps; - props: TOwnProps; - } - - declare type IntlInjectedComponentClass = Class< - IntlInjectedComponent, - > - - declare function injectIntl>( - WrappedComponent: Component, - options?: InjectIntlOptions, - ): React$ComponentType<$Diff, InjectIntlVoidProps>> - - declare function formatMessage(messageDescriptor: $npm$ReactIntl$MessageDescriptor, values?: Object): string - declare function formatHTMLMessage(messageDescriptor: $npm$ReactIntl$MessageDescriptor, values?: Object): string - declare function formatDate( - value: any, - options?: $npm$ReactIntl$DateTimeFormatOptions & {format: string, ...}, - ): string - declare function formatTime( - value: any, - options?: $npm$ReactIntl$DateTimeFormatOptions & {format: string, ...}, - ): string - declare function formatRelative( - value: any, - options?: $npm$ReactIntl$RelativeFormatOptions & { - format: string, - now: any, - ... - }, - ): string - declare function formatNumber( - value: any, - options?: $npm$ReactIntl$NumberFormatOptions & {format: string, ...}, - ): string - declare function formatPlural( - value: any, - options?: $npm$ReactIntl$PluralFormatOptions, - ): $npm$ReactIntl$PluralCategoryString - - declare class FormattedMessage - extends - React$Component< - $npm$ReactIntl$MessageDescriptor & { - values?: Object, - tagName?: string, - children?: ((...formattedMessage: Array) => React$Node) | ((string) => React$Node), - ... - }, - > {} - declare class FormattedHTMLMessage - extends - React$Component< - $npm$ReactIntl$DateTimeFormatOptions & { - values?: Object, - tagName?: string, - children?: (...formattedMessage: Array) => React$Node, - ... - }, - > {} - declare class FormattedDate - extends - React$Component< - $npm$ReactIntl$DateTimeFormatOptions & { - value: $npm$ReactIntl$DateParseable, - format?: string, - children?: (formattedDate: string) => React$Node, - ... - }, - > {} - declare class FormattedTime - extends - React$Component< - $npm$ReactIntl$DateTimeFormatOptions & { - value: $npm$ReactIntl$DateParseable, - format?: string, - children?: (formattedDate: string) => React$Node, - ... - }, - > {} - declare class FormattedRelative - extends - React$Component< - $npm$ReactIntl$RelativeFormatOptions & { - value: $npm$ReactIntl$DateParseable, - format?: string, - updateInterval?: number, - initialNow?: $npm$ReactIntl$DateParseable, - children?: (formattedDate: string) => React$Node, - ... - }, - > {} - declare class FormattedNumber - extends - React$Component< - $npm$ReactIntl$NumberFormatOptions & { - value: number | string, - format?: string, - children?: (formattedNumber: string) => React$Node, - ... - }, - > {} - declare class FormattedPlural - extends - React$Component< - $npm$ReactIntl$PluralFormatOptions & { - value: number | string, - other: React$Node, - zero?: React$Node, - one?: React$Node, - two?: React$Node, - few?: React$Node, - many?: React$Node, - children?: (formattedPlural: React$Node) => React$Node, - ... - }, - > {} - declare class IntlProvider - extends - React$Component< - $npm$ReactIntl$IntlProviderConfig & { - children?: React$Node, - initialNow?: $npm$ReactIntl$DateParseable, - ... - }, - > {} - declare type IntlShape = $npm$ReactIntl$IntlShape - declare type MessageDescriptor = $npm$ReactIntl$MessageDescriptor - - declare interface IntlCache { - dateTime: {[key: string]: DateTimeFormat, ...}; - number: {[key: string]: Intl.NumberFormat, ...}; - message: {[key: string]: IntlMessageFormat, ...}; - relativeTime: {[key: string]: Intl.RelativeTimeFormat, ...}; - pluralRules: {[key: string]: Intl.PluralRules, ...}; - list: {[key: string]: IntlListFormat, ...}; - displayNames: {[key: string]: DisplayNames, ...}; - } - - declare function useIntl(): IntlShape - declare function createIntlCache(): IntlCache - declare function createIntl(...args: Array): IntlShape -} diff --git a/flow-typed/npm/react-redux_v7.x.x.js b/flow-typed/npm/react-redux_v7.x.x.js deleted file mode 100644 index f5da41f9c3..0000000000 --- a/flow-typed/npm/react-redux_v7.x.x.js +++ /dev/null @@ -1,300 +0,0 @@ -// flow-typed signature: 7456cdc4429c4c11d99dfc261304bb51 -// flow-typed version: 681f51bc9f/react-redux_v7.x.x/flow_>=v0.104.x <=v0.141.x - -/** -The order of type arguments for connect() is as follows: - -connect(…) - -In Flow v0.89 only the first two are mandatory to specify. Other 4 can be repaced with the new awesome type placeholder: - -connect(…) - -But beware, in case of weird type errors somewhere in random places -just type everything and get to a green field and only then try to -remove the definitions you see bogus. - -Decrypting the abbreviations: - WC = Component being wrapped - S = State - D = Dispatch - OP = OwnProps - SP = StateProps - DP = DispatchProps - MP = Merge props - RSP = Returned state props - RDP = Returned dispatch props - RMP = Returned merge props - CP = Props for returned component - Com = React Component - SS = Selected state - ST = Static properties of Com - EFO = Extra factory options (used only in connectAdvanced) -*/ - -declare module "react-redux" { - // ------------------------------------------------------------ - // Typings for connect() - // ------------------------------------------------------------ - - declare export type Options = {| - pure?: boolean, - forwardRef?: boolean, - areStatesEqual?: (next: S, prev: S) => boolean, - areOwnPropsEqual?: (next: OP, prev: OP) => boolean, - areStatePropsEqual?: (next: SP, prev: SP) => boolean, - areMergedPropsEqual?: (next: MP, prev: MP) => boolean, - storeKey?: string, - |}; - - declare type MapStateToProps<-S, -OP, +SP> = - | ((state: S, ownProps: OP) => SP) - // If you want to use the factory function but get a strange error - // like "function is not an object" then just type the factory function - // like this: - // const factory: (State, OwnProps) => (State, OwnProps) => StateProps - // and provide the StateProps type to the SP type parameter. - | ((state: S, ownProps: OP) => (state: S, ownProps: OP) => SP); - - declare type Bind = ((...A) => R) => (...A) => $Call; - - declare type MapDispatchToPropsFn = - | ((dispatch: D, ownProps: OP) => DP) - // If you want to use the factory function but get a strange error - // like "function is not an object" then just type the factory function - // like this: - // const factory: (Dispatch, OwnProps) => (Dispatch, OwnProps) => DispatchProps - // and provide the DispatchProps type to the DP type parameter. - | ((dispatch: D, ownProps: OP) => (dispatch: D, ownProps: OP) => DP); - - declare class ConnectedComponent extends React$Component { - static +WrappedComponent: WC; - getWrappedInstance(): React$ElementRef; - } - // The connection of the Wrapped Component and the Connected Component - // happens here in `MP: P`. It means that type wise MP belongs to P, - // so to say MP >= P. - declare type Connector = >( - WC, - ) => Class> & WC; - - // No `mergeProps` argument - - // Got error like inexact OwnProps is incompatible with exact object type? - // Just make the OP parameter for `connect()` an exact object. - declare type MergeOP = {| ...$Exact, dispatch: D |}; - declare type MergeOPSP = {| ...$Exact, ...SP, dispatch: D |}; - declare type MergeOPDP = {| ...$Exact, ...DP |}; - declare type MergeOPSPDP = {| ...$Exact, ...SP, ...DP |}; - - declare export function connect<-P, -OP, -SP, -DP, -S, -D>( - mapStateToProps?: null | void, - mapDispatchToProps?: null | void, - mergeProps?: null | void, - options?: ?Options>, - ): Connector>; - - declare export function connect<-P, -OP, -SP, -DP, -S, -D>( - // If you get error here try adding return type to your mapStateToProps function - mapStateToProps: MapStateToProps, - mapDispatchToProps?: null | void, - mergeProps?: null | void, - options?: ?Options>, - ): Connector>; - - // In this case DP is an object of functions which has been bound to dispatch - // by the given mapDispatchToProps function. - declare export function connect<-P, -OP, -SP, -DP, S, D>( - mapStateToProps: null | void, - mapDispatchToProps: MapDispatchToPropsFn, - mergeProps?: null | void, - options?: ?Options>, - ): Connector>; - - // In this case DP is an object of action creators not yet bound to dispatch, - // this difference is not important in the vanila redux, - // but in case of usage with redux-thunk, the return type may differ. - declare export function connect<-P, -OP, -SP, -DP, S, D>( - mapStateToProps: null | void, - mapDispatchToProps: DP, - mergeProps?: null | void, - options?: ?Options>, - ): Connector>>>; - - declare export function connect<-P, -OP, -SP, -DP, S, D>( - // If you get error here try adding return type to your mapStateToProps function - mapStateToProps: MapStateToProps, - mapDispatchToProps: MapDispatchToPropsFn, - mergeProps?: null | void, - options?: ?Options, - ): Connector; - - declare export function connect<-P, -OP, -SP, -DP, S, D>( - // If you get error here try adding return type to your mapStateToProps function - mapStateToProps: MapStateToProps, - mapDispatchToProps: DP, - mergeProps?: null | void, - options?: ?Options>, - ): Connector>>>; - - // With `mergeProps` argument - - declare type MergeProps<+P, -OP, -SP, -DP> = ( - stateProps: SP, - dispatchProps: DP, - ownProps: OP, - ) => P; - - declare export function connect<-P, -OP, -SP: {||}, -DP: {||}, S, D>( - mapStateToProps: null | void, - mapDispatchToProps: null | void, - // If you get error here try adding return type to you mapStateToProps function - mergeProps: MergeProps, - options?: ?Options, - ): Connector; - - declare export function connect<-P, -OP, -SP, -DP: {||}, S, D>( - mapStateToProps: MapStateToProps, - mapDispatchToProps: null | void, - // If you get error here try adding return type to you mapStateToProps function - mergeProps: MergeProps, - options?: ?Options, - ): Connector; - - // In this case DP is an object of functions which has been bound to dispatch - // by the given mapDispatchToProps function. - declare export function connect<-P, -OP, -SP: {||}, -DP, S, D>( - mapStateToProps: null | void, - mapDispatchToProps: MapDispatchToPropsFn, - mergeProps: MergeProps, - options?: ?Options, - ): Connector; - - // In this case DP is an object of action creators not yet bound to dispatch, - // this difference is not important in the vanila redux, - // but in case of usage with redux-thunk, the return type may differ. - declare export function connect<-P, -OP, -SP: {||}, -DP, S, D>( - mapStateToProps: null | void, - mapDispatchToProps: DP, - mergeProps: MergeProps>>, - options?: ?Options, - ): Connector; - - // In this case DP is an object of functions which has been bound to dispatch - // by the given mapDispatchToProps function. - declare export function connect<-P, -OP, -SP, -DP, S, D>( - mapStateToProps: MapStateToProps, - mapDispatchToProps: MapDispatchToPropsFn, - mergeProps: MergeProps, - options?: ?Options, - ): Connector; - - // In this case DP is an object of action creators not yet bound to dispatch, - // this difference is not important in the vanila redux, - // but in case of usage with redux-thunk, the return type may differ. - declare export function connect<-P, -OP, -SP, -DP, S, D>( - mapStateToProps: MapStateToProps, - mapDispatchToProps: DP, - mergeProps: MergeProps>>, - options?: ?Options, - ): Connector; - - // ------------------------------------------------------------ - // Typings for Hooks - // ------------------------------------------------------------ - - declare export function useDispatch(): D; - - declare export function useSelector( - selector: (state: S) => SS, - equalityFn?: (a: SS, b: SS) => boolean, - ): SS; - - declare export function useStore(): Store; - - // ------------------------------------------------------------ - // Typings for Provider - // ------------------------------------------------------------ - - declare export class Provider extends React$Component<{ - store: Store, - children?: React$Node, - ... - }> {} - - declare export function createProvider( - storeKey?: string, - subKey?: string, - ): Class>; - - // ------------------------------------------------------------ - // Typings for connectAdvanced() - // ------------------------------------------------------------ - - declare type ConnectAdvancedOptions = { - getDisplayName?: (name: string) => string, - methodName?: string, - renderCountProp?: string, - shouldHandleStateChanges?: boolean, - storeKey?: string, - forwardRef?: boolean, - ... - }; - - declare type SelectorFactoryOptions = { - getDisplayName: (name: string) => string, - methodName: string, - renderCountProp: ?string, - shouldHandleStateChanges: boolean, - storeKey: string, - forwardRef: boolean, - displayName: string, - wrappedComponentName: string, - WrappedComponent: Com, - ... - }; - - declare type MapStateToPropsEx = ( - state: S, - props: SP, - ) => RSP; - - declare type SelectorFactory< - Com: React$ComponentType<*>, - Dispatch, - S: Object, - OP: Object, - EFO: Object, - CP: Object, - > = ( - dispatch: Dispatch, - factoryOptions: SelectorFactoryOptions & EFO, - ) => MapStateToPropsEx; - - declare export function connectAdvanced< - Com: React$ComponentType<*>, - D, - S: Object, - OP: Object, - CP: Object, - EFO: Object, - ST: { [_: $Keys]: any, ... }, - >( - selectorFactory: SelectorFactory, - connectAdvancedOptions: ?(ConnectAdvancedOptions & EFO), - ): (component: Com) => React$ComponentType & $Shape; - - declare export function batch(() => void): void - - declare export default { - Provider: typeof Provider, - createProvider: typeof createProvider, - connect: typeof connect, - connectAdvanced: typeof connectAdvanced, - useDispatch: typeof useDispatch, - useSelector: typeof useSelector, - useStore: typeof useStore, - batch: typeof batch, - ... - }; -} diff --git a/flow-typed/npm/redux-thunk_v2.x.x.js b/flow-typed/npm/redux-thunk_v2.x.x.js deleted file mode 100644 index 0c87ab0c0b..0000000000 --- a/flow-typed/npm/redux-thunk_v2.x.x.js +++ /dev/null @@ -1,33 +0,0 @@ -// flow-typed signature: 70deb399800b3a0577c45ce8a21434b8 -// flow-typed version: c63bca1648/redux-thunk_v2.x.x/flow_>=v0.83.x - -// Copied types from redux so that -// redux-thunk can be used with redux and redux-mock-store. -// -// This should be replaced with imports in the not too distant future once we -// figure out cross dependency imports in flow-typed -declare module '@@redux' { - declare export type DispatchAPI = (action: A) => A; - - declare export type Dispatch = DispatchAPI; - - declare export type MiddlewareAPI> = { - dispatch: D, - getState(): S, - ... - }; - - declare export type Middleware> = ( - api: MiddlewareAPI - ) => (next: D) => D; -} - -declare module 'redux-thunk' { - import type { Middleware } from '@@redux'; - - declare export type Thunk = Middleware & {| - withExtraArgument(arg: $NonMaybeType): Middleware, - |}; - - declare module.exports: Thunk; -} diff --git a/flow-typed/npm/redux_v4.x.x.js b/flow-typed/npm/redux_v4.x.x.js deleted file mode 100644 index 2ba2c8b265..0000000000 --- a/flow-typed/npm/redux_v4.x.x.js +++ /dev/null @@ -1,100 +0,0 @@ -// flow-typed signature: a49a6c96fe8a8bb3330cce2028588f4c -// flow-typed version: de5b3a01c6/redux_v4.x.x/flow_>=v0.89.x - -declare module 'redux' { - /* - - S = State - A = Action - D = Dispatch - - */ - - declare export type Action = { - type: T - } - - declare export type DispatchAPI = (action: A) => A; - - declare export type Dispatch = DispatchAPI; - - declare export type MiddlewareAPI> = { - dispatch: D, - getState(): S, - }; - - declare export type Store> = { - // rewrite MiddlewareAPI members in order to get nicer error messages (intersections produce long messages) - dispatch: D, - getState(): S, - subscribe(listener: () => void): () => void, - replaceReducer(nextReducer: Reducer): void, - }; - - declare export type Reducer = (state: S | void, action: A) => S; - - declare export type CombinedReducer = ( - state: ($Shape & {}) | void, - action: A - ) => S; - - declare export type Middleware> = ( - api: MiddlewareAPI - ) => (next: D) => D; - - declare export type StoreCreator> = { - (reducer: Reducer, enhancer?: StoreEnhancer): Store, - ( - reducer: Reducer, - preloadedState: S, - enhancer?: StoreEnhancer - ): Store, - }; - - declare export type StoreEnhancer> = ( - next: StoreCreator - ) => StoreCreator; - - declare export function createStore( - reducer: Reducer, - enhancer?: StoreEnhancer - ): Store; - declare export function createStore( - reducer: Reducer, - preloadedState?: S, - enhancer?: StoreEnhancer - ): Store; - - declare export function applyMiddleware( - ...middlewares: Array> - ): StoreEnhancer; - - declare export type ActionCreator = (...args: Array) => A; - declare export type ActionCreators = { - [key: K]: ActionCreator, - }; - - declare export function bindActionCreators< - A, - C: ActionCreator, - D: DispatchAPI - >( - actionCreator: C, - dispatch: D - ): C; - declare export function bindActionCreators< - A, - K, - C: ActionCreators, - D: DispatchAPI - >( - actionCreators: C, - dispatch: D - ): C; - - declare export function combineReducers( - reducers: O - ): CombinedReducer<$ObjMap(r: Reducer) => S>, A>; - - declare export var compose: $Compose; -} diff --git a/flow-typed/npm/reselect_v4.x.x.js b/flow-typed/npm/reselect_v4.x.x.js deleted file mode 100644 index 1dcc9d1fd8..0000000000 --- a/flow-typed/npm/reselect_v4.x.x.js +++ /dev/null @@ -1,895 +0,0 @@ -// flow-typed signature: e6663d5530a1c74d049705149f73ff18 -// flow-typed version: 1204f9886b/reselect_v4.x.x/flow_>=v0.47.x - -type ExtractReturnType = ((...rest: any[]) => Return) => Return; - -declare module "reselect" { - declare type InputSelector<-TState, TProps, TResult> = - (state: TState, props: TProps, ...rest: any[]) => TResult - - declare type OutputSelector<-TState, TProps, TResult> = - & InputSelector - & { - recomputations(): number, - resetRecomputations(): number, - resultFunc(state: TState, props: TProps, ...rest: Array): TResult, - }; - - declare type SelectorCreator = { - ( - selector1: InputSelector, - resultFunc: (arg1: T1) => TResult - ): OutputSelector, - ( - selectors: [InputSelector], - resultFunc: (arg1: T1) => TResult - ): OutputSelector, - - ( - selector1: InputSelector, - selector2: InputSelector, - resultFunc: (arg1: T1, arg2: T2) => TResult - ): OutputSelector, - ( - selectors: [InputSelector, InputSelector], - resultFunc: (arg1: T1, arg2: T2) => TResult - ): OutputSelector, - - ( - selector1: InputSelector, - selector2: InputSelector, - selector3: InputSelector, - resultFunc: (arg1: T1, arg2: T2, arg3: T3) => TResult - ): OutputSelector, - ( - selectors: [ - InputSelector, - InputSelector, - InputSelector - ], - resultFunc: (arg1: T1, arg2: T2, arg3: T3) => TResult - ): OutputSelector, - - ( - selector1: InputSelector, - selector2: InputSelector, - selector3: InputSelector, - selector4: InputSelector, - resultFunc: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => TResult - ): OutputSelector, - ( - selectors: [ - InputSelector, - InputSelector, - InputSelector, - InputSelector - ], - resultFunc: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => TResult - ): OutputSelector, - - ( - selector1: InputSelector, - selector2: InputSelector, - selector3: InputSelector, - selector4: InputSelector, - selector5: InputSelector, - resultFunc: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => TResult - ): OutputSelector, - ( - selectors: [ - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector - ], - resultFunc: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => TResult - ): OutputSelector, - - ( - selector1: InputSelector, - selector2: InputSelector, - selector3: InputSelector, - selector4: InputSelector, - selector5: InputSelector, - selector6: InputSelector, - resultFunc: ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - arg6: T6 - ) => TResult - ): OutputSelector, - ( - selectors: [ - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector - ], - resultFunc: ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - arg6: T6 - ) => TResult - ): OutputSelector, - - ( - selector1: InputSelector, - selector2: InputSelector, - selector3: InputSelector, - selector4: InputSelector, - selector5: InputSelector, - selector6: InputSelector, - selector7: InputSelector, - resultFunc: ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - arg6: T6, - arg7: T7 - ) => TResult - ): OutputSelector, - ( - selectors: [ - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector - ], - resultFunc: ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - arg6: T6, - arg7: T7 - ) => TResult - ): OutputSelector, - - ( - selector1: InputSelector, - selector2: InputSelector, - selector3: InputSelector, - selector4: InputSelector, - selector5: InputSelector, - selector6: InputSelector, - selector7: InputSelector, - selector8: InputSelector, - resultFunc: ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - arg6: T6, - arg7: T7, - arg8: T8 - ) => TResult - ): OutputSelector, - ( - selectors: [ - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector - ], - resultFunc: ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - arg6: T6, - arg7: T7, - arg8: T8 - ) => TResult - ): OutputSelector, - - ( - selector1: InputSelector, - selector2: InputSelector, - selector3: InputSelector, - selector4: InputSelector, - selector5: InputSelector, - selector6: InputSelector, - selector7: InputSelector, - selector8: InputSelector, - selector9: InputSelector, - resultFunc: ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - arg6: T6, - arg7: T7, - arg8: T8, - arg9: T9 - ) => TResult - ): OutputSelector, - ( - selectors: [ - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector - ], - resultFunc: ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - arg6: T6, - arg7: T7, - arg8: T8, - arg9: T9 - ) => TResult - ): OutputSelector, - - ( - selector1: InputSelector, - selector2: InputSelector, - selector3: InputSelector, - selector4: InputSelector, - selector5: InputSelector, - selector6: InputSelector, - selector7: InputSelector, - selector8: InputSelector, - selector9: InputSelector, - selector10: InputSelector, - resultFunc: ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - arg6: T6, - arg7: T7, - arg8: T8, - arg9: T9, - arg10: T10 - ) => TResult - ): OutputSelector, - ( - selectors: [ - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector - ], - resultFunc: ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - arg6: T6, - arg7: T7, - arg8: T8, - arg9: T9, - arg10: T10 - ) => TResult - ): OutputSelector, - - ( - selector1: InputSelector, - selector2: InputSelector, - selector3: InputSelector, - selector4: InputSelector, - selector5: InputSelector, - selector6: InputSelector, - selector7: InputSelector, - selector8: InputSelector, - selector9: InputSelector, - selector10: InputSelector, - selector11: InputSelector, - resultFunc: ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - arg6: T6, - arg7: T7, - arg8: T8, - arg9: T9, - arg10: T10, - arg11: T11 - ) => TResult - ): OutputSelector, - ( - selectors: [ - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector - ], - resultFunc: ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - arg6: T6, - arg7: T7, - arg8: T8, - arg9: T9, - arg10: T10, - arg11: T11 - ) => TResult - ): OutputSelector, - - < - TState, - TProps, - TResult, - T1, - T2, - T3, - T4, - T5, - T6, - T7, - T8, - T9, - T10, - T11, - T12 - >( - selector1: InputSelector, - selector2: InputSelector, - selector3: InputSelector, - selector4: InputSelector, - selector5: InputSelector, - selector6: InputSelector, - selector7: InputSelector, - selector8: InputSelector, - selector9: InputSelector, - selector10: InputSelector, - selector11: InputSelector, - selector12: InputSelector, - resultFunc: ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - arg6: T6, - arg7: T7, - arg8: T8, - arg9: T9, - arg10: T10, - arg11: T11, - arg12: T12 - ) => TResult - ): OutputSelector, - < - TState, - TProps, - TResult, - T1, - T2, - T3, - T4, - T5, - T6, - T7, - T8, - T9, - T10, - T11, - T12 - >( - selectors: [ - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector - ], - resultFunc: ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - arg6: T6, - arg7: T7, - arg8: T8, - arg9: T9, - arg10: T10, - arg11: T11, - arg12: T12 - ) => TResult - ): OutputSelector, - - < - TState, - TProps, - TResult, - T1, - T2, - T3, - T4, - T5, - T6, - T7, - T8, - T9, - T10, - T11, - T12, - T13 - >( - selector1: InputSelector, - selector2: InputSelector, - selector3: InputSelector, - selector4: InputSelector, - selector5: InputSelector, - selector6: InputSelector, - selector7: InputSelector, - selector8: InputSelector, - selector9: InputSelector, - selector10: InputSelector, - selector11: InputSelector, - selector12: InputSelector, - selector13: InputSelector, - resultFunc: ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - arg6: T6, - arg7: T7, - arg8: T8, - arg9: T9, - arg10: T10, - arg11: T11, - arg12: T12, - arg13: T13 - ) => TResult - ): OutputSelector, - < - TState, - TProps, - TResult, - T1, - T2, - T3, - T4, - T5, - T6, - T7, - T8, - T9, - T10, - T11, - T12, - T13 - >( - selectors: [ - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector - ], - resultFunc: ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - arg6: T6, - arg7: T7, - arg8: T8, - arg9: T9, - arg10: T10, - arg11: T11, - arg12: T12, - arg13: T13 - ) => TResult - ): OutputSelector, - - < - TState, - TProps, - TResult, - T1, - T2, - T3, - T4, - T5, - T6, - T7, - T8, - T9, - T10, - T11, - T12, - T13, - T14 - >( - selector1: InputSelector, - selector2: InputSelector, - selector3: InputSelector, - selector4: InputSelector, - selector5: InputSelector, - selector6: InputSelector, - selector7: InputSelector, - selector8: InputSelector, - selector9: InputSelector, - selector10: InputSelector, - selector11: InputSelector, - selector12: InputSelector, - selector13: InputSelector, - selector14: InputSelector, - resultFunc: ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - arg6: T6, - arg7: T7, - arg8: T8, - arg9: T9, - arg10: T10, - arg11: T11, - arg12: T12, - arg13: T13, - arg14: T14 - ) => TResult - ): OutputSelector, - < - TState, - TProps, - TResult, - T1, - T2, - T3, - T4, - T5, - T6, - T7, - T8, - T9, - T10, - T11, - T12, - T13, - T14 - >( - selectors: [ - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector - ], - resultFunc: ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - arg6: T6, - arg7: T7, - arg8: T8, - arg9: T9, - arg10: T10, - arg11: T11, - arg12: T12, - arg13: T13, - arg14: T14 - ) => TResult - ): OutputSelector, - - < - TState, - TProps, - TResult, - T1, - T2, - T3, - T4, - T5, - T6, - T7, - T8, - T9, - T10, - T11, - T12, - T13, - T14, - T15 - >( - selector1: InputSelector, - selector2: InputSelector, - selector3: InputSelector, - selector4: InputSelector, - selector5: InputSelector, - selector6: InputSelector, - selector7: InputSelector, - selector8: InputSelector, - selector9: InputSelector, - selector10: InputSelector, - selector11: InputSelector, - selector12: InputSelector, - selector13: InputSelector, - selector14: InputSelector, - selector15: InputSelector, - resultFunc: ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - arg6: T6, - arg7: T7, - arg8: T8, - arg9: T9, - arg10: T10, - arg11: T11, - arg12: T12, - arg13: T13, - arg14: T14, - arg15: T15 - ) => TResult - ): OutputSelector, - < - TState, - TProps, - TResult, - T1, - T2, - T3, - T4, - T5, - T6, - T7, - T8, - T9, - T10, - T11, - T12, - T13, - T14, - T15 - >( - selectors: [ - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector - ], - resultFunc: ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - arg6: T6, - arg7: T7, - arg8: T8, - arg9: T9, - arg10: T10, - arg11: T11, - arg12: T12, - arg13: T13, - arg14: T14, - arg15: T15 - ) => TResult - ): OutputSelector, - - < - TState, - TProps, - TResult, - T1, - T2, - T3, - T4, - T5, - T6, - T7, - T8, - T9, - T10, - T11, - T12, - T13, - T14, - T15, - T16 - >( - selector1: InputSelector, - selector2: InputSelector, - selector3: InputSelector, - selector4: InputSelector, - selector5: InputSelector, - selector6: InputSelector, - selector7: InputSelector, - selector8: InputSelector, - selector9: InputSelector, - selector10: InputSelector, - selector11: InputSelector, - selector12: InputSelector, - selector13: InputSelector, - selector14: InputSelector, - selector15: InputSelector, - selector16: InputSelector, - resultFunc: ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - arg6: T6, - arg7: T7, - arg8: T8, - arg9: T9, - arg10: T10, - arg11: T11, - arg12: T12, - arg13: T13, - arg14: T14, - arg15: T15, - arg16: T16 - ) => TResult - ): OutputSelector, - < - TState, - TProps, - TResult, - T1, - T2, - T3, - T4, - T5, - T6, - T7, - T8, - T9, - T10, - T11, - T12, - T13, - T14, - T15, - T16 - >( - selectors: [ - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector, - InputSelector - ], - resultFunc: ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - arg6: T6, - arg7: T7, - arg8: T8, - arg9: T9, - arg10: T10, - arg11: T11, - arg12: T12, - arg13: T13, - arg14: T14, - arg15: T15, - arg16: T16 - ) => TResult - ): OutputSelector - }; - - declare type Reselect = { - createSelector: SelectorCreator, - - defaultMemoize: ( - func: TFunc, - equalityCheck?: (a: any, b: any) => boolean - ) => TFunc, - - createSelectorCreator: ( - memoize: Function, - ...memoizeOptions: any[] - ) => SelectorCreator, - - createStructuredSelector: }>( - inputSelectors: InputSelectors, - selectorCreator?: SelectorCreator - ) => OutputSelector> - }; - - declare module.exports: Reselect; -} diff --git a/flow/declarations/undef.js b/flow/declarations/undef.js deleted file mode 100644 index 967aae4f39..0000000000 --- a/flow/declarations/undef.js +++ /dev/null @@ -1,6 +0,0 @@ -// @flow - -// detox doesn't provide flow types -declare var element: any -declare var by: any -declare var device: any diff --git a/flow/declarations/utils.js b/flow/declarations/utils.js deleted file mode 100644 index 000b494066..0000000000 --- a/flow/declarations/utils.js +++ /dev/null @@ -1,36 +0,0 @@ -// @flow - -declare type Dict = {[string]: T} - -declare type InexactSubset = $Rest; -declare type Inexact = { ...T, ... }; - -declare type ExtractReturnType = ((...arg: any) => R) => R; -declare type ReturnType = $Call; - -declare type ExtractPromisslessReturnType = ((...arg: any) => Promise) => R; -declare type PromisslessReturnType = $Call; - -declare type ExtractInstance = (Class) => T; -declare type InstanceOf = $Call; - -declare type ExtractElement = (Array) => T; -declare type ElementOf = $Call; - -declare type AddToArray = Array & Field>; - -declare type ToSchemaProp = (K, V) => K; - -declare type Nullable = (K) => null | K; -declare type WithNullableFields = $ObjMap; - -declare type PossiblyAsync = T | Promise; - -/* eslint-disable no-redeclare */ -declare function arguments(() => any): [] -declare function arguments((A) => any): [A] -declare function arguments((A, B) => any): [A, B] -declare function arguments((A, B, C) => any): [A, B, C] -declare function arguments((A, B, C, D) => any): [A, B, C, D] -declare function arguments((A, B, C, D, E) => any): [A, B, C, D, E] -declare type Arguments = $Call; diff --git a/i18n-unused.config.js b/i18n-unused.config.js new file mode 100644 index 0000000000..de6369c189 --- /dev/null +++ b/i18n-unused.config.js @@ -0,0 +1,4 @@ +module.exports = { + localesPath: 'src/i18n/locales/', + srcPath: 'src' +} diff --git a/index.ts b/index.ts index 17b4160efd..5d606ca513 100644 --- a/index.ts +++ b/index.ts @@ -1,4 +1,5 @@ +import './polyfills' import 'react-native-gesture-handler' // required by react-navigation import './global' -import './legacy/i18n/polyfills' // https://formatjs.io/docs/polyfills +import './src/i18n/polyfills' // https://formatjs.io/docs/polyfills import './src/index' diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 691b2db8fd..aa09f03837 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -293,9 +293,9 @@ PODS: - React-Core - react-native-config (0.12.0): - React - - react-native-haskell-shelley (3.1.3): + - react-native-haskell-shelley (3.1.4): - React - - react-native-netinfo (5.9.9): + - react-native-netinfo (9.3.0): - React-Core - react-native-pager-view (5.4.15): - React-Core @@ -389,20 +389,20 @@ PODS: - React-Core - RNPermissions (3.3.1): - React-Core - - RNReanimated (1.13.2): + - RNReanimated (1.13.4): - React-Core - RNScreens (3.1.0): - React-Core - - RNSentry (1.4.5): - - React - - Sentry (~> 5.1.4) + - RNSentry (3.3.2): + - React-Core + - Sentry (= 7.10.1) - RNSVG (7.2.1): - React - RNVectorIcons (8.1.0): - React-Core - - Sentry (5.1.10): - - Sentry/Core (= 5.1.10) - - Sentry/Core (5.1.10) + - Sentry (7.10.1): + - Sentry/Core (= 7.10.1) + - Sentry/Core (7.10.1) - Yoga (1.14.0) - YogaKit (1.18.1): - Yoga (~> 1.14) @@ -662,8 +662,8 @@ SPEC CHECKSUMS: react-native-ble-plx: f10240444452dfb2d2a13a0e4f58d7783e92d76e react-native-camera: 3eae183c1d111103963f3dd913b65d01aef8110f react-native-config: f2c2ae45625a068c35681a16b9bfb1ca58b0adc7 - react-native-haskell-shelley: d55169b653c4c8de7c30d4c8bc75e92bd89b4ac3 - react-native-netinfo: 0212ce8604e88edf686f1481b925b17a42a52449 + react-native-haskell-shelley: 508d0b6f88d14629ae6f28648a4425b202f73764 + react-native-netinfo: 129bd99f607a2dc5bb096168f3e5c150fd1f1c95 react-native-pager-view: b1914469643f40042e65d78cbf3d3dfebd6fb0d9 react-native-randombytes: b6677f7d495c27e9ee0dbd77ebc97b3c59173729 react-native-safe-area-context: 806f8370bf9fc9db90a3413aaa1aab0d2e22fdf3 @@ -688,12 +688,12 @@ SPEC CHECKSUMS: RNGestureHandler: 6e757e487a4834e7280e98e9bac66d2d9c575e9c RNKeychain: f75b8c8b2f17d3b2aa1f25b4a0ac5b83d947ff8f RNPermissions: 34d678157c800b25b22a488e4d8babb57456e796 - RNReanimated: e03f7425cb7a38dcf1b644d680d1bfc91c3337ad + RNReanimated: c1b56d030d1616239861534d9adb531f8cffab68 RNScreens: 3ba2198ca3179f77f6158425fc31ba3c90a0d49f - RNSentry: 0a70359ddacbfb9b1cbbb0971e54065b9f70ac57 + RNSentry: f8c14c77e400a93331b38538f735c2538f8108a8 RNSVG: 6c8e8c6f9e5a0caf910dd25aa6e4216045426e1d RNVectorIcons: 31cebfcf94e8cf8686eb5303ae0357da64d7a5a4 - Sentry: 8715e88b813bde9ad37aead365d5b04ac7302153 + Sentry: ddcd9fde63cfe7e9e2243da59d98daa382413e49 Yoga: 575c581c63e0d35c9a83f4b46d01d63abc1100ac YogaKit: f782866e155069a2cca2517aafea43200b01fd5a diff --git a/ios/emurgo.xcodeproj/project.pbxproj b/ios/emurgo.xcodeproj/project.pbxproj index 6e0370effa..54f021b5b7 100644 --- a/ios/emurgo.xcodeproj/project.pbxproj +++ b/ios/emurgo.xcodeproj/project.pbxproj @@ -67,67 +67,51 @@ ED297163215061F000B7C4FE /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED297162215061F000B7C4FE /* JavaScriptCore.framework */; }; ED2971652150620600B7C4FE /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED2971642150620600B7C4FE /* JavaScriptCore.framework */; }; FD40A530273610A800F751C1 /* Fontisto.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A520273610A800F751C1 /* Fontisto.ttf */; }; - FD40A531273610A800F751C1 /* Fontisto.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A520273610A800F751C1 /* Fontisto.ttf */; }; FD40A532273610A800F751C1 /* Fontisto.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A520273610A800F751C1 /* Fontisto.ttf */; }; FD40A533273610A800F751C1 /* Fontisto.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A520273610A800F751C1 /* Fontisto.ttf */; }; FD40A534273610A800F751C1 /* Octicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A521273610A800F751C1 /* Octicons.ttf */; }; - FD40A535273610A800F751C1 /* Octicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A521273610A800F751C1 /* Octicons.ttf */; }; FD40A536273610A800F751C1 /* Octicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A521273610A800F751C1 /* Octicons.ttf */; }; FD40A537273610A800F751C1 /* Octicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A521273610A800F751C1 /* Octicons.ttf */; }; FD40A538273610A800F751C1 /* Feather.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A522273610A800F751C1 /* Feather.ttf */; }; - FD40A539273610A800F751C1 /* Feather.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A522273610A800F751C1 /* Feather.ttf */; }; FD40A53A273610A800F751C1 /* Feather.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A522273610A800F751C1 /* Feather.ttf */; }; FD40A53B273610A800F751C1 /* Feather.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A522273610A800F751C1 /* Feather.ttf */; }; FD40A53C273610A800F751C1 /* Entypo.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A523273610A800F751C1 /* Entypo.ttf */; }; - FD40A53D273610A800F751C1 /* Entypo.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A523273610A800F751C1 /* Entypo.ttf */; }; FD40A53E273610A800F751C1 /* Entypo.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A523273610A800F751C1 /* Entypo.ttf */; }; FD40A53F273610A800F751C1 /* Entypo.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A523273610A800F751C1 /* Entypo.ttf */; }; FD40A540273610A800F751C1 /* FontAwesome5_Brands.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A524273610A800F751C1 /* FontAwesome5_Brands.ttf */; }; - FD40A541273610A800F751C1 /* FontAwesome5_Brands.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A524273610A800F751C1 /* FontAwesome5_Brands.ttf */; }; FD40A542273610A800F751C1 /* FontAwesome5_Brands.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A524273610A800F751C1 /* FontAwesome5_Brands.ttf */; }; FD40A543273610A800F751C1 /* FontAwesome5_Brands.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A524273610A800F751C1 /* FontAwesome5_Brands.ttf */; }; FD40A544273610A800F751C1 /* MaterialCommunityIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A525273610A800F751C1 /* MaterialCommunityIcons.ttf */; }; - FD40A545273610A800F751C1 /* MaterialCommunityIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A525273610A800F751C1 /* MaterialCommunityIcons.ttf */; }; FD40A546273610A800F751C1 /* MaterialCommunityIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A525273610A800F751C1 /* MaterialCommunityIcons.ttf */; }; FD40A547273610A800F751C1 /* MaterialCommunityIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A525273610A800F751C1 /* MaterialCommunityIcons.ttf */; }; FD40A548273610A800F751C1 /* AntDesign.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A526273610A800F751C1 /* AntDesign.ttf */; }; - FD40A549273610A800F751C1 /* AntDesign.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A526273610A800F751C1 /* AntDesign.ttf */; }; FD40A54A273610A800F751C1 /* AntDesign.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A526273610A800F751C1 /* AntDesign.ttf */; }; FD40A54B273610A800F751C1 /* AntDesign.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A526273610A800F751C1 /* AntDesign.ttf */; }; FD40A54C273610A800F751C1 /* Foundation.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A527273610A800F751C1 /* Foundation.ttf */; }; - FD40A54D273610A800F751C1 /* Foundation.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A527273610A800F751C1 /* Foundation.ttf */; }; FD40A54E273610A800F751C1 /* Foundation.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A527273610A800F751C1 /* Foundation.ttf */; }; FD40A54F273610A800F751C1 /* Foundation.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A527273610A800F751C1 /* Foundation.ttf */; }; FD40A550273610A800F751C1 /* Ionicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A528273610A800F751C1 /* Ionicons.ttf */; }; - FD40A551273610A800F751C1 /* Ionicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A528273610A800F751C1 /* Ionicons.ttf */; }; FD40A552273610A800F751C1 /* Ionicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A528273610A800F751C1 /* Ionicons.ttf */; }; FD40A553273610A800F751C1 /* Ionicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A528273610A800F751C1 /* Ionicons.ttf */; }; FD40A554273610A800F751C1 /* FontAwesome5_Solid.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A529273610A800F751C1 /* FontAwesome5_Solid.ttf */; }; - FD40A555273610A800F751C1 /* FontAwesome5_Solid.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A529273610A800F751C1 /* FontAwesome5_Solid.ttf */; }; FD40A556273610A800F751C1 /* FontAwesome5_Solid.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A529273610A800F751C1 /* FontAwesome5_Solid.ttf */; }; FD40A557273610A800F751C1 /* FontAwesome5_Solid.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A529273610A800F751C1 /* FontAwesome5_Solid.ttf */; }; FD40A558273610A800F751C1 /* FontAwesome5_Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A52A273610A800F751C1 /* FontAwesome5_Regular.ttf */; }; - FD40A559273610A800F751C1 /* FontAwesome5_Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A52A273610A800F751C1 /* FontAwesome5_Regular.ttf */; }; FD40A55A273610A800F751C1 /* FontAwesome5_Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A52A273610A800F751C1 /* FontAwesome5_Regular.ttf */; }; FD40A55B273610A800F751C1 /* FontAwesome5_Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A52A273610A800F751C1 /* FontAwesome5_Regular.ttf */; }; FD40A55C273610A800F751C1 /* FontAwesome.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A52B273610A800F751C1 /* FontAwesome.ttf */; }; - FD40A55D273610A800F751C1 /* FontAwesome.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A52B273610A800F751C1 /* FontAwesome.ttf */; }; FD40A55E273610A800F751C1 /* FontAwesome.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A52B273610A800F751C1 /* FontAwesome.ttf */; }; FD40A55F273610A800F751C1 /* FontAwesome.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A52B273610A800F751C1 /* FontAwesome.ttf */; }; FD40A560273610A800F751C1 /* Zocial.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A52C273610A800F751C1 /* Zocial.ttf */; }; - FD40A561273610A800F751C1 /* Zocial.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A52C273610A800F751C1 /* Zocial.ttf */; }; FD40A562273610A900F751C1 /* Zocial.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A52C273610A800F751C1 /* Zocial.ttf */; }; FD40A563273610A900F751C1 /* Zocial.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A52C273610A800F751C1 /* Zocial.ttf */; }; FD40A564273610A900F751C1 /* EvilIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A52D273610A800F751C1 /* EvilIcons.ttf */; }; - FD40A565273610A900F751C1 /* EvilIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A52D273610A800F751C1 /* EvilIcons.ttf */; }; FD40A566273610A900F751C1 /* EvilIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A52D273610A800F751C1 /* EvilIcons.ttf */; }; FD40A567273610A900F751C1 /* EvilIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A52D273610A800F751C1 /* EvilIcons.ttf */; }; FD40A568273610A900F751C1 /* SimpleLineIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A52E273610A800F751C1 /* SimpleLineIcons.ttf */; }; - FD40A569273610A900F751C1 /* SimpleLineIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A52E273610A800F751C1 /* SimpleLineIcons.ttf */; }; FD40A56A273610A900F751C1 /* SimpleLineIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A52E273610A800F751C1 /* SimpleLineIcons.ttf */; }; FD40A56B273610A900F751C1 /* SimpleLineIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A52E273610A800F751C1 /* SimpleLineIcons.ttf */; }; FD40A56C273610A900F751C1 /* MaterialIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A52F273610A800F751C1 /* MaterialIcons.ttf */; }; - FD40A56D273610A900F751C1 /* MaterialIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A52F273610A800F751C1 /* MaterialIcons.ttf */; }; FD40A56E273610A900F751C1 /* MaterialIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A52F273610A800F751C1 /* MaterialIcons.ttf */; }; FD40A56F273610A900F751C1 /* MaterialIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD40A52F273610A800F751C1 /* MaterialIcons.ttf */; }; /* End PBXBuildFile section */ @@ -668,32 +652,16 @@ files = ( E99D542D2629F2AA008C6667 /* Rubik-Bold.ttf in Resources */, E99D542E2629F2AA008C6667 /* Rubik-BoldItalic.ttf in Resources */, - FD40A555273610A800F751C1 /* FontAwesome5_Solid.ttf in Resources */, - FD40A551273610A800F751C1 /* Ionicons.ttf in Resources */, - FD40A561273610A800F751C1 /* Zocial.ttf in Resources */, - FD40A569273610A900F751C1 /* SimpleLineIcons.ttf in Resources */, E99D542F2629F2AA008C6667 /* Rubik-Italic.ttf in Resources */, - FD40A541273610A800F751C1 /* FontAwesome5_Brands.ttf in Resources */, - FD40A565273610A900F751C1 /* EvilIcons.ttf in Resources */, E99D54302629F2AA008C6667 /* Rubik-Light.ttf in Resources */, E99D54312629F2AA008C6667 /* Rubik-LightItalic.ttf in Resources */, E99D54322629F2AA008C6667 /* Rubik-Medium.ttf in Resources */, - FD40A539273610A800F751C1 /* Feather.ttf in Resources */, - FD40A531273610A800F751C1 /* Fontisto.ttf in Resources */, E99D54332629F2AA008C6667 /* Rubik-MediumItalic.ttf in Resources */, E99D54342629F2AA008C6667 /* Rubik-Regular.ttf in Resources */, E99D54352629F2AA008C6667 /* Rubik-SemiBold.ttf in Resources */, - FD40A535273610A800F751C1 /* Octicons.ttf in Resources */, - FD40A56D273610A900F751C1 /* MaterialIcons.ttf in Resources */, E99D54362629F2AA008C6667 /* Rubik-SemiBoldItalic.ttf in Resources */, - FD40A55D273610A800F751C1 /* FontAwesome.ttf in Resources */, - FD40A549273610A800F751C1 /* AntDesign.ttf in Resources */, - FD40A54D273610A800F751C1 /* Foundation.ttf in Resources */, - FD40A559273610A800F751C1 /* FontAwesome5_Regular.ttf in Resources */, E9204857261D020F00AF9D45 /* LaunchScreen.storyboard in Resources */, - FD40A545273610A800F751C1 /* MaterialCommunityIcons.ttf in Resources */, 2E3E7CF72298ACEA00D5C487 /* Images.xcassets in Resources */, - FD40A53D273610A800F751C1 /* Entypo.ttf in Resources */, 2E3E7CF82298ACEA00D5C487 /* InfoPlist.strings in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -749,7 +717,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "export DEVELOPMENT_BUILD_CONFIGURATIONS=\"+(Staging.Debug|Debug)\"\nexport NODE_BINARY=node\n../node_modules/react-native-schemes-manager/lib/react-native-xcode.sh index.ts\n"; + shellScript = "export EXTRA_PACKAGER_ARGS=\"--sourcemap-output $DERIVED_FILE_DIR/main.jsbundle.map\"\nexport SENTRY_PROPERTIES=../sentry.properties\n\nexport DEVELOPMENT_BUILD_CONFIGURATIONS=\"+(Staging.Debug|Debug)\"\nexport NODE_BINARY=node\n\n../node_modules/react-native-schemes-manager/lib/react-native-xcode.sh index.ts\n"; }; 226AFA2910D45B200EB23E8C /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; @@ -813,7 +781,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "export DEVELOPMENT_BUILD_CONFIGURATIONS=\"+(Staging.Debug|Debug)\"\nexport NODE_BINARY=node\n../node_modules/react-native-schemes-manager/lib/react-native-xcode.sh index.ts\n"; + shellScript = "export EXTRA_PACKAGER_ARGS=\"--sourcemap-output $DERIVED_FILE_DIR/main.jsbundle.map\"\nexport SENTRY_PROPERTIES=../sentry.properties\n\nexport DEVELOPMENT_BUILD_CONFIGURATIONS=\"+(Staging.Debug|Debug)\"\nexport NODE_BINARY=node\n\n../node_modules/react-native-schemes-manager/lib/react-native-xcode.sh index.ts\n"; }; 43965AA0A5088B5CB3E68D00 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; @@ -1097,7 +1065,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "export DEVELOPMENT_BUILD_CONFIGURATIONS=\"+(Staging.Debug|Debug)\"\nexport NODE_BINARY=node\n../node_modules/react-native-schemes-manager/lib/react-native-xcode.sh index.ts\n"; + shellScript = "export EXTRA_PACKAGER_ARGS=\"--sourcemap-output $DERIVED_FILE_DIR/main.jsbundle.map\"\nexport SENTRY_PROPERTIES=../sentry.properties\n\nexport DEVELOPMENT_BUILD_CONFIGURATIONS=\"+(Staging.Debug|Debug)\"\nexport NODE_BINARY=node\n\n../node_modules/react-native-schemes-manager/lib/react-native-xcode.sh index.ts\n"; }; EDA2533F12CEB073CB734C81 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; @@ -1345,7 +1313,7 @@ BUNDLE_ID_SUFFIX = ""; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 401; + CURRENT_PROJECT_VERSION = 402; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = F8NVT2G2L4; ENABLE_BITCODE = NO; @@ -1369,7 +1337,7 @@ INFOPLIST_PREPROCESS = NO; IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 4.7.17; + MARKETING_VERSION = 4.8.0; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -1395,7 +1363,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 401; + CURRENT_PROJECT_VERSION = 402; DEVELOPMENT_TEAM = F8NVT2G2L4; ENABLE_BITCODE = NO; HEADER_SEARCH_PATHS = ( @@ -1418,7 +1386,7 @@ INFOPLIST_PREPROCESS = NO; IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 4.7.17; + MARKETING_VERSION = 4.8.0; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -1441,7 +1409,7 @@ BUNDLE_DISPLAY_NAME = Yoroi; BUNDLE_ID_SUFFIX = ""; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 401; + CURRENT_PROJECT_VERSION = 402; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = F8NVT2G2L4; ENABLE_BITCODE = NO; @@ -1469,7 +1437,7 @@ "$(inherited)", "\"$(SRCROOT)/$(TARGET_NAME)\"", ); - MARKETING_VERSION = 4.7.17; + MARKETING_VERSION = 4.8.0; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -1492,7 +1460,7 @@ BUNDLE_DISPLAY_NAME = "Yoroi Staging"; BUNDLE_ID_SUFFIX = .staging; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 401; + CURRENT_PROJECT_VERSION = 402; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = F8NVT2G2L4; ENABLE_BITCODE = NO; @@ -1520,7 +1488,7 @@ "$(inherited)", "\"$(SRCROOT)/$(TARGET_NAME)\"", ); - MARKETING_VERSION = 4.7.17; + MARKETING_VERSION = 4.8.0; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -1545,7 +1513,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 401; + CURRENT_PROJECT_VERSION = 402; DEVELOPMENT_TEAM = ""; ENABLE_BITCODE = NO; HEADER_SEARCH_PATHS = ( @@ -1572,7 +1540,7 @@ "$(inherited)", "\"$(SRCROOT)/$(TARGET_NAME)\"", ); - MARKETING_VERSION = 4.7.17; + MARKETING_VERSION = 4.8.0; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -1595,7 +1563,7 @@ BUNDLE_DISPLAY_NAME = "Yoroi Staging"; BUNDLE_ID_SUFFIX = .staging; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 401; + CURRENT_PROJECT_VERSION = 402; DEVELOPMENT_TEAM = F8NVT2G2L4; ENABLE_BITCODE = NO; HEADER_SEARCH_PATHS = ( @@ -1622,7 +1590,7 @@ "$(inherited)", "\"$(SRCROOT)/$(TARGET_NAME)\"", ); - MARKETING_VERSION = 4.7.17; + MARKETING_VERSION = 4.8.0; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -1831,7 +1799,7 @@ BUNDLE_ID_SUFFIX = .staging; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 401; + CURRENT_PROJECT_VERSION = 402; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = F8NVT2G2L4; ENABLE_BITCODE = NO; @@ -1855,7 +1823,7 @@ INFOPLIST_PREPROCESS = NO; IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 4.7.17; + MARKETING_VERSION = 4.8.0; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -1979,7 +1947,7 @@ BUNDLE_ID_SUFFIX = .staging; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 401; + CURRENT_PROJECT_VERSION = 402; DEVELOPMENT_TEAM = F8NVT2G2L4; ENABLE_BITCODE = NO; HEADER_SEARCH_PATHS = ( @@ -2002,7 +1970,7 @@ INFOPLIST_PREPROCESS = NO; IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 4.7.17; + MARKETING_VERSION = 4.8.0; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -2064,7 +2032,7 @@ BUNDLE_ID_SUFFIX = ""; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 401; + CURRENT_PROJECT_VERSION = 402; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = F8NVT2G2L4; ENABLE_BITCODE = NO; @@ -2088,7 +2056,7 @@ INFOPLIST_PREPROCESS = NO; IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 4.7.17; + MARKETING_VERSION = 4.8.0; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -2113,7 +2081,7 @@ BUNDLE_ID_SUFFIX = .staging; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 401; + CURRENT_PROJECT_VERSION = 402; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = F8NVT2G2L4; ENABLE_BITCODE = NO; @@ -2137,7 +2105,7 @@ INFOPLIST_PREPROCESS = NO; IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 4.7.17; + MARKETING_VERSION = 4.8.0; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -2163,7 +2131,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 401; + CURRENT_PROJECT_VERSION = 402; DEVELOPMENT_TEAM = F8NVT2G2L4; ENABLE_BITCODE = NO; HEADER_SEARCH_PATHS = ( @@ -2186,7 +2154,7 @@ INFOPLIST_PREPROCESS = NO; IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 4.7.17; + MARKETING_VERSION = 4.8.0; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -2210,7 +2178,7 @@ BUNDLE_ID_SUFFIX = .staging; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 401; + CURRENT_PROJECT_VERSION = 402; DEVELOPMENT_TEAM = F8NVT2G2L4; ENABLE_BITCODE = NO; HEADER_SEARCH_PATHS = ( @@ -2233,7 +2201,7 @@ INFOPLIST_PREPROCESS = NO; IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 4.7.17; + MARKETING_VERSION = 4.8.0; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", diff --git a/ios/fastlane/Appfile b/ios/fastlane/Appfile index dcdef2270e..5acbae266b 100644 --- a/ios/fastlane/Appfile +++ b/ios/fastlane/Appfile @@ -1,8 +1,8 @@ # For production builds: -# app_identifier("com.emurgo.yoroi") # The bundle identifier of your app +app_identifier("com.emurgo.yoroi") # The bundle identifier of your app # For nightly: -app_identifier("com.emurgo.yoroi-nightly") +# app_identifier("com.emurgo.yoroi-nightly") apple_id("juliano@emurgo.io") # Your Apple email address diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile index 9ab1be3c2a..6a5ffc739f 100644 --- a/ios/fastlane/Fastfile +++ b/ios/fastlane/Fastfile @@ -45,7 +45,7 @@ platform :ios do # increment_build_number(xcodeproj: "emurgo.xcodeproj") build_app(workspace: "emurgo.xcworkspace", scheme: "emurgo-nightly") - # upload_to_testflight(skip_submission: true, skip_waiting_for_build_processing: true) + upload_to_testflight(skip_submission: true, skip_waiting_for_build_processing: true) end desc "Push a new mainnet build to TestFlight" diff --git a/jest.config.js b/jest.config.js deleted file mode 100644 index bf266ccfe2..0000000000 --- a/jest.config.js +++ /dev/null @@ -1,6 +0,0 @@ -// @flow - -module.exports = { - preset: 'react-native', - moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], -} diff --git a/jestSetup.ts b/jestSetup.ts new file mode 100644 index 0000000000..0818efb794 --- /dev/null +++ b/jestSetup.ts @@ -0,0 +1,33 @@ +/* eslint-env jest */ +/* This module sets up Jest */ +import 'react-native-gesture-handler/jestSetup' + +import fetch from 'node-fetch' + +import {Logger, LogLevel} from './src/legacy/logging' + +global.fetch = fetch +Logger.setLogLevel(LogLevel.Warn) + +jest.mock('react-native-device-info', () => ({getVersion: () => '1.5.1'})) +jest.mock('react-native-randombytes', () => require('crypto').randomBytes) +jest.mock('react-native-background-timer', () => {}) +jest.mock('@sentry/react-native', () => ({init: () => jest.fn()})) +jest.mock('@react-native-community/netinfo', () => require('@react-native-community/netinfo/jest/netinfo-mock.js')) +jest.mock('@ledgerhq/react-native-hw-transport-ble', () => ({})) +jest.mock('react-native-ble-plx', () => ({})) +jest.mock('@react-native-async-storage/async-storage', () => + require('@react-native-async-storage/async-storage/jest/async-storage-mock'), +) +jest.mock('react-native-keychain', () => {}) +jest.mock('react-native-blockies-svg', () => {}) + +jest.mock('react-native-reanimated', () => { + const Reanimated = require('react-native-reanimated/mock') + + // The mock for `call` immediately calls the callback which is incorrect + // So we override it with a no-op + Reanimated.default.call = () => {} + return Reanimated +}) +jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper') diff --git a/legacy/.eslintrc.js b/legacy/.eslintrc.js deleted file mode 100644 index 67997f3aeb..0000000000 --- a/legacy/.eslintrc.js +++ /dev/null @@ -1,50 +0,0 @@ -// @flow - -module.exports = { - extends: [ - 'eslint:recommended', - 'plugin:react/recommended', - 'plugin:react-hooks/recommended', - 'plugin:flowtype/recommended', - 'plugin:react-prefer-function-component/recommended', - 'prettier', // keep this last - ], - plugins: ['react', 'react-native', 'flowtype', 'react-prefer-function-component', 'eslint-plugin-simple-import-sort'], - env: {'react-native/react-native': true}, - settings: { - 'import/resolver': {node: {extensions: ['.js', '.android.js', '.ios.js', '.json']}}, - react: {version: 'detect'}, - }, - rules: { - 'array-callback-return': 2, - 'flowtype/newline-after-flow-annotation': [2, 'always'], - 'flowtype/require-valid-file-annotation': [2, 'always'], - 'lines-between-class-members': [1, 'always', {exceptAfterSingleLine: true}], - 'no-multiple-empty-lines': ['warn', {max: 2, maxEOF: 0}], - 'no-unused-vars': ['warn', {argsIgnorePattern: '^_'}], - 'react-native/no-raw-text': ['error', {skip: ['Markdown']}], - 'react-native/no-unused-styles': 2, - 'react-native/split-platform-components': 0, - 'react/display-name': 0, - 'react/no-access-state-in-setstate': 2, - 'react/no-typos': 2, - 'react/sort-comp': [2, {order: ['instance-variables', 'lifecycle', 'everything-else', 'render']}], - 'simple-import-sort/exports': 'error', - 'simple-import-sort/imports': 'error', - 'spaced-comment': 1, - }, - globals: { - Buffer: false, - Symbol: false, - Uint8Array: false, - TextEncoder: false, - $Call: false, - $Values: false, - test: false, - expect: false, - describe: false, - it: false, - beforeEach: false, - React$Node: false, - }, -} diff --git a/legacy/actions/hwWallet.js b/legacy/actions/hwWallet.js deleted file mode 100644 index 8b8d2b054c..0000000000 --- a/legacy/actions/hwWallet.js +++ /dev/null @@ -1,59 +0,0 @@ -// @flow - -import type {Dispatch} from 'redux' - -import type {DeviceId, DeviceObj, HWDeviceInfo} from '../crypto/shelley/ledgerUtils' -import {NoDeviceInfoError} from '../crypto/shelley/ledgerUtils' -import walletManager from '../crypto/walletManager' -import {hwDeviceInfoSelector} from '../selectors' -import type {State} from '../state' -import {Logger} from '../utils/logging' - -const _saveHW = (hwDeviceInfo) => ({ - path: ['wallet', 'hwDeviceInfo'], - payload: hwDeviceInfo, - reducer: (state, value) => value, - type: 'SAVE_HW', -}) - -export const saveHW = (hwDeviceInfo: HWDeviceInfo) => (dispatch: Dispatch) => { - dispatch(_saveHW(hwDeviceInfo)) -} - -export const setLedgerDeviceId = (deviceId: DeviceId) => async (dispatch: Dispatch, getState: () => State) => { - Logger.debug('setting deviceId', deviceId) - const state = getState() - const hwDeviceInfo = hwDeviceInfoSelector(state) - if (hwDeviceInfo == null || hwDeviceInfo.hwFeatures == null) { - throw new NoDeviceInfoError() - } - const updatedInfo = { - ...hwDeviceInfo, - hwFeatures: { - ...hwDeviceInfo.hwFeatures, - deviceId, - }, - } - Logger.debug('updating hwDeviceInfo', updatedInfo) - // saved in redux state internally through notify() - await walletManager.updateHWDeviceInfo(updatedInfo) -} - -export const setLedgerDeviceObj = (deviceObj: DeviceObj) => async (dispatch: Dispatch, getState: () => State) => { - Logger.debug('setting deviceObj', deviceObj) - const state = getState() - const hwDeviceInfo = hwDeviceInfoSelector(state) - if (hwDeviceInfo == null || hwDeviceInfo.hwFeatures == null) { - throw new NoDeviceInfoError() - } - const updatedInfo = { - ...hwDeviceInfo, - hwFeatures: { - ...hwDeviceInfo.hwFeatures, - deviceObj, - }, - } - Logger.debug('updating hwDeviceInfo', updatedInfo) - // saved in redux state internally through notify() - await walletManager.updateHWDeviceInfo(updatedInfo) -} diff --git a/legacy/actions/language.js b/legacy/actions/language.js deleted file mode 100644 index 04875ab667..0000000000 --- a/legacy/actions/language.js +++ /dev/null @@ -1,27 +0,0 @@ -// @flow - -import {type Dispatch} from 'redux' - -import {APP_SETTINGS_KEYS, writeAppSettings} from '../helpers/appSettings' -import {setLanguage} from '../i18n' - -export const changeLanguage = (languageCode: string) => (dispatch: Dispatch) => { - setLanguage(languageCode) - dispatch({ - path: ['appSettings', 'languageCode'], - payload: languageCode, - reducer: (state, languageCode) => languageCode, - type: 'CHANGE_LANGUAGE', - }) -} - -export const changeAndSaveLanguage = (languageCode: string) => async (dispatch: Dispatch) => { - await writeAppSettings(APP_SETTINGS_KEYS.LANG, languageCode) - - dispatch(changeLanguage(languageCode)) -} - -export default { - changeAndSaveLanguage, - changeLanguage, -} diff --git a/legacy/actions/pools.js b/legacy/actions/pools.js deleted file mode 100644 index 36859f11ae..0000000000 --- a/legacy/actions/pools.js +++ /dev/null @@ -1,80 +0,0 @@ -// @flow - -import type {Dispatch} from 'redux' - -import type {PoolInfoRequest, PoolInfoResponse} from '../api/types' -import walletManager from '../crypto/walletManager' -import type {State} from '../state' -import {Logger} from '../utils/logging' - -const _startFetching = () => ({ - type: 'START_FETCHING_POOL_INFO', - path: ['poolInfo', 'isFetching'], - payload: null, - reducer: (_state, _isFetching) => true, -}) - -const _endFetching = () => ({ - type: 'END_FETCHING_POOL_INFO', - path: ['poolInfo', 'isFetching'], - payload: null, - reducer: (_state, _isFetching) => false, -}) - -const _setPoolInfo = (poolInfo) => ({ - type: 'SET_POOL_INFO', - path: ['poolInfo', 'meta'], - payload: poolInfo, - reducer: (state, value) => value, -}) - -const _clearPoolInfo = () => ({ - type: 'CLEAR_POOL_INFO', - path: ['poolInfo'], - payload: null, - reducer: (_state) => { - return { - isFetching: false, - lastFetchingError: null, - meta: null, - } - }, -}) - -const _setLastError = (error) => ({ - type: 'SET_LAST_FETCHING_ERROR', - path: ['poolInfo', 'lastFetchingError'], - payload: error, - reducer: (state, error) => error, -}) - -export const fetchPoolInfo = () => async (dispatch: Dispatch, getState: () => State) => { - if (getState().poolInfo.isFetching) { - return - } else if (getState().accountState.poolOperator == null) { - dispatch(_clearPoolInfo()) - return - } - dispatch(_clearPoolInfo()) - dispatch(_startFetching()) - try { - const poolOperator = getState().accountState.poolOperator - if (poolOperator == null) { - throw new Error('fetchPoolInfo::poolOperator is null, should never happen') - } - const poolInfoResp: PoolInfoResponse = await walletManager.fetchPoolInfo( - ({ - poolIds: [poolOperator], - }: PoolInfoRequest), - ) - const poolInfo = Object.keys(poolInfoResp).map((key) => poolInfoResp[key])[0] - if (poolInfo.error != null) throw new Error(poolInfo.error) - dispatch(_setPoolInfo(poolInfo)) - dispatch(_setLastError(null)) - } catch (err) { - Logger.warn(err) - dispatch(_setLastError(err)) - } finally { - dispatch(_endFetching()) - } -} diff --git a/legacy/actions/tokenInfo.js b/legacy/actions/tokenInfo.js deleted file mode 100644 index c16c2dcbda..0000000000 --- a/legacy/actions/tokenInfo.js +++ /dev/null @@ -1,95 +0,0 @@ -// @flow - -import type {Dispatch} from 'redux' - -import type {TokenInfoRequest, TokenInfoResponse} from '../api/types' -import type {MultiToken} from '../crypto/MultiToken' -import walletManager from '../crypto/walletManager' -import {availableAssetsSelector, tokenBalanceSelector} from '../selectors' -import type {State} from '../state' -import type {Token} from '../types/HistoryTransaction' -import {ObjectValues} from '../utils/flow' -import {Logger} from '../utils/logging' - -const _startFetching = () => ({ - type: 'START_FETCHING_TOKEN_INFO', - path: ['tokenInfo', 'isFetching'], - payload: null, - reducer: (_state, _isFetching) => true, -}) - -const _endFetching = () => ({ - type: 'END_FETCHING_TOKEN_INFO', - path: ['tokenInfo', 'isFetching'], - payload: null, - reducer: (_state, _isFetching) => false, -}) - -const _setTokenInfo = (tokenInfo) => ({ - type: 'SET_TOKEN_INFO', - path: ['tokenInfo', 'tokens'], - payload: tokenInfo, - reducer: (state, value) => value, -}) - -const _setLastError = (error) => ({ - type: 'SET_LAST_FETCHING_ERROR', - path: ['tokenInfo', 'lastFetchingError'], - payload: error, - reducer: (state, error) => error, -}) - -export const fetchTokenInfo = () => async (dispatch: Dispatch, getState: () => State) => { - const state = getState() - if (state.tokenInfo.isFetching) { - return - } - dispatch(_setTokenInfo(availableAssetsSelector(state))) - dispatch(_startFetching()) - try { - const availableAssets: Dict = availableAssetsSelector(state) - const assetsBalance: MultiToken = tokenBalanceSelector(state) - - // subject -> identifier - const subjectDict = ObjectValues(availableAssets) - .filter((asset) => { - const assetValue = assetsBalance.get(asset.identifier) - return assetValue && assetValue.gt(0) - }) - .reduce((acc, curr: Token): Dict => { - if (curr.identifier === '') return acc - acc[`${curr.metadata.policyId}${curr.metadata.assetName}`] = curr.identifier - return acc - }, ({}: Dict)) - - const tokenIds = Object.keys(subjectDict) - const tokenInfo: TokenInfoResponse = await walletManager.fetchTokenInfo( - ({ - tokenIds, - }: TokenInfoRequest), - ) - - const tokens = {...availableAssets} - for (const key of Object.keys(tokenInfo)) { - const _token = tokens[subjectDict[key]] - const newInfo = tokenInfo[key] - if (newInfo == null) continue - tokens[subjectDict[key]] = { - ..._token, - metadata: { - ..._token.metadata, - longName: newInfo.name || null, - numberOfDecimals: newInfo.decimals || 0, - }, - } - } - Logger.info('saving token info in state....', tokens) - dispatch(_setTokenInfo(tokens)) - dispatch(_setLastError(null)) - } catch (err) { - Logger.warn('actions:tokenInfo::fetchTokenInfo', err) - dispatch(_setLastError(err)) - } finally { - dispatch(_endFetching()) - } -} diff --git a/legacy/actions/voting.js b/legacy/actions/voting.js deleted file mode 100644 index 510c668628..0000000000 --- a/legacy/actions/voting.js +++ /dev/null @@ -1,83 +0,0 @@ -// @flow - -import cryptoRandomString from 'crypto-random-string' -import type {Dispatch} from 'redux' - -import {fetchUTXOs} from '../actions/utxo' -import {CONFIG} from '../config/config' -import {encryptWithPassword} from '../crypto/catalystCipher' -import {generatePrivateKeyForCatalyst} from '../crypto/shelley/catalystUtils' -import walletManager from '../crypto/walletManager' -import {utxosSelector} from '../selectors' -import type {State} from '../state' -import {Logger} from '../utils/logging' - -const _setCatalystKeys = (voting) => ({ - type: 'SET_CATALYST_KEYS', - path: ['voting'], - payload: voting, - reducer: (state, value) => value, -}) - -const _setUnsignedTx = (unsignedTx) => ({ - type: 'SET_CATALYST_TX', - path: ['voting', 'unsignedTx'], - payload: unsignedTx, - reducer: (state, value) => value, -}) - -export const generateVotingKeys = () => async (dispatch: Dispatch, _getState: () => State) => { - Logger.debug('voting actions::generateVotingKeys') - let pin - if (CONFIG.DEBUG.PREFILL_FORMS) { - if (!__DEV__) throw new Error('using debug data in non-dev env') - pin = CONFIG.DEBUG.CATALYST_PIN - } else { - pin = cryptoRandomString({length: 4, type: 'numeric'}) - } - - const pinArray = pin.split('').map(Number) - - const passBuff = Buffer.from(pinArray) - const rootKey = await generatePrivateKeyForCatalyst() - const catalystEncryptedPrivateKey = await encryptWithPassword(passBuff, await (await rootKey.to_raw_key()).as_bytes()) - - await dispatch( - _setCatalystKeys({ - pin: pinArray, - encryptedKey: catalystEncryptedPrivateKey, - catalystPrivateKey: Buffer.from(await (await rootKey.to_raw_key()).as_bytes()).toString('hex'), - }), - ) - Logger.debug('voting actions::generateVotingKeys: success') -} - -export const generateVotingTransaction = - (decryptedKey: string | void) => async (dispatch: Dispatch, getState: () => State) => { - Logger.debug('voting actions::generateVotingTransaction') - const catalystPrivateKey: ?string = getState().voting.catalystPrivateKey - const serverTime: Date | void = getState().serverStatus.serverTime - let utxos = utxosSelector(getState()) - if (utxos == null) { - try { - await dispatch(fetchUTXOs()) - utxos = utxosSelector(getState()) - } catch (_e) { - Logger.debug('voting actions::generateVotingTransaction: could not get utxos') - dispatch(_setUnsignedTx(null)) - } - } - utxos = utxosSelector(getState()) - if (utxos == null) { - throw new Error('voting actions::generateVotingTransaction: failed to fetch utxos') - } - - if (catalystPrivateKey) { - const signRequest = await walletManager.createVotingRegTx(utxos, catalystPrivateKey, decryptedKey, serverTime) - dispatch(_setUnsignedTx(signRequest)) - Logger.debug('voting actions::generateVotingTransaction: success') - } else { - // should never happen - throw new Error('Catalyst private key empty, should never happen') - } - } diff --git a/legacy/api/fetch.js b/legacy/api/fetch.js deleted file mode 100644 index aa7918daae..0000000000 --- a/legacy/api/fetch.js +++ /dev/null @@ -1,99 +0,0 @@ -// @flow - -import {Platform} from 'react-native' -import DeviceInfo from 'react-native-device-info' - -import type {BackendConfig} from '../config/types' -import {Logger} from '../utils/logging' -import {ApiError, ApiHistoryError, NetworkError} from './errors' - -type RequestMethod = 'POST' | 'GET' - -const _checkResponse = async (rawResponse: Object, requestPayload: Object) => { - let responseBody = {} - try { - responseBody = await rawResponse.json() - } catch (_e) { - throw new ApiError('unexpected server response') - } - const status = rawResponse.status - if (status !== 200) { - const resp = responseBody.error?.response - if ( - resp === 'REFERENCE_TX_NOT_FOUND' || - resp === 'REFERENCE_BLOCK_MISMATCH' || - resp === 'REFERENCE_BEST_BLOCK_MISMATCH' - ) { - throw new ApiHistoryError(responseBody.error.response) - } - Logger.debug('Bad status code from server', status) - Logger.debug('Request payload:', requestPayload) - Logger.info('response', responseBody) - throw new ApiError(responseBody.error?.response) - } - return responseBody -} - -type FetchRequest = {| - endpoint: string, - payload: any, - method: RequestMethod, - checkResponse?: (Object, Object) => Promise, - headers?: Dict, -|} -export const checkedFetch = (request: FetchRequest) => { - const {endpoint, payload, method, headers} = request - const checkResponse = request.checkResponse || _checkResponse - - Logger.info(`API call: ${endpoint}`) - return ( - fetch(endpoint, { - method, - headers: headers != null ? headers : undefined, - body: payload != null ? JSON.stringify(payload) : undefined, - }) - // Fetch throws only for network/dns/related errors, not http statuses - .catch((e) => { - Logger.info(`API call ${endpoint} failed`, e) - /* It really is TypeError according to - https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch - */ - if (e instanceof TypeError) { - throw new NetworkError() - } - throw e - }) - .then(async (r) => { - Logger.info(`API call ${endpoint} finished`) - const response = await checkResponse(r, payload) - // Logger.debug('Response:', response) - return response - }) - ) -} - -export const fetchDefault = ( - path: string, - payload: any, - networkConfig: BackendConfig, - method?: RequestMethod = 'POST', -) => { - const fullPath = `${networkConfig.API_ROOT}/${path}` - const platform = Platform.OS === 'android' || Platform.OS === 'ios' ? Platform.OS : '-' - const yoroiVersion = `${platform} / ${DeviceInfo.getVersion()}` - const headers = { - 'Content-Type': 'application/json; charset=utf-8', - 'yoroi-version': yoroiVersion, - 'tangata-manu': 'yoroi', - } - const request = { - endpoint: fullPath, - payload, - method, - checkResponse: _checkResponse, - headers, - } - return checkedFetch(request) -} - -export default fetchDefault diff --git a/legacy/api/shelley/__snapshots__/api.test.js.snap b/legacy/api/shelley/__snapshots__/api.test.js.snap deleted file mode 100644 index e20defa6dc..0000000000 --- a/legacy/api/shelley/__snapshots__/api.test.js.snap +++ /dev/null @@ -1,38 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`History API can fetch history 1`] = ` -Object { - "blockHash": "008a32c2b852aefdf9077bcb471492c3303c88d64d281f7aa6ebf2e87ba63e34", - "blockNum": Any, - "certificates": Array [], - "epoch": 87, - "fee": "169884", - "id": "2401257195a3cd7d43e832b2d2e8215828ebbcdea472ef81f8de3314a535813e", - "inputs": Array [ - Object { - "address": "DdzFFzCqrhstJ7CLwbESFGX73gJw9inpvFnQjDn9QCpEXPUBdsw5NGHJnvwPB9Vkx6Jf6JPiWh9JQqwV9RDMfec3RSD968vWLwTNwRKE", - "amount": "91951210", - "assets": Array [], - }, - ], - "lastUpdatedAt": Any, - "outputs": Array [ - Object { - "address": "Ae2tdPwUPEZKAx4zt8YLTGxrhX9L6R8QPWNeefZsPgwaigWab4mEw1ECUZ7", - "amount": "5000000", - "assets": Array [], - }, - Object { - "address": "DdzFFzCqrht3ZCWKPX3a1vHCjrhASfxdXMhdtus6eUcPhnB4o8pPdbggnuCM8dCyPhFnBtszUHkd8wtT4NVqEeypyTAiP2btobSNYC46", - "amount": "86781326", - "assets": Array [], - }, - ], - "slot": 11945, - "status": "Successful", - "submittedAt": Any, - "txOrdinal": 0, - "type": "byron", - "withdrawals": Array [], -} -`; diff --git a/legacy/api/shelley/api.test.js b/legacy/api/shelley/api.test.js deleted file mode 100644 index ef8c30383f..0000000000 --- a/legacy/api/shelley/api.test.js +++ /dev/null @@ -1,116 +0,0 @@ -// @flow - -/* eslint-env jest */ -import {getCardanoNetworkConfigById, NETWORKS} from '../../config/networks' -import jestSetup from '../../jestSetup' -import {ApiError, ApiHistoryError} from '../errors' -import * as api from './api' - -jestSetup.setup() -jest.setTimeout(30 * 1000) - -const networkConfig = getCardanoNetworkConfigById(NETWORKS.HASKELL_SHELLEY.NETWORK_ID) -const backendConfig = networkConfig.BACKEND - -describe('History API', () => { - it('can fetch history', async () => { - const bestBlock = await api.getBestBlock(backendConfig) - const addresses = ['Ae2tdPwUPEZKAx4zt8YLTGxrhX9L6R8QPWNeefZsPgwaigWab4mEw1ECUZ7'] - const request = { - addresses, - untilBlock: bestBlock.hash != null ? bestBlock.hash : '', - } - - // We are async - expect.assertions(1) - const result = await api.fetchNewTxHistory(request, backendConfig) - - expect(result.transactions[0]).toMatchSnapshot({ - blockNum: expect.any(Number), - lastUpdatedAt: expect.any(String), // these fields may change (e.g. after restarting a node) - submittedAt: expect.any(String), - }) - }) - - it('throws ApiError on bad request', async () => { - const addresses = [] - const request = { - addresses, - untilBlock: '', - } - - // We are async - expect.assertions(1) - - await expect(api.fetchNewTxHistory(request, backendConfig)).rejects.toThrow(ApiError) - }) - - it('throws ApiHistoryError on bad request', async () => { - const addresses = ['Ae2tdPwUPEZKAx4zt8YLTGxrhX9L6R8QPWNeefZsPgwaigWab4mEw1ECUZ7'] - const request = { - addresses, - untilBlock: '6ac8fc52c0a9587357c7a1e91bbe8c744127cc107947c05616635ccc7c7701fc', - after: { - // should give REFERENCE_BLOCK_MISMATCH - block: '0000000000000000000000000000000000000000000000000000000000000000', - tx: 'ea2b2abb9bf440a8ab89685e359e88399802c002383a21e4d09a7d636a9514d2', - }, - } - - // We are async - expect.assertions(1) - - await expect(api.fetchNewTxHistory(request, backendConfig)).rejects.toThrow(ApiHistoryError) - }) - - it('filters used addresses', async () => { - const addresses = [ - 'Ae2tdPwUPEZKAx4zt8YLTGxrhX9L6R8QPWNeefZsPgwaigWab4mEw1ECUZ7', - 'Ae2tdPwUPEZ8wGxWm9VbZXFJcgLeKQJWKqREVEtHXYdqsqc4bLeGqjSwrtu', - 'Ae2tdPwUPEZ6T9qZxpao8ciAgg6ahjHRq2jV45ndZ4oPXAwrTYqN9NGUPh4', - 'Ae2tdPwUPEYzFrD5QSQ8NPHEJ8reecZkch5tT8wFAAYu18CJnkZ9XAm5ySE', - 'Ae2tdPwUPEZ3UJ2Y5zpbQeF8GEG1gtR1hoTdUoFJ5oHbbGkcinBrPJDhhhq', - 'Ae2tdPwUPEZ8ipN3wbA8heiZzuKzKRozK5SDzfuEjr8v38RRmFebaVN8ds6', - 'Ae2tdPwUPEZ1VJ4XrhmMMdyzKPmpEMcqajnt5HPCyAps5fF9aRFQCKYDCvj', - 'Ae2tdPwUPEZBr5uk5Rd1Ny2wVusVEqccTtsM5efBw6Sq1GdXiGzwAEDmjPP', - 'Ae2tdPwUPEYzX9Da4KhrarhhSaeFGB6bo8PByqmgj3TfJvr4jaouJ5Sns1N', - 'Ae2tdPwUPEZM6ok4jNYqLzU5Po2o68JdwNSspqai8axY4tJzYfQfj23M3vg', - 'Ae2tdPwUPEZ1WyLvNdf2wWPQgmACZ5ZgQBe6W8RYvNQsybYzQhAb5EFkwxQ', - ] - const used = [ - 'Ae2tdPwUPEZKAx4zt8YLTGxrhX9L6R8QPWNeefZsPgwaigWab4mEw1ECUZ7', - 'Ae2tdPwUPEZ8wGxWm9VbZXFJcgLeKQJWKqREVEtHXYdqsqc4bLeGqjSwrtu', - 'Ae2tdPwUPEZ6T9qZxpao8ciAgg6ahjHRq2jV45ndZ4oPXAwrTYqN9NGUPh4', - 'Ae2tdPwUPEYzFrD5QSQ8NPHEJ8reecZkch5tT8wFAAYu18CJnkZ9XAm5ySE', - 'Ae2tdPwUPEZ3UJ2Y5zpbQeF8GEG1gtR1hoTdUoFJ5oHbbGkcinBrPJDhhhq', - 'Ae2tdPwUPEZ8ipN3wbA8heiZzuKzKRozK5SDzfuEjr8v38RRmFebaVN8ds6', - 'Ae2tdPwUPEZ1VJ4XrhmMMdyzKPmpEMcqajnt5HPCyAps5fF9aRFQCKYDCvj', - ] - - expect.assertions(1) - const result = await api.filterUsedAddresses(addresses, backendConfig) - expect(result).toEqual(used) - }) - - it('keeps order in filterUsedAddresses', async () => { - const addresses = [ - 'Ae2tdPwUPEZKAx4zt8YLTGxrhX9L6R8QPWNeefZsPgwaigWab4mEw1ECUZ7', - 'Ae2tdPwUPEZ8wGxWm9VbZXFJcgLeKQJWKqREVEtHXYdqsqc4bLeGqjSwrtu', - 'Ae2tdPwUPEZ6T9qZxpao8ciAgg6ahjHRq2jV45ndZ4oPXAwrTYqN9NGUPh4', - 'Ae2tdPwUPEYzFrD5QSQ8NPHEJ8reecZkch5tT8wFAAYu18CJnkZ9XAm5ySE', - 'Ae2tdPwUPEZ3UJ2Y5zpbQeF8GEG1gtR1hoTdUoFJ5oHbbGkcinBrPJDhhhq', - 'Ae2tdPwUPEZ8ipN3wbA8heiZzuKzKRozK5SDzfuEjr8v38RRmFebaVN8ds6', - 'Ae2tdPwUPEZ1VJ4XrhmMMdyzKPmpEMcqajnt5HPCyAps5fF9aRFQCKYDCvj', - ] - - expect.assertions(2) - - const result1 = await api.filterUsedAddresses(addresses, backendConfig) - expect(result1).toEqual(addresses) - - addresses.reverse() - - const result2 = await api.filterUsedAddresses(addresses, backendConfig) - expect(result2).toEqual(addresses) - }) -}) diff --git a/legacy/api/shelley/facade.js b/legacy/api/shelley/facade.js deleted file mode 100644 index 481ffd58fc..0000000000 --- a/legacy/api/shelley/facade.js +++ /dev/null @@ -1,134 +0,0 @@ -// @flow - -import moment from 'moment' - -import type {RawTransaction} from '../../api/types' -import {normalizeToAddress} from '../../crypto/shelley/utils' -import type {Transaction, TransactionStatus} from '../../types/HistoryTransaction' -import {TRANSACTION_STATUS} from '../../types/HistoryTransaction' -import assert from '../../utils/assert' - -const checkAndFacadeStatus = (status: string): TransactionStatus => { - const mapping = { - Successful: TRANSACTION_STATUS.SUCCESSFUL, - Pending: TRANSACTION_STATUS.PENDING, - Failed: TRANSACTION_STATUS.FAILED, - } - assert.assert(mapping[status], 'Invalid status', status) - return mapping[status] -} - -export const checkNonNegativeInt = (data: string) => { - // rest of the code does not catch negative values - const regex = /^\d+/ - if (!regex.test(data)) return false - - const parsed = parseInt(data, 10) - return data === parsed.toString() -} - -export const checkISO8601Date = (data: ?string) => { - if (data == null) return false - // ISO8601 format we want to check is exactly following - // "2018-11-07T17:10:21.774Z" - const regex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z$/ - if (!regex.test(data)) return false - if (!moment(data).isValid()) return false - return data === moment(data).toISOString() -} - -export const checkValidHash = (data: ?string) => { - if (data == null) return false - const regex = /^[0-9a-f]{64}$/ - return regex.test(data) -} - -export const checkAndFacadeTransactionAsync = async (tx: RawTransaction): Promise => { - tx.inputs.forEach((i) => { - assert.assert(checkNonNegativeInt(i.amount), 'Invalid input amount', i.amount) - }) - - tx.outputs.forEach((o) => { - assert.assert(checkNonNegativeInt(o.amount), 'Invalid output amount', o.amount) - }) - - await Promise.all( - tx.inputs.map(async (input) => { - assert.assert((await normalizeToAddress(input.address)) != null, 'Invalid input address', input.address) - }), - ) - - await Promise.all( - tx.outputs.map(async (output) => { - assert.assert((await normalizeToAddress(output.address)) != null, 'Invalid output address', output.address) - }), - ) - - assert.assert(checkISO8601Date(tx.last_update), 'Invalid last_update', tx.last_update) - - assert.assert(checkValidHash(tx.hash), 'Invalid hash', tx.hash) - - /** - * all of the following parameters must exist if the tx was successful - */ - - assert.assert(tx.tx_state !== 'Successful' || checkISO8601Date(tx.time), 'Invalid time', tx.time) - - assert.assert(tx.tx_state !== 'Successful' || checkValidHash(tx.block_hash), 'Invalid block_hash', tx.block_hash) - - assert.assert( - tx.tx_state !== 'Successful' || - (tx.block_num != null && tx.tx_ordinal != null && tx.epoch != null && tx.slot != null), - 'Successful tx must include full metadata', - tx.time, - ) - - return { - id: tx.hash, - type: tx.type, - fee: tx.fee ?? undefined, - status: checkAndFacadeStatus(tx.tx_state), - inputs: tx.inputs.map((i) => ({ - address: i.address, - amount: i.amount, - assets: (i.assets ?? []).map((a) => ({ - amount: a.amount, - assetId: a.assetId, - policyId: a.policyId, - name: a.name, - })), - })), - outputs: tx.outputs.map((o) => ({ - address: o.address, - amount: o.amount, - assets: (o.assets ?? []).map((a) => ({ - amount: a.amount, - assetId: a.assetId, - policyId: a.policyId, - name: a.name, - })), - })), - lastUpdatedAt: tx.last_update, - // all of these can be null - submittedAt: tx.time, - blockNum: tx.block_num, - blockHash: tx.block_hash, - txOrdinal: tx.tx_ordinal, - epoch: tx.epoch, - slot: tx.slot, - withdrawals: tx.withdrawals, - certificates: tx.certificates, - validContract: tx.valid_contract, - scriptSize: tx.script_size, - collateralInputs: (tx.collateral_inputs ?? []).map((i) => ({ - address: i.address, - amount: i.amount, - assets: (i.assets ?? []).map((a) => ({ - amount: a.amount, - assetId: a.assetId, - policyId: a.policyId, - name: a.name, - })), - })), - } -} diff --git a/legacy/api/shelley/facade.test.js b/legacy/api/shelley/facade.test.js deleted file mode 100644 index 22445cdfcb..0000000000 --- a/legacy/api/shelley/facade.test.js +++ /dev/null @@ -1,54 +0,0 @@ -// @flow - -import jestSetup from '../../jestSetup' -import {checkISO8601Date, checkNonNegativeInt} from './facade' - -jestSetup.setup() - -describe('checkNonNegativeInt', () => { - it('can validate positive integers', () => { - expect(checkNonNegativeInt('0')).toBe(true) - expect(checkNonNegativeInt('1')).toBe(true) - expect(checkNonNegativeInt('9')).toBe(true) - expect(checkNonNegativeInt('10')).toBe(true) - expect(checkNonNegativeInt('1234567890')).toBe(true) - }) - - it('does not validate leading zeros', () => { - expect(checkNonNegativeInt('00')).toBe(false) - expect(checkNonNegativeInt('01')).toBe(false) - expect(checkNonNegativeInt('09')).toBe(false) - }) - - it('does not validate negative', () => { - expect(checkNonNegativeInt('-1')).toBe(false) - }) - - it('does not validate float', () => { - expect(checkNonNegativeInt('1.27')).toBe(false) - }) - - it('does not validate empty', () => { - expect(checkNonNegativeInt('')).toBe(false) - }) -}) - -describe('checkISO8601Date', () => { - it('does validate', () => { - expect(checkISO8601Date('2018-11-07T17:10:21.774Z')).toBe(true) - expect(checkISO8601Date('2018-11-07T17:10:21.000Z')).toBe(true) - }) - - it('does not validate different format', () => { - expect(checkISO8601Date('2018-11-07T17:10:21Z')).toBe(false) - }) - - it('does not validate bad dates', () => { - expect(checkISO8601Date('2018-13-07T00:00:00.000Z')).toBe(false) - expect(checkISO8601Date('2018-00-00T00:00:00.000Z')).toBe(false) - expect(checkISO8601Date('2018-01-32T00:00:00.000Z')).toBe(false) - expect(checkISO8601Date('2018-01-01T25:00:00.000Z')).toBe(false) - expect(checkISO8601Date('2018-01-01T00:61:00.000Z')).toBe(false) - expect(checkISO8601Date('2018-01-01T00:00:61.000Z')).toBe(false) - }) -}) diff --git a/legacy/api/types.js b/legacy/api/types.js deleted file mode 100644 index 76b9d7a7cc..0000000000 --- a/legacy/api/types.js +++ /dev/null @@ -1,247 +0,0 @@ -// @flow - -/** - * API-related types - */ -import type {TransactionStatus} from '../types/HistoryTransaction' - -export type RemoteAsset = { - +amount: string, - +assetId: string, - +policyId: string, - +name: string, -} -// this is equivalent to yoroi-frontend's `RemoteUnspentOutput` -export type RawUtxo = {| - +amount: string, - +receiver: string, - +tx_hash: string, - +tx_index: number, - +utxo_id: string, - +assets: $ReadOnlyArray, -|} - -export const CERTIFICATE_KIND = { - STAKE_REGISTRATION: 'StakeRegistration', - STAKE_DEREGISTRATION: 'StakeDeregistration', - STAKE_DELEGATION: 'StakeDelegation', - POOL_REGISTRATION: 'PoolRegistration', - POOL_RETIREMENT: 'PoolRetirement', - MOVE_INSTANTANEOUS_REWARDS: 'MoveInstantaneousRewardsCert', -} -export type CertificateKind = $Values - -// getAccountState - -export type AccountStateRequest = {| - addresses: Array, -|} -export type RemoteAccountState = {| - poolOperator: null, // not implemented yet - remainingAmount: string, // current remaining awards - rewards: string, // all the rewards every added - withdrawals: string, // all the withdrawals that have ever happened -|} -export type AccountStateResponse = {| - [key: string]: null | RemoteAccountState, -|} - -// getPoolInfo - -export type RemoteCertificate = {| - kind: 'PoolRegistration' | 'PoolRetirement', - certIndex: number, - poolParams: Object, // don't think this is relevant -|} - -export type RemotePoolMetaSuccess = {| - info: ?{ - name?: string, - ticker?: string, - description?: string, - homepage?: string, - // other stuff from SMASH. - }, - history: Array<{| - epoch: number, - slot: number, - tx_ordinal: number, - cert_ordinal: number, - payload: RemoteCertificate, - |}>, -|} - -export type RemotePoolMetaFailure = {| - error: Object, -|} - -export type PoolInfoRequest = {| - poolIds: Array, -|} - -export type PoolInfoResponse = { - [key: string]: RemotePoolMetaSuccess | RemotePoolMetaFailure, -} - -// getTokenInfo - -export type TokenInfoRequest = {| - tokenIds: Array, -|} - -export type RemoteTokenInfo = {| - // from token metadata (off chain) - +name?: string, - +decimals?: number, - +policyId?: string, - +assetName?: string, - +longName?: string, - +ticker?: string, -|} -export type TokenInfoResponse = { - [key: string]: RemoteTokenInfo | null, -} - -// getTxsBodiesForUTXOs - -export type TxBodiesRequest = {|txsHashes: Array|} -export type TxBodiesResponse = {[key: string]: string} - -// reputation - -export type ReputationObject = { - node_flags?: number, - // note: could be more metrics that are not handled -} -export type ReputationResponse = {[poolId: string]: ReputationObject} - -// serverstatus - -export type ServerStatusResponse = {| - isServerOk: boolean, - isMaintenance: boolean, - serverTime: number, // in milliseconds -|} - -// bestblock - -export type BestblockResponse = {| - height: number, - epoch: ?number, - slot: ?number, - hash: ?string, -|} - -// tx history - -export type TxHistoryRequest = {| - addresses: Array, - untilBlock: string, - after?: { - block: string, - tx: string, - }, -|} - -export type RemoteTransactionInputBase = {| - +address: string, - +amount: string, - +assets: $ReadOnlyArray, -|} - -export type RemoteTransactionUtxoInput = {| - +id: string, // concatenation of txHash || index - +index: number, - +txHash: string, -|} - -// not considering acount txs for now -export type RemoteTransactionInput = {| - ...RemoteTransactionInputBase, - ...RemoteTransactionUtxoInput, -|} - -export type RemoteTransactionOutput = {| - +address: string, - +amount: string, - +assets: $ReadOnlyArray, -|} - -/** - * only present if TX is in a block - */ -export type RemoteTxBlockMeta = {| - +block_num: number, - +block_hash: string, - +tx_ordinal: number, - +time: string, // timestamp with timezone - +epoch: number, - +slot: number, -|} - -// See complete types in: -// https://github.com/Emurgo/yoroi-graphql-migration-backend#output-6 -export type RemoteCertificateMeta = - | {| - kind: typeof CERTIFICATE_KIND.STAKE_REGISTRATION, - rewardAddress: string, // hex - |} - | {| - kind: typeof CERTIFICATE_KIND.STAKE_DEREGISTRATION, - rewardAddress: string, // hex - |} - | {| - kind: typeof CERTIFICATE_KIND.STAKE_DELEGATION, - rewardAddress: string, // hex - poolKeyHash: string, // hex - |} - | {| - kind: typeof CERTIFICATE_KIND.POOL_REGISTRATION, - poolParams: Object, // we don't care about this for now - |} - | {| - kind: typeof CERTIFICATE_KIND.POOL_RETIREMENT, - poolKeyHash: string, // hex - |} - | {| - kind: typeof CERTIFICATE_KIND.MOVE_INSTANTANEOUS_REWARDS, - rewards: {[addresses: string]: string}, - pot: 0 | 1, - |} -export type RemoteTxInfo = {| - +type: 'byron' | 'shelley', - +fee?: string, // only in shelley txs - +hash: string, - +last_update: string, // timestamp with timezone - +tx_state: TransactionStatus, - +inputs: Array, - +outputs: Array, - +withdrawals: Array<{| - address: string, // hex - amount: string, - |}>, - +certificates: Array, - +valid_contract?: boolean, - +script_size?: number, - +collateral_inputs?: Array, -|} - -export type RawTransaction = {| - ...WithNullableFields, - ...RemoteTxInfo, -|} - -// Catalyst -type FundInfo = {| - +id: number, - +registrationStart: string, - +registrationEnd: string, - +votingStart?: string, - +votingEnd?: string, - +votingPowerThreshold: string, // in ada -|} - -export type FundInfoResponse = {| - +currentFund: ?FundInfo, - +nextFund: ?FundInfo, -|} diff --git a/legacy/assets/fonts/Rubik-Bold.ttf b/legacy/assets/fonts/Rubik-Bold.ttf deleted file mode 100644 index bddc26ed97..0000000000 Binary files a/legacy/assets/fonts/Rubik-Bold.ttf and /dev/null differ diff --git a/legacy/assets/fonts/Rubik-BoldItalic.ttf b/legacy/assets/fonts/Rubik-BoldItalic.ttf deleted file mode 100644 index 531a0c2749..0000000000 Binary files a/legacy/assets/fonts/Rubik-BoldItalic.ttf and /dev/null differ diff --git a/legacy/assets/fonts/Rubik-Italic.ttf b/legacy/assets/fonts/Rubik-Italic.ttf deleted file mode 100644 index 8ea3722516..0000000000 Binary files a/legacy/assets/fonts/Rubik-Italic.ttf and /dev/null differ diff --git a/legacy/assets/fonts/Rubik-Light.ttf b/legacy/assets/fonts/Rubik-Light.ttf deleted file mode 100644 index 0d172b5d33..0000000000 Binary files a/legacy/assets/fonts/Rubik-Light.ttf and /dev/null differ diff --git a/legacy/assets/fonts/Rubik-LightItalic.ttf b/legacy/assets/fonts/Rubik-LightItalic.ttf deleted file mode 100644 index 4b8e00c9ad..0000000000 Binary files a/legacy/assets/fonts/Rubik-LightItalic.ttf and /dev/null differ diff --git a/legacy/assets/fonts/Rubik-Medium.ttf b/legacy/assets/fonts/Rubik-Medium.ttf deleted file mode 100644 index a4cfd87e3d..0000000000 Binary files a/legacy/assets/fonts/Rubik-Medium.ttf and /dev/null differ diff --git a/legacy/assets/fonts/Rubik-MediumItalic.ttf b/legacy/assets/fonts/Rubik-MediumItalic.ttf deleted file mode 100644 index 93baa0139d..0000000000 Binary files a/legacy/assets/fonts/Rubik-MediumItalic.ttf and /dev/null differ diff --git a/legacy/assets/fonts/Rubik-Regular.ttf b/legacy/assets/fonts/Rubik-Regular.ttf deleted file mode 100644 index 06a67a2dae..0000000000 Binary files a/legacy/assets/fonts/Rubik-Regular.ttf and /dev/null differ diff --git a/legacy/assets/fonts/Rubik-SemiBold.ttf b/legacy/assets/fonts/Rubik-SemiBold.ttf deleted file mode 100644 index 3eeeb116bc..0000000000 Binary files a/legacy/assets/fonts/Rubik-SemiBold.ttf and /dev/null differ diff --git a/legacy/assets/fonts/Rubik-SemiBoldItalic.ttf b/legacy/assets/fonts/Rubik-SemiBoldItalic.ttf deleted file mode 100644 index a469a4efbf..0000000000 Binary files a/legacy/assets/fonts/Rubik-SemiBoldItalic.ttf and /dev/null differ diff --git a/legacy/assets/img/icon/dashboard-active.png b/legacy/assets/img/icon/dashboard-active.png deleted file mode 100644 index 9ef9352934..0000000000 Binary files a/legacy/assets/img/icon/dashboard-active.png and /dev/null differ diff --git a/legacy/assets/img/icon/dashboard-active@2x.png b/legacy/assets/img/icon/dashboard-active@2x.png deleted file mode 100644 index d53f9ca170..0000000000 Binary files a/legacy/assets/img/icon/dashboard-active@2x.png and /dev/null differ diff --git a/legacy/assets/img/icon/dashboard-active@3x.png b/legacy/assets/img/icon/dashboard-active@3x.png deleted file mode 100644 index cf61bb845d..0000000000 Binary files a/legacy/assets/img/icon/dashboard-active@3x.png and /dev/null differ diff --git a/legacy/assets/img/icon/dashboard.png b/legacy/assets/img/icon/dashboard.png deleted file mode 100644 index 06de2e408d..0000000000 Binary files a/legacy/assets/img/icon/dashboard.png and /dev/null differ diff --git a/legacy/assets/img/icon/dashboard@2x.png b/legacy/assets/img/icon/dashboard@2x.png deleted file mode 100644 index 605677235e..0000000000 Binary files a/legacy/assets/img/icon/dashboard@2x.png and /dev/null differ diff --git a/legacy/assets/img/icon/dashboard@3x.png b/legacy/assets/img/icon/dashboard@3x.png deleted file mode 100644 index 3fe4c58e04..0000000000 Binary files a/legacy/assets/img/icon/dashboard@3x.png and /dev/null differ diff --git a/legacy/assets/img/icon/delegation-active.png b/legacy/assets/img/icon/delegation-active.png deleted file mode 100644 index 8ce4f54ec1..0000000000 Binary files a/legacy/assets/img/icon/delegation-active.png and /dev/null differ diff --git a/legacy/assets/img/icon/delegation-active@2x.png b/legacy/assets/img/icon/delegation-active@2x.png deleted file mode 100644 index 6abe0522fa..0000000000 Binary files a/legacy/assets/img/icon/delegation-active@2x.png and /dev/null differ diff --git a/legacy/assets/img/icon/delegation-active@3x.png b/legacy/assets/img/icon/delegation-active@3x.png deleted file mode 100644 index 5e23f19db3..0000000000 Binary files a/legacy/assets/img/icon/delegation-active@3x.png and /dev/null differ diff --git a/legacy/assets/img/icon/delegation.png b/legacy/assets/img/icon/delegation.png deleted file mode 100644 index 409c551f1f..0000000000 Binary files a/legacy/assets/img/icon/delegation.png and /dev/null differ diff --git a/legacy/assets/img/icon/delegation@2x.png b/legacy/assets/img/icon/delegation@2x.png deleted file mode 100644 index 9b312b4d7d..0000000000 Binary files a/legacy/assets/img/icon/delegation@2x.png and /dev/null differ diff --git a/legacy/assets/img/icon/delegation@3x.png b/legacy/assets/img/icon/delegation@3x.png deleted file mode 100644 index 946fbdcf65..0000000000 Binary files a/legacy/assets/img/icon/delegation@3x.png and /dev/null differ diff --git a/legacy/assets/img/icon/receive-active.png b/legacy/assets/img/icon/receive-active.png deleted file mode 100644 index 06dc9314e6..0000000000 Binary files a/legacy/assets/img/icon/receive-active.png and /dev/null differ diff --git a/legacy/assets/img/icon/receive-active@2x.png b/legacy/assets/img/icon/receive-active@2x.png deleted file mode 100644 index c90e2aff84..0000000000 Binary files a/legacy/assets/img/icon/receive-active@2x.png and /dev/null differ diff --git a/legacy/assets/img/icon/receive-active@3x.png b/legacy/assets/img/icon/receive-active@3x.png deleted file mode 100644 index 5d47c0da14..0000000000 Binary files a/legacy/assets/img/icon/receive-active@3x.png and /dev/null differ diff --git a/legacy/assets/img/icon/receive.png b/legacy/assets/img/icon/receive.png deleted file mode 100644 index 4d5a687c4e..0000000000 Binary files a/legacy/assets/img/icon/receive.png and /dev/null differ diff --git a/legacy/assets/img/icon/receive@2x.png b/legacy/assets/img/icon/receive@2x.png deleted file mode 100644 index ccea93efa6..0000000000 Binary files a/legacy/assets/img/icon/receive@2x.png and /dev/null differ diff --git a/legacy/assets/img/icon/receive@3x.png b/legacy/assets/img/icon/receive@3x.png deleted file mode 100644 index 63d0d85159..0000000000 Binary files a/legacy/assets/img/icon/receive@3x.png and /dev/null differ diff --git a/legacy/assets/img/icon/send-active.png b/legacy/assets/img/icon/send-active.png deleted file mode 100644 index ae89651cae..0000000000 Binary files a/legacy/assets/img/icon/send-active.png and /dev/null differ diff --git a/legacy/assets/img/icon/send-active@2x.png b/legacy/assets/img/icon/send-active@2x.png deleted file mode 100644 index f372bd6004..0000000000 Binary files a/legacy/assets/img/icon/send-active@2x.png and /dev/null differ diff --git a/legacy/assets/img/icon/send-active@3x.png b/legacy/assets/img/icon/send-active@3x.png deleted file mode 100644 index c662f291bf..0000000000 Binary files a/legacy/assets/img/icon/send-active@3x.png and /dev/null differ diff --git a/legacy/assets/img/icon/send.png b/legacy/assets/img/icon/send.png deleted file mode 100644 index fe2e75f9eb..0000000000 Binary files a/legacy/assets/img/icon/send.png and /dev/null differ diff --git a/legacy/assets/img/icon/send@2x.png b/legacy/assets/img/icon/send@2x.png deleted file mode 100644 index 075141b7be..0000000000 Binary files a/legacy/assets/img/icon/send@2x.png and /dev/null differ diff --git a/legacy/assets/img/icon/send@3x.png b/legacy/assets/img/icon/send@3x.png deleted file mode 100644 index f970375e28..0000000000 Binary files a/legacy/assets/img/icon/send@3x.png and /dev/null differ diff --git a/legacy/assets/img/icon/txhistory-active.png b/legacy/assets/img/icon/txhistory-active.png deleted file mode 100644 index 7106f94db6..0000000000 Binary files a/legacy/assets/img/icon/txhistory-active.png and /dev/null differ diff --git a/legacy/assets/img/icon/txhistory-active@2x.png b/legacy/assets/img/icon/txhistory-active@2x.png deleted file mode 100644 index 6f86b22c2b..0000000000 Binary files a/legacy/assets/img/icon/txhistory-active@2x.png and /dev/null differ diff --git a/legacy/assets/img/icon/txhistory-active@3x.png b/legacy/assets/img/icon/txhistory-active@3x.png deleted file mode 100644 index 4845baf024..0000000000 Binary files a/legacy/assets/img/icon/txhistory-active@3x.png and /dev/null differ diff --git a/legacy/assets/img/icon/txhistory.png b/legacy/assets/img/icon/txhistory.png deleted file mode 100644 index af2c9126cd..0000000000 Binary files a/legacy/assets/img/icon/txhistory.png and /dev/null differ diff --git a/legacy/assets/img/icon/txhistory@2x.png b/legacy/assets/img/icon/txhistory@2x.png deleted file mode 100644 index 53cf4498b8..0000000000 Binary files a/legacy/assets/img/icon/txhistory@2x.png and /dev/null differ diff --git a/legacy/assets/img/icon/txhistory@3x.png b/legacy/assets/img/icon/txhistory@3x.png deleted file mode 100644 index 90124ca39a..0000000000 Binary files a/legacy/assets/img/icon/txhistory@3x.png and /dev/null differ diff --git a/legacy/assets/img/icon/visibility-closed.png b/legacy/assets/img/icon/visibility-closed.png deleted file mode 100644 index 6ae1b1cdfa..0000000000 Binary files a/legacy/assets/img/icon/visibility-closed.png and /dev/null differ diff --git a/legacy/assets/img/icon/visibility-closed@2x.png b/legacy/assets/img/icon/visibility-closed@2x.png deleted file mode 100644 index 75684f18af..0000000000 Binary files a/legacy/assets/img/icon/visibility-closed@2x.png and /dev/null differ diff --git a/legacy/assets/img/icon/visibility-closed@3x.png b/legacy/assets/img/icon/visibility-closed@3x.png deleted file mode 100644 index b000605339..0000000000 Binary files a/legacy/assets/img/icon/visibility-closed@3x.png and /dev/null differ diff --git a/legacy/assets/img/icon/visibility-opened.png b/legacy/assets/img/icon/visibility-opened.png deleted file mode 100644 index dcb01291e9..0000000000 Binary files a/legacy/assets/img/icon/visibility-opened.png and /dev/null differ diff --git a/legacy/assets/img/icon/visibility-opened@2x.png b/legacy/assets/img/icon/visibility-opened@2x.png deleted file mode 100644 index c02dd72151..0000000000 Binary files a/legacy/assets/img/icon/visibility-opened@2x.png and /dev/null differ diff --git a/legacy/assets/img/icon/visibility-opened@3x.png b/legacy/assets/img/icon/visibility-opened@3x.png deleted file mode 100644 index 3b4afe2007..0000000000 Binary files a/legacy/assets/img/icon/visibility-opened@3x.png and /dev/null differ diff --git a/legacy/assets/img/no_transactions.png b/legacy/assets/img/no_transactions.png deleted file mode 100644 index 8b9b86f48e..0000000000 Binary files a/legacy/assets/img/no_transactions.png and /dev/null differ diff --git a/legacy/assets/img/no_transactions@2x.png b/legacy/assets/img/no_transactions@2x.png deleted file mode 100644 index 4a8e51f995..0000000000 Binary files a/legacy/assets/img/no_transactions@2x.png and /dev/null differ diff --git a/legacy/assets/img/no_transactions@3x.png b/legacy/assets/img/no_transactions@3x.png deleted file mode 100644 index 4fb35efde9..0000000000 Binary files a/legacy/assets/img/no_transactions@3x.png and /dev/null differ diff --git a/legacy/assets/staking/TotalAdaIcon.js b/legacy/assets/staking/TotalAdaIcon.js deleted file mode 100644 index 81cfbd2246..0000000000 --- a/legacy/assets/staking/TotalAdaIcon.js +++ /dev/null @@ -1,43 +0,0 @@ -// @flow - -import React from 'react' -import Svg, {Circle, G, Path, Rect} from 'react-native-svg' - -type Props = { - width: number, - height: number, -} - -const TotalAdaIcon = ({width, height}: Props) => ( - - - - - - - - - - - - - - - - - -) - -export default TotalAdaIcon diff --git a/legacy/assets/staking/TotalDelegatedIcon.js b/legacy/assets/staking/TotalDelegatedIcon.js deleted file mode 100644 index 6c998bbde2..0000000000 --- a/legacy/assets/staking/TotalDelegatedIcon.js +++ /dev/null @@ -1,49 +0,0 @@ -// @flow - -import React from 'react' -import Svg, {Circle, G, Path} from 'react-native-svg' - -type Props = { - width: number, - height: number, -} - -const TotalDelegatedIcon = ({width, height}: Props) => ( - - - - - - - - - - - - - - - - - - - - - - -) - -export default TotalDelegatedIcon diff --git a/legacy/assets/staking/TotalRewardIcon.js b/legacy/assets/staking/TotalRewardIcon.js deleted file mode 100644 index b1ff1f1ae4..0000000000 --- a/legacy/assets/staking/TotalRewardIcon.js +++ /dev/null @@ -1,40 +0,0 @@ -// @flow - -import React from 'react' -import Svg, {Circle, G, Path, Rect} from 'react-native-svg' - -type Props = { - width: number, - height: number, -} - -const TotalRewardIcon = ({width, height}: Props) => ( - - - - - - - - - - - - - -) - -export default TotalRewardIcon diff --git a/legacy/components/Badge.js b/legacy/components/Badge.js deleted file mode 100644 index 3256ba6f5b..0000000000 --- a/legacy/components/Badge.js +++ /dev/null @@ -1,41 +0,0 @@ -// @flow - -import React from 'react' -import {StyleSheet, Text, View} from 'react-native' - -import stylesConfig, {COLORS} from '../styles/config' - -const styles = StyleSheet.create({ - container: { - paddingTop: 2, - paddingBottom: 2, - paddingLeft: 10, - paddingRight: 10, - borderRadius: 20, - }, - text: { - fontFamily: stylesConfig.defaultFont, - }, -}) - -type Props = {text: string, color?: string, backgroundColor?: string} - -const Badge = ({text, color, backgroundColor}: Props) => ( - - - {text} - - -) - -export default Badge diff --git a/legacy/components/Common/DangerousActionModal.js b/legacy/components/Common/DangerousActionModal.js deleted file mode 100644 index 3529f26ead..0000000000 --- a/legacy/components/Common/DangerousActionModal.js +++ /dev/null @@ -1,155 +0,0 @@ -// @flow - -import React from 'react' -import {type IntlShape, injectIntl} from 'react-intl' -import {Image, ScrollView, View} from 'react-native' -import {type PressEvent} from 'react-native/Libraries/Types/CoreEventTypes' - -// $FlowExpectedError -import {Spacer} from '../../../src/components' -import alertCircle from '../../assets/img/alert-circle.png' -import globalMessages, {confirmationMessages} from '../../i18n/global-messages' -import {Button, Checkbox, Modal, Text} from '../UiKit' -import styles, {alertStyles} from './styles/DangerousActionModal.style' -type DangerousActionProps = {| - +title: string, - +children: React$Node, - +alertBox?: { - title?: string, - content: Array, - }, - +primaryButton: {| - +label: string, - +onPress: (event: PressEvent) => PossiblyAsync, - |}, - +secondaryButton?: {| - label?: string, - onPress: (event: PressEvent) => PossiblyAsync, - primary?: boolean, - |}, - +checkboxLabel?: string, - intl: IntlShape, -|} - -export const DangerousAction = injectIntl( - ({intl, title, children, alertBox, primaryButton, secondaryButton, checkboxLabel}: DangerousActionProps) => { - const [isChecked, setIsChecked] = React.useState(false) - - return ( - - - {title} - - - - - {children} - - - - {alertBox && ( - <> - - - - )} - - setIsChecked(!isChecked)} - checked={isChecked} - text={checkboxLabel || intl.formatMessage(confirmationMessages.commonButtons.iUnderstandButton)} - style={styles.checkbox} - /> - - - - -