diff --git a/.babel-ts-register.js b/.babel-ts-register.js
new file mode 100644
index 0000000000..b32fc7da3e
--- /dev/null
+++ b/.babel-ts-register.js
@@ -0,0 +1 @@
+require('@babel/register')({extensions: ['.js', '.jsx', '.ts', '.tsx']});
diff --git a/.babelrc b/.babelrc
index 9d6424b359..4a27295d67 100644
--- a/.babelrc
+++ b/.babelrc
@@ -1,7 +1,6 @@
{
"plugins": [
"lodash",
- "@babel/plugin-transform-modules-commonjs",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-transform-classes",
@@ -14,7 +13,6 @@
]
],
"presets": [
- "@babel/preset-flow",
"@babel/preset-typescript",
"@babel/preset-react",
["@babel/preset-env", {
diff --git a/.eslintrc.js b/.eslintrc.js
index 2581fe1d2a..639fdfb33d 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -9,30 +9,25 @@ const options = {
},
extends: [
'eslint:recommended',
- 'plugin:flowtype/recommended',
+ 'plugin:node/recommended',
'plugin:react/recommended',
- 'plugin:import/recommended'
- ],
- parser: 'babel-eslint',
- parserOptions: {
- ecmaFeatures: {
- experimentalObjectRestSpread: true,
- generators: true,
- jsx: true,
- modules: false
- },
- ecmaVersion: 8,
- sourceType: 'module'
- },
+ 'plugin:import/recommended',
+ 'plugin:@typescript-eslint/recommended'
+ ],
+ parser: '@typescript-eslint/parser',
plugins: [
'react',
'import',
- 'flowtype',
- 'babel'
+ '@typescript-eslint'
],
+ root: true,
settings: {
+ 'import/resolver': {
+ node: {
+ extensions: ['.js', '.jsx', '.ts', '.tsx']
+ }
+ },
react: {
- flowVersion: '0.69',
version: 'detect'
}
}
@@ -44,24 +39,12 @@ const ERROR = 2;
const TRANSITION_WARNING = 1; // warnings that should be reviewed soon
const WARNING = 1; // warnings that should stay warnings
const TRANSITION_IGNORE = 0; // ignores that should be reviewed soon
+const IGNORE = 0;
// These should not be removed at all.
const possibleErrorsRules = {
- 'for-direction': ERROR,
- 'getter-return': ERROR,
'no-await-in-loop': ERROR,
'no-console': ERROR,
- 'no-extra-parens': [
- ERROR,
- 'all',
- {
- enforceForArrowConditionals: false,
- ignoreJSX: 'multi-line',
- nestedBinaryExpressions: false,
- returnAssign: false
- }
- ],
- 'no-prototype-builtins': ERROR,
'no-template-curly-in-string': ERROR,
'valid-jsdoc': [
ERROR,
@@ -148,7 +131,6 @@ const bestPracticesRules = {
'no-useless-return': ERROR,
'no-void': ERROR,
'no-warning-comments': WARNING,
- 'no-with': ERROR,
'prefer-promise-reject-errors': ERROR,
radix: ERROR,
'require-await': ERROR,
@@ -171,16 +153,12 @@ const variablesRules = {
'init-declarations': TRANSITION_IGNORE,
'no-catch-shadow': ERROR,
'no-label-var': ERROR,
- 'no-shadow': ERROR,
- 'no-shadow-restricted-names': ERROR,
'no-undef-init': ERROR,
- 'no-undefined': ERROR,
- 'no-unused-vars': WARNING,
- 'no-use-before-define': ERROR
+ 'no-undefined': ERROR
};
const nodeAndCommonJSRules = {
- 'callback-return': [
+ 'node/callback-return': [
ERROR,
[
'callback',
@@ -189,14 +167,21 @@ const nodeAndCommonJSRules = {
'done'
]
],
- 'global-require': ERROR,
- 'handle-callback-err': ERROR,
- 'no-mixed-requires': ERROR,
- 'no-new-require': ERROR,
- 'no-path-concat': ERROR,
- 'no-process-env': TRANSITION_WARNING,
- 'no-process-exit': ERROR,
- 'no-sync': ERROR
+ 'node/global-require': ERROR,
+ 'node/handle-callback-err': ERROR,
+ 'node/no-missing-import': [
+ ERROR,
+ {tryExtensions: ['.js', '.jsx', '.ts', '.tsx']}
+ ],
+ 'node/no-mixed-requires': ERROR,
+ 'node/no-new-require': ERROR,
+ 'node/no-path-concat': ERROR,
+ 'node/no-process-env': TRANSITION_WARNING,
+ 'node/no-process-exit': ERROR,
+ 'node/no-sync': ERROR,
+ 'node/no-unpublished-import': IGNORE,
+ 'node/no-unsupported-features/es-builtins': IGNORE,
+ 'node/no-unsupported-features/es-syntax': IGNORE
};
// Agreement of all project leads needed before changing these.
@@ -303,6 +288,12 @@ const stylisticIssuesRules = {
TRANSITION_IGNORE,
15
],
+ 'new-cap': [
+ ERROR,
+ {
+ capIsNew: false
+ }
+ ],
'new-parens': ERROR,
'no-array-constructor': ERROR,
'no-bitwise': ERROR,
@@ -319,10 +310,8 @@ const stylisticIssuesRules = {
'no-trailing-spaces': ERROR,
'no-unneeded-ternary': ERROR,
'no-whitespace-before-property': ERROR,
- 'object-curly-newline': [
- ERROR,
- {consistent: true}
- ],
+ 'object-curly-newline': ERROR,
+ 'object-curly-spacing': ERROR,
'one-var': [
ERROR,
'never'
@@ -380,12 +369,7 @@ const ecmaScript6Rules = {
before: false
}
],
- 'no-confusing-arrow': [
- ERROR,
- {
- allowParens: true
- }
- ],
+ 'no-confusing-arrow': ERROR,
'no-duplicate-imports': ERROR,
'no-useless-computed-key': ERROR,
'no-useless-constructor': ERROR,
@@ -409,20 +393,25 @@ const ecmaScript6Rules = {
'yield-star-spacing': ERROR
};
-const babelRules = {
- 'babel/new-cap': [
+const typescriptRules = {
+ '@typescript-eslint/ban-types': TRANSITION_WARNING,
+ '@typescript-eslint/explicit-module-boundary-types': TRANSITION_IGNORE,
+ '@typescript-eslint/no-explicit-any': TRANSITION_IGNORE,
+ '@typescript-eslint/no-extra-parens': [
ERROR,
+ 'all',
{
- capIsNew: false
+ enforceForArrowConditionals: false,
+ ignoreJSX: 'multi-line',
+ nestedBinaryExpressions: false,
+ returnAssign: false
}
],
- 'babel/no-invalid-this': ERROR,
- 'babel/object-curly-spacing': ERROR,
- 'babel/semi': ERROR
-};
-
-const flowTypeRules = {
- 'flowtype/semi': ERROR
+ '@typescript-eslint/no-invalid-this': ERROR,
+ '@typescript-eslint/no-shadow': ERROR,
+ '@typescript-eslint/no-unused-vars': WARNING,
+ '@typescript-eslint/no-use-before-define': ERROR,
+ '@typescript-eslint/semi': ERROR
};
const reactRules = {
@@ -562,8 +551,7 @@ options.rules = Object.assign(
nodeAndCommonJSRules,
stylisticIssuesRules,
ecmaScript6Rules,
- babelRules,
- flowTypeRules,
+ typescriptRules,
reactRules,
es6ImportRules
);
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
new file mode 100644
index 0000000000..62b33a2d49
--- /dev/null
+++ b/.github/workflows/lint.yml
@@ -0,0 +1,35 @@
+# Run ESLint with autofix
+
+name: Lint
+
+# Controls when the action will run.
+on:
+ # Triggers the workflow on push events for the master branch
+ push:
+ branches: [ master ]
+ # Triggers the workflow on pull request events in the context of the fork
+ # trying to sidestep limitations here: https://github.com/wearerequired/lint-action/issues/13
+ pull_request_target:
+
+jobs:
+ run-linters:
+ name: Run linters
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v2
+ with:
+ # Also check out Lobes bootstrap theme submodule
+ submodules: true
+
+ - name: NPM install
+ uses: bahmutov/npm-install@v1
+
+ - name: Run linters
+ uses: wearerequired/lint-action@feature/pull_request_target
+ with:
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ # Enable linters with auto-fix
+ auto_fix: true
+ eslint: true
diff --git a/.gitignore b/.gitignore
index ffb1c20dcb..d3dfab648d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,7 +11,10 @@
# react-hot-loader files
/static/hot
-/static/**/*.hot-update.js
+*.hot-update.js
+*.hot-update.json
+/static/**/*.jpg
+/static/**/*.svg
### Node ###
# Logs
@@ -81,3 +84,6 @@ typings/
# Visual Studio Code config files
.vscode
+
+# Git revision file used in the website
+.git-revision
\ No newline at end of file
diff --git a/.mocharc.yaml b/.mocharc.yaml
index 542c7de6fe..25a5155264 100644
--- a/.mocharc.yaml
+++ b/.mocharc.yaml
@@ -1,4 +1,4 @@
exit: true
recursive: true
-require: '@babel/register'
+require: '.babel-ts-register.js'
timeout: 50000
diff --git a/.travis.yml b/.travis.yml
index 604d648f10..6e82706624 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,7 +1,8 @@
language: node_js
node_js:
+ - "node"
- "lts/*"
- - "8"
+ - "10"
notifications:
email: false
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 0bcb141730..374f3d6923 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -23,7 +23,7 @@ to BookBrainz:
* Variable names should be camelCase
* Use ES6/ES7 features - they make life easier and result in cleaner code
* Use [JSDoc](http://usejsdoc.org/) for commenting code
- * Use [Flow](https://flow.org/) annotations everywhere - static type checking is useful
+ * Use [TypeScript](https://www.typescriptlang.org/) everywhere - static type checking is useful
## Commits
diff --git a/Dockerfile b/Dockerfile
index 0873a29213..82d9118abd 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,15 +1,16 @@
FROM metabrainz/node:10 as bookbrainz-base
ARG DEPLOY_ENV
+ARG GIT_COMMIT_SHA
ARG BUILD_DEPS=" \
build-essential \
- git \
python-dev \
libpq-dev"
ARG RUN_DEPS=" \
bzip2 \
+ git \
rsync"
@@ -26,12 +27,18 @@ RUN apt-get update \
&& apt-get install -y --no-install-recommends postgresql-client-$PG_MAJOR \
&& rm -rf /var/lib/apt/lists/*
+# Clean up files that aren't needed for production
+RUN apt-get remove -y $BUILD_DEPS && \
+ apt-get autoremove -y
+
RUN useradd --create-home --shell /bin/bash bookbrainz
ARG BB_ROOT=/home/bookbrainz/bookbrainz-site
WORKDIR $BB_ROOT
RUN chown bookbrainz:bookbrainz $BB_ROOT
+RUN echo $GIT_COMMIT_SHA > .git-version
+
# Files necessary to complete the JavaScript build
COPY scripts/ scripts/
COPY .babelrc ./
@@ -43,10 +50,6 @@ COPY package-lock.json ./
RUN npm install --no-audit
-# Clean up files that aren't needed for production
-RUN apt-get remove -y $BUILD_DEPS && \
- apt-get autoremove -y
-
COPY static/ static/
COPY config/ config/
COPY sql/ sql/
@@ -85,6 +88,7 @@ RUN chmod 0644 /etc/cron.d/bookbrainz && crontab -u bookbrainz /etc/cron.d/bookb
# Build JS project and assets
RUN ["npm", "run", "build"]
+RUN ["npm", "prune", "--production"]
# API target
FROM bookbrainz-base as bookbrainz-webservice
@@ -100,4 +104,5 @@ COPY ./docker/$DEPLOY_ENV/webserver.service /etc/service/webserver/run
RUN chmod 755 /etc/service/webserver/run
RUN touch /etc/service/webserver/down
# Build API JS
-RUN ["npm", "run", "build-api-js"]
\ No newline at end of file
+RUN ["npm", "run", "build-api-js"]
+RUN ["npm", "prune", "--production"]
\ No newline at end of file
diff --git a/NODEJS_SETUP.md b/NODEJS_SETUP.md
index 9ea1e7a761..4ef95b67da 100644
--- a/NODEJS_SETUP.md
+++ b/NODEJS_SETUP.md
@@ -49,10 +49,6 @@ Here is [a good introduction](https://www.youtube.com/watch?v=yFtU6_UaOtA) to de
There are VSCode configuration files (in the `.vscode` folder) for running both the server and the tests, useful in both cases to debug into the code and see what is happening as the code executes.
Make sure the dependencies (postgres, redis, elasticsearch) are running, and you can just open the debugger tray in VSCode, select 'Launch Program' and click the button!
-BookBrainz uses [Flow](https://flow.org) as a javascript typechecking library. VSCode is partial to Typescript, and needs to be configured to avoid confusion.
-We recommend you install the flow-for-vscode extension and [follow this setup step](https://github.com/flowtype/flow-for-vscode#setup):
-`Set [VSCode configuration] javascript.validate.enable option to false or completely disable the built-in TypeScript extension for your project`
-
# Watch files and live reload with Webpack
@@ -62,11 +58,11 @@ keeping the application state intact, for the price of increased compilation tim
If you are running the server manually, you can simply run `npm run debug` in the command line.
-If you're using Docker and our `./develop.sh` script, you will need to modify the `docker-compose.yml` file to:
-1. change the `command` to:
+If you're using Docker and our `./develop.sh` script, you will need to modify the `docker-compose.yml` file and change a few things on the `bookbrainz-site` service defined there:
+1. change the bookbrainz-site `command` to:
- `npm run debug` if you only want to change client files (in `src/client`)
- `npm run debug-watch-server` if you *also* want to modify server files (in `src/server`)
-2. mount the `src` folder
+2. mount the `src` folder to the bookbrainz-site service
For example:
```
diff --git a/README.md b/README.md
index 5226ec314d..c79e23a774 100644
--- a/README.md
+++ b/README.md
@@ -141,7 +141,7 @@ Once you are done developing, you can stop the dependencies running in docker in
As described above for running the web server, you can easily start the API with Docker by running `./develop-api.sh`.
-Point you browser to `localhost:9099/1/api-docs` to pull up the documentation and try out the api endpoints.
+Point you browser to `localhost:9098/1/api-docs` to pull up the documentation and try out the api endpoints.
Don't forget to run `./stop.sh` once you are done developing to stop the dependencies that are running in the background.
diff --git a/docker-compose.api.yml b/docker-compose.api.yml
index e21c82309e..cf559dae23 100644
--- a/docker-compose.api.yml
+++ b/docker-compose.api.yml
@@ -28,6 +28,7 @@ services:
- "5432:5432"
environment:
- POSTGRES_USER=postgres
+ - POSTGRES_HOST_AUTH_METHOD=trust
volumes:
- postgres-data:/var/lib/postgresql/data
diff --git a/docker/push-webservice.sh b/docker/push-webservice.sh
index 2f8d08867e..71cde75f17 100755
--- a/docker/push-webservice.sh
+++ b/docker/push-webservice.sh
@@ -20,7 +20,7 @@ TAG=${2:-beta}
echo "Building BookBrainz image with env $ENV tag $TAG and docker build target bookbrainz-webservice"
docker build -t metabrainz/bookbrainz-webservice:$TAG \
--target bookbrainz-webservice \
- --build-arg GIT_COMMIT_SHA=$(git rev-parse HEAD) \
+ --build-arg GIT_COMMIT_SHA=$(git rev-parse --short HEAD) \
--build-arg DEPLOY_ENV=webservice-$ENV .
RESULT=$?
if [ $RESULT -eq 0 ]; then
diff --git a/docker/push.sh b/docker/push.sh
index 7ff5432f18..f26566f607 100755
--- a/docker/push.sh
+++ b/docker/push.sh
@@ -20,7 +20,7 @@ TAG=${2:-beta}
echo "Building BookBrainz image with env $ENV tag $TAG and docker build target bookbrainz-prod"
docker build -t metabrainz/bookbrainz:$TAG \
--target bookbrainz-prod \
- --build-arg GIT_COMMIT_SHA=$(git rev-parse HEAD) \
+ --build-arg GIT_COMMIT_SHA=$(git rev-parse --short HEAD) \
--build-arg DEPLOY_ENV=$ENV .
RESULT=$?
if [ $RESULT -eq 0 ]; then
diff --git a/flow-typed/index.js b/flow-typed/index.js
deleted file mode 100644
index d22ffa90b3..0000000000
--- a/flow-typed/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright (C) 2017 Daniel Hsing
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
diff --git a/flow-typed/npm/body-parser_v1.x.x.js b/flow-typed/npm/body-parser_v1.x.x.js
deleted file mode 100644
index 5cecf02977..0000000000
--- a/flow-typed/npm/body-parser_v1.x.x.js
+++ /dev/null
@@ -1,50 +0,0 @@
-// flow-typed signature: 09c78e8e0a764f42b27e28c07db3604f
-// flow-typed version: c6154227d1/body-parser_v1.x.x/flow_>=v0.104.x
-
-import type { Middleware, $Request, $Response } from "express";
-
-declare type bodyParser$Options = {
- inflate?: boolean,
- limit?: number | string,
- type?: string | string[] | ((req: $Request) => any),
- verify?: (
- req: $Request,
- res: $Response,
- buf: Buffer,
- encoding: string
- ) => void,
- ...
-};
-
-declare type bodyParser$OptionsText = bodyParser$Options & {
- reviver?: (key: string, value: any) => any,
- strict?: boolean,
- ...
-};
-
-declare type bodyParser$OptionsJson = bodyParser$Options & {
- reviver?: (key: string, value: any) => any,
- strict?: boolean,
- ...
-};
-
-declare type bodyParser$OptionsUrlencoded = bodyParser$Options & {
- extended?: boolean,
- parameterLimit?: number,
- ...
-};
-
-declare module "body-parser" {
- declare type Options = bodyParser$Options;
- declare type OptionsText = bodyParser$OptionsText;
- declare type OptionsJson = bodyParser$OptionsJson;
- declare type OptionsUrlencoded = bodyParser$OptionsUrlencoded;
-
- declare function json(options?: OptionsJson): Middleware;
-
- declare function raw(options?: Options): Middleware;
-
- declare function text(options?: OptionsText): Middleware;
-
- declare function urlencoded(options?: OptionsUrlencoded): Middleware;
-}
diff --git a/flow-typed/npm/classnames_v2.x.x.js b/flow-typed/npm/classnames_v2.x.x.js
deleted file mode 100644
index 27057f0338..0000000000
--- a/flow-typed/npm/classnames_v2.x.x.js
+++ /dev/null
@@ -1,23 +0,0 @@
-// flow-typed signature: a00cf41b09af4862583460529d5cfcb9
-// flow-typed version: c6154227d1/classnames_v2.x.x/flow_>=v0.104.x
-
-type $npm$classnames$Classes =
- | string
- | { [className: string]: *, ... }
- | false
- | void
- | null;
-
-declare module "classnames" {
- declare module.exports: (
- ...classes: Array<$npm$classnames$Classes | $npm$classnames$Classes[]>
- ) => string;
-}
-
-declare module "classnames/bind" {
- declare module.exports: $Exports<"classnames">;
-}
-
-declare module "classnames/dedupe" {
- declare module.exports: $Exports<"classnames">;
-}
diff --git a/flow-typed/npm/compression_v1.x.x.js b/flow-typed/npm/compression_v1.x.x.js
deleted file mode 100644
index d3fadfbfa2..0000000000
--- a/flow-typed/npm/compression_v1.x.x.js
+++ /dev/null
@@ -1,76 +0,0 @@
-// flow-typed signature: f779dd6e26ad2caee47142c07c98d039
-// flow-typed version: df07c46603/compression_v1.x.x/flow_>=v0.100.x
-
-declare module 'compression' {
- declare function e(options?: e$CompressionOptions): any; // express.RequestHandler;
-
- declare var npm$namespace$e: {|
- filter: typeof e$filter,
- |};
-
- /**
- * Default filter, used for extending filter given in CompressionOptions
- * See https://github.com/expressjs/compression#filter-1 regarding the usage
- */
- declare export function e$filter(
- req: any, // express.Request,
- res: any // express.Response
- ): boolean;
-
- declare type e$CompressionFilter = {
- (
- req: any, // express.Request
- res: any // express.Response
- ): boolean,
- ...
- };
-
- declare type e$CompressionOptions = {|
- /**
- * See https://github.com/expressjs/compression#chunksize regarding the usage.
- */
- chunkSize?: number,
-
- /**
- * See https://github.com/expressjs/compression#level regarding the usage.
- */
- level?: number,
-
- /**
- * See https://github.com/expressjs/compression#memlevel regarding the usage.
- */
- memLevel?: number,
-
- /**
- * See https://github.com/expressjs/compression#strategy regarding the usage.
- */
- strategy?: number,
-
- /**
- * See https://github.com/expressjs/compression#threshold regarding the usage.
- */
- threshold?: number | string,
-
- /**
- * See https://github.com/expressjs/compression#windowbits regarding the usage.
- */
- windowBits?: number,
-
- /**
- * See https://github.com/expressjs/compression#filter regarding the usage.
- */
- filter?: e$CompressionFilter,
-
- /**
- * See https://nodejs.org/api/zlib.html#zlib_class_options regarding the usage.
- */
- flush?: number,
-
- /**
- * See https://nodejs.org/api/zlib.html#zlib_class_options regarding the usage.
- */
- finishFlush?: number,
- |};
-
- declare export default typeof e;
-}
diff --git a/flow-typed/npm/debug_v3.x.x.js b/flow-typed/npm/debug_v3.x.x.js
deleted file mode 100644
index 52b876ea9b..0000000000
--- a/flow-typed/npm/debug_v3.x.x.js
+++ /dev/null
@@ -1,29 +0,0 @@
-// flow-typed signature: 3dd5f501994df66e9e6ce163b23bf628
-// flow-typed version: c6154227d1/debug_v3.x.x/flow_>=v0.104.x
-
-declare module "debug" {
- declare type Debugger = {
- (...args: Array): void,
- (formatter: string, ...args: Array): void,
- (err: Error, ...args: Array): void,
- enabled: boolean,
- log: () => {...},
- namespace: string,
- ...
- };
-
- declare module.exports: (namespace: string) => Debugger;
-
- declare var names: Array;
- declare var skips: Array;
- declare var colors: Array;
-
- declare function disable(): void;
- declare function enable(namespaces: string): void;
- declare function enabled(name: string): boolean;
- declare function humanize(): void;
- declare function useColors(): boolean;
- declare function log(): void;
-
- declare var formatters: { [formatter: string]: () => {...}, ... };
-}
diff --git a/flow-typed/npm/express_v4.16.x.js b/flow-typed/npm/express_v4.16.x.js
deleted file mode 100644
index ca137ed564..0000000000
--- a/flow-typed/npm/express_v4.16.x.js
+++ /dev/null
@@ -1,353 +0,0 @@
-// flow-typed signature: 3fa3adb11d8c2067bf2b452932555988
-// flow-typed version: 2f514ea8dd/express_v4.16.x/flow_>=v0.104.x
-
-declare type express$RouterOptions = {
- caseSensitive?: boolean,
- mergeParams?: boolean,
- strict?: boolean,
- ...
-};
-
-declare class express$RequestResponseBase {
- app: express$Application;
- get(field: string): string | void;
-}
-
-declare type express$RequestParams = { [param: string]: string, ... };
-
-/*
- NOTE: Use caution when extending `express$Request` or `express$Response`. When
- a request first hits the server, its `req` and `res` will not have any
- additional properties, even if you explicitly type them with your custom
- subclass. Subsequent middleware may assign these properties, but you must be
- cognizant of this ordering. One way to handle this is marking all properties
- as optional to force refinement every time a property is accessed. Therefore,
- we advise that you always mark properties as _optional_ in `express$Request`
- and `express$Response` subclasses.
-
- You may decide not to do this, in which case the typings will be unsound and
- the behavior will be similar to how arrays work in Flow. See here for more
- information: https://flow.org/en/docs/types/arrays/#toc-array-access-is-unsafe
-
- See #3578 and #3337 for additional discussion. If you have ideas on how to
- improve these typings, please share them in #3578 or open a new issue.
-
- **BAD**
- declare class test_express$CustomRequest extends express$Request {
- foo: string;
- }
-
- **GOOD**
- declare class test_express$CustomRequest extends express$Request {
- foo: string | void;
- }
-*/
-declare class express$Request extends http$IncomingMessage mixins express$RequestResponseBase {
- baseUrl: string;
- body: mixed;
- cookies: { [cookie: string]: string, ... };
- connection: net$Socket;
- fresh: boolean;
- hostname: string;
- ip: string;
- ips: Array;
- method: string;
- originalUrl: string;
- params: express$RequestParams;
- path: string;
- protocol: "https" | "http";
- query: { [name: string]: string | Array, ... };
- route: string;
- secure: boolean;
- signedCookies: { [signedCookie: string]: string, ... };
- stale: boolean;
- subdomains: Array;
- xhr: boolean;
- accepts(types: string): string | false;
- accepts(types: Array): string | false;
- acceptsCharsets(...charsets: Array): string | false;
- acceptsEncodings(...encoding: Array): string | false;
- acceptsLanguages(...lang: Array): string | false;
- header(field: string): string | void;
- is(type: string): string | false;
- param(name: string, defaultValue?: string): string | void;
-}
-
-declare type express$CookieOptions = {
- domain?: string,
- encode?: (value: string) => string,
- expires?: Date,
- httpOnly?: boolean,
- maxAge?: number,
- path?: string,
- secure?: boolean,
- signed?: boolean,
- ...
-};
-
-declare type express$Path = string | RegExp;
-
-declare type express$RenderCallback = (
- err: Error | null,
- html?: string
-) => mixed;
-
-declare type express$SendFileOptions = {
- maxAge?: number,
- root?: string,
- lastModified?: boolean,
- headers?: { [name: string]: string, ... },
- dotfiles?: "allow" | "deny" | "ignore",
- ...
-};
-
-declare class express$Response extends http$ServerResponse mixins express$RequestResponseBase {
- headersSent: boolean;
- locals: { [name: string]: mixed, ... };
- append(field: string, value?: string): this;
- attachment(filename?: string): this;
- cookie(name: string, value: string, options?: express$CookieOptions): this;
- clearCookie(name: string, options?: express$CookieOptions): this;
- download(
- path: string,
- filename?: string,
- callback?: (err?: ?Error) => void
- ): this;
- format(typesObject: { [type: string]: Function, ... }): this;
- json(body?: mixed): this;
- jsonp(body?: mixed): this;
- links(links: { [name: string]: string, ... }): this;
- location(path: string): this;
- redirect(url: string, ...args: Array): this;
- redirect(status: number, url: string, ...args: Array): this;
- render(
- view: string,
- locals?: { [name: string]: mixed, ... },
- callback?: express$RenderCallback
- ): this;
- send(body?: mixed): this;
- sendFile(
- path: string,
- options?: express$SendFileOptions,
- callback?: (err?: ?Error) => mixed
- ): this;
- sendStatus(statusCode: number): this;
- header(field: string, value?: string): this;
- header(headers: { [name: string]: string, ... }): this;
- set(field: string, value?: string | string[]): this;
- set(headers: { [name: string]: string, ... }): this;
- status(statusCode: number): this;
- type(type: string): this;
- vary(field: string): this;
- req: express$Request;
-}
-
-declare type express$NextFunction = (err?: ?Error | "route") => mixed;
-declare type express$Middleware<
- Req: express$Request = express$Request,
- Res: express$Response = express$Response,
-> =
- ((req: Req, res: Res, next: express$NextFunction) => mixed) |
- ((error: Error, req: Req, res: Res, next: express$NextFunction) => mixed);
-
-declare interface express$RouteMethodType<
- T,
- Req: express$Request = express$Request,
- Res: express$Response = express$Response,
-> {
- (middleware: express$Middleware): T;
- (...middleware: Array>): T;
- (
- path: express$Path | $ReadOnlyArray,
- ...middleware: Array>
- ): T;
-}
-
-declare class express$Route<
- Req: express$Request = express$Request,
- Res: express$Response = express$Response,
-> {
- all: express$RouteMethodType;
- get: express$RouteMethodType;
- post: express$RouteMethodType;
- put: express$RouteMethodType;
- head: express$RouteMethodType;
- delete: express$RouteMethodType;
- options: express$RouteMethodType;
- trace: express$RouteMethodType;
- copy: express$RouteMethodType;
- lock: express$RouteMethodType;
- mkcol: express$RouteMethodType;
- move: express$RouteMethodType;
- purge: express$RouteMethodType;
- propfind: express$RouteMethodType;
- proppatch: express$RouteMethodType;
- unlock: express$RouteMethodType;
- report: express$RouteMethodType;
- mkactivity: express$RouteMethodType;
- checkout: express$RouteMethodType;
- merge: express$RouteMethodType;
-
- // @TODO Missing 'm-search' but get flow illegal name error.
-
- notify: express$RouteMethodType;
- subscribe: express$RouteMethodType;
- unsubscribe: express$RouteMethodType;
- patch: express$RouteMethodType;
- search: express$RouteMethodType;
- connect: express$RouteMethodType;
-}
-
-declare class express$Router<
- Req: express$Request = express$Request,
- Res: express$Response = express$Response,
-> extends express$Route {
- constructor(options?: express$RouterOptions): void;
- route(path: string): express$Route;
- static (
- options?: express$RouterOptions,
- ): express$Router;
- use(middleware: express$Middleware): this;
- use(...middleware: Array>): this;
- use(
- path: express$Path | $ReadOnlyArray,
- ...middleware: Array>
- ): this;
- use(path: string, router: express$Router): this;
- handle(
- req: http$IncomingMessage<>,
- res: http$ServerResponse,
- next: express$NextFunction
- ): void;
- param(
- param: string,
- callback: (
- req: Req,
- res: Res,
- next: express$NextFunction,
- value: string,
- paramName: string,
- ) => mixed
- ): void;
- (
- req: http$IncomingMessage<>,
- res: http$ServerResponse,
- next?: ?express$NextFunction
- ): void;
-}
-
-/*
-With flow-bin ^0.59, express app.listen() is deemed to return any and fails flow type coverage.
-Which is ironic because https://github.com/facebook/flow/blob/master/Changelog.md#misc-2 (release notes for 0.59)
-says "Improves typings for Node.js HTTP server listen() function." See that? IMPROVES!
-To work around this issue, we changed Server to ?Server here, so that our invocations of express.listen() will
-not be deemed to lack type coverage.
-*/
-
-declare class express$Application<
- Req: express$Request = express$Request,
- Res: express$Response = express$Response,
-> extends express$Router mixins events$EventEmitter {
- constructor(): void;
- locals: { [name: string]: mixed, ... };
- mountpath: string;
- listen(
- port: number,
- hostname?: string,
- backlog?: number,
- callback?: (err?: ?Error) => mixed
- ): ?http$Server;
- listen(
- port: number,
- hostname?: string,
- callback?: (err?: ?Error) => mixed
- ): ?http$Server;
- listen(port: number, callback?: (err?: ?Error) => mixed): ?http$Server;
- listen(path: string, callback?: (err?: ?Error) => mixed): ?http$Server;
- listen(handle: Object, callback?: (err?: ?Error) => mixed): ?http$Server;
- disable(name: string): void;
- disabled(name: string): boolean;
- enable(name: string): this;
- enabled(name: string): boolean;
- engine(name: string, callback: Function): void;
- /**
- * Mixed will not be taken as a value option. Issue around using the GET http method name and the get for settings.
- */
- // get(name: string): mixed;
- set(name: string, value: mixed): mixed;
- render(
- name: string,
- optionsOrFunction: { [name: string]: mixed, ... },
- callback: express$RenderCallback
- ): void;
- handle(
- req: http$IncomingMessage<>,
- res: http$ServerResponse,
- next?: ?express$NextFunction
- ): void;
- // callable signature is not inherited
- (
- req: http$IncomingMessage<>,
- res: http$ServerResponse,
- next?: ?express$NextFunction
- ): void;
-}
-
-declare type JsonOptions = {
- inflate?: boolean,
- limit?: string | number,
- reviver?: (key: string, value: mixed) => mixed,
- strict?: boolean,
- type?: string | Array | ((req: express$Request) => boolean),
- verify?: (
- req: express$Request,
- res: express$Response,
- buf: Buffer,
- encoding: string
- ) => mixed,
- ...
-};
-
-declare type express$UrlEncodedOptions = {
- extended?: boolean,
- inflate?: boolean,
- limit?: string | number,
- parameterLimit?: number,
- type?: string | Array | ((req: express$Request) => boolean),
- verify?: (
- req: express$Request,
- res: express$Response,
- buf: Buffer,
- encoding: string
- ) => mixed,
- ...
-}
-
-declare module "express" {
- declare export type RouterOptions = express$RouterOptions;
- declare export type CookieOptions = express$CookieOptions;
- declare export type Middleware<
- Req: express$Request = express$Request,
- Res: express$Response = express$Response,
- > = express$Middleware;
- declare export type NextFunction = express$NextFunction;
- declare export type RequestParams = express$RequestParams;
- declare export type $Response = express$Response;
- declare export type $Request = express$Request;
- declare export type $Application<
- Req: express$Request = express$Request,
- Res: express$Response = express$Response,
- > = express$Application;
-
- declare module.exports: {
- // If you try to call like a function, it will use this signature
- (): express$Application,
- json: (opts: ?JsonOptions) => express$Middleware<>,
- // `static` property on the function
- static: (root: string, options?: Object) => express$Middleware,
- // `Router` property on the function
- Router: typeof express$Router,
- urlencoded: (opts: ?express$UrlEncodedOptions) => express$Middleware<>,
- ...
- };
-}
diff --git a/flow-typed/npm/http-status_v1.x.x.js b/flow-typed/npm/http-status_v1.x.x.js
deleted file mode 100644
index baa67df223..0000000000
--- a/flow-typed/npm/http-status_v1.x.x.js
+++ /dev/null
@@ -1,128 +0,0 @@
-// flow-typed signature: 4461d50d89501519eef599d974593e30
-// flow-typed version: c6154227d1/http-status_v1.x.x/flow_>=v0.104.x
-
-declare module 'http-status' {
- declare module.exports: {
- '100': 'Continue',
- '101': 'Switching Protocols',
- '200': 'OK',
- '201': 'Created',
- '202': 'Accepted',
- '203': 'Non-Authoritative Information',
- '204': 'No Content',
- '205': 'Reset Content',
- '206': 'Partial Content',
- '207': 'Multi Status',
- '208': 'Already Reported',
- '226': 'IM Used',
- '300': 'Multiple Choices',
- '301': 'Moved Permanently',
- '302': 'Found',
- '303': 'See Other',
- '304': 'Not Modified',
- '305': 'Use Proxy',
- '306': 'Switch Proxy',
- '307': 'Temporary Redirect',
- '308': 'Permanent Redirect',
- '400': 'Bad Request',
- '401': 'Unauthorized',
- '402': 'Payment Required',
- '403': 'Forbidden',
- '404': 'Not Found',
- '405': 'Method Not Allowed',
- '406': 'Not Acceptable',
- '407': 'Proxy Authentication Required',
- '408': 'Request Time-out',
- '409': 'Conflict',
- '410': 'Gone',
- '411': 'Length Required',
- '412': 'Precondition Failed',
- '413': 'Request Entity Too Large',
- '414': 'Request-URI Too Large',
- '415': 'Unsupported Media Type',
- '416': 'Requested Range not Satisfiable',
- '417': 'Expectation Failed',
- '418': "I'm a teapot",
- '421': 'Misdirected Request',
- '422': 'Unprocessable Entity',
- '423': 'Locked',
- '424': 'Failed Dependency',
- '426': 'Upgrade Required',
- '428': 'Precondition Required',
- '429': 'Too Many Requests',
- '431': 'Request Header Fields Too Large',
- '451': 'Unavailable For Legal Reasons',
- '500': 'Internal Server Error',
- '501': 'Not Implemented',
- '502': 'Bad Gateway',
- '503': 'Service Unavailable',
- '504': 'Gateway Time-out',
- '505': 'HTTP Version not Supported',
- '506': 'Variant Also Negotiates',
- '507': 'Insufficient Storage',
- '508': 'Loop Detected',
- '510': 'Not Extended',
- '511': 'Network Authentication Required',
- CONTINUE: 100,
- SWITCHING_PROTOCOLS: 101,
- OK: 200,
- CREATED: 201,
- ACCEPTED: 202,
- NON_AUTHORITATIVE_INFORMATION: 203,
- NO_CONTENT: 204,
- RESET_CONTENT: 205,
- PARTIAL_CONTENT: 206,
- MULTI_STATUS: 207,
- ALREADY_REPORTED: 208,
- IM_USED: 226,
- MULTIPLE_CHOICES: 300,
- MOVED_PERMANENTLY: 301,
- FOUND: 302,
- SEE_OTHER: 303,
- NOT_MODIFIED: 304,
- USE_PROXY: 305,
- SWITCH_PROXY: 306,
- TEMPORARY_REDIRECT: 307,
- PERMANENT_REDIRECT: 308,
- BAD_REQUEST: 400,
- UNAUTHORIZED: 401,
- PAYMENT_REQUIRED: 402,
- FORBIDDEN: 403,
- NOT_FOUND: 404,
- METHOD_NOT_ALLOWED: 405,
- NOT_ACCEPTABLE: 406,
- PROXY_AUTHENTICATION_REQUIRED: 407,
- REQUEST_TIMEOUT: 408,
- CONFLICT: 409,
- GONE: 410,
- LENGTH_REQUIRED: 411,
- PRECONDITION_FAILED: 412,
- REQUEST_ENTITY_TOO_LARGE: 413,
- REQUEST_URI_TOO_LONG: 414,
- UNSUPPORTED_MEDIA_TYPE: 415,
- REQUESTED_RANGE_NOT_SATISFIABLE: 416,
- EXPECTATION_FAILED: 417,
- IM_A_TEAPOT: 418,
- MISDIRECTED_REQUEST: 421,
- UNPROCESSABLE_ENTITY: 422,
- UPGRADE_REQUIRED: 426,
- PRECONDITION_REQUIRED: 428,
- LOCKED: 423,
- FAILED_DEPENDENCY: 424,
- TOO_MANY_REQUESTS: 429,
- REQUEST_HEADER_FIELDS_TOO_LARGE: 431,
- UNAVAILABLE_FOR_LEGAL_REASONS: 451,
- INTERNAL_SERVER_ERROR: 500,
- NOT_IMPLEMENTED: 501,
- BAD_GATEWAY: 502,
- SERVICE_UNAVAILABLE: 503,
- GATEWAY_TIMEOUT: 504,
- HTTP_VERSION_NOT_SUPPORTED: 505,
- VARIANT_ALSO_NEGOTIATES: 506,
- INSUFFICIENT_STORAGE: 507,
- LOOP_DETECTED: 508,
- NOT_EXTENDED: 510,
- NETWORK_AUTHENTICATION_REQUIRED: 511,
- ...
- };
-}
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 9370fc4898..0000000000
--- a/flow-typed/npm/lodash_v4.x.x.js
+++ /dev/null
@@ -1,6113 +0,0 @@
-// flow-typed signature: 1ef367da1bb1b9d6ec1962296ee3afc0
-// flow-typed version: 2f1ddf67d5/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$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