├── .babelrc
├── .flowconfig
├── .gitignore
├── .nvmrc
├── .prettierignore
├── .prettierrc
├── .storybook
└── config.js
├── .travis.yml
├── Readme.md
├── examples
├── chat.js
├── images.js
└── index.js
├── flow-typed
└── npm
│ ├── @storybook
│ └── react_v3.x.x.js
│ ├── babel-cli_vx.x.x.js
│ ├── babel-plugin-transform-class-properties_vx.x.x.js
│ ├── babel-plugin-transform-flow-strip-types_vx.x.x.js
│ ├── babel-plugin-transform-object-rest-spread_vx.x.x.js
│ ├── babel-preset-env_vx.x.x.js
│ ├── babel-preset-react_vx.x.x.js
│ ├── casual-browserify_vx.x.x.js
│ ├── flow-bin_v0.x.x.js
│ ├── flow-copy-source_vx.x.x.js
│ ├── husky_vx.x.x.js
│ ├── jest_v23.x.x.js
│ ├── lodash_v4.x.x.js
│ ├── prettier_v1.x.x.js
│ └── pretty-quick_vx.x.x.js
├── package-lock.json
├── package.json
└── src
├── __test__
└── index.test.js
└── index.js
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [["env"], "react"],
3 | "plugins": ["transform-class-properties", "transform-object-rest-spread"]
4 | }
5 |
--------------------------------------------------------------------------------
/.flowconfig:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skrivle/react-inverted-scrollview/e0e44c544b1c481077560e5662b8036ad2e57850/.flowconfig
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules/
3 | *.log
4 | lib/
5 |
--------------------------------------------------------------------------------
/.nvmrc:
--------------------------------------------------------------------------------
1 | v10.3.0
2 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | /flow-typed
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "tabWidth": 4,
3 | "singleQuote": true,
4 | "printWidth": 100
5 | }
6 |
--------------------------------------------------------------------------------
/.storybook/config.js:
--------------------------------------------------------------------------------
1 | import { configure } from '@storybook/react';
2 |
3 | function loadStories() {
4 | require('../examples');
5 | }
6 |
7 | configure(loadStories, module);
8 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: "node_js"
2 | node_js:
3 | - "10"
4 |
--------------------------------------------------------------------------------
/Readme.md:
--------------------------------------------------------------------------------
1 | [](https://travis-ci.org/vejersele/react-inverted-scrollview)
2 |
3 | # React Inverted ScrollView
4 |
5 | Easily support inverted scrolling in for example chat apps. Maintains a correct scroll position when new content is added.
6 |
7 | ## Installation:
8 |
9 | ```
10 | npm install react-inverted-scrollview --save
11 | ```
12 |
13 | ## Example:
14 |
15 | ```javascript
16 | import _ from 'lodash';
17 | import React, { Component } from 'react';
18 | import ScrollView from 'react-inverted-scrollview';
19 |
20 | class MyComponent extends Component {
21 | state = {
22 | messages: _.range(30).map(index => ({
23 | id: index,
24 | text: `message-${index}`
25 | }))
26 | };
27 |
28 | scrollToBottom() {
29 | if (!this.scrollView) return;
30 | this.scrollView.scrollToBottom();
31 | }
32 |
33 | scrollToTop() {
34 | if (!this.scrollView) return;
35 | this.scrollView.scrollToTop();
36 | }
37 |
38 | handleScroll = ({ scrollTop, scrollBottom }) => {
39 | console.log('scrollTop', scrollTop);
40 | console.log('scrollBottom', scrollBottom);
41 | };
42 |
43 | render() {
44 | const { messages } = this.state;
45 | return (
46 | (this.scrollView = ref)}
50 | onScroll={this.handleScroll}
51 | >
52 | {messages.map(message => {message.text}
)}
53 |
54 | );
55 | }
56 | }
57 | ```
58 |
59 | ## API
60 |
61 | ### Props
62 |
63 | | Prop | Type | Default |
64 | | ----------------------------- | ---------------------------------------------------------- | -------- |
65 | | width | number | 100 |
66 | | height | number | 100 |
67 | | onScroll | (info: { scrollBottom: number, scrollTop: number }) => any | () => {} |
68 | | style | Object {} | {} |
69 | | restoreScrollPositionOnUpdate | boolean | true |
70 | | children | React.Node or ({restoreScrollPosition}) => Node | Node |
71 |
72 | ### Instance methods
73 |
74 | ```javascript
75 | instance.scrollToBottom();
76 | instance.scrollToTop();
77 | instance.setScrollBottom(value);
78 | instance.setScrollTop(value);
79 | instance.restoreScrollPosition();
80 | ```
81 |
82 | ## Check out the examples:
83 |
84 | ```
85 | git clone https://github.com/vejersele/react-inverted-scrollview.git
86 | cd react-inverted-scrollview
87 | npm install
88 | npm run storybook
89 | ```
90 |
--------------------------------------------------------------------------------
/examples/chat.js:
--------------------------------------------------------------------------------
1 | // @flow
2 |
3 | import React, { Component } from 'react';
4 | import { storiesOf } from '@storybook/react';
5 | import ScrollView from '../src/';
6 | import casual from 'casual-browserify';
7 | import _ from 'lodash';
8 |
9 | const generateMessages = amount =>
10 | _.range(amount).map(() => ({
11 | id: casual.uuid,
12 | text: casual.description,
13 | user: casual.name
14 | }));
15 |
16 | const fetchOlderMessages = () =>
17 | new Promise(resolve => {
18 | setTimeout(() => {
19 | resolve(generateMessages(10));
20 | }, Math.max(500, Math.round(Math.random() * 2000)));
21 | });
22 |
23 | const Message = ({ message }) => (
24 |
25 | {message.user} : {message.text}
26 |
27 | );
28 |
29 | type State = {
30 | input: string,
31 | messages: Array<{ text: string, id: string, user: string }>,
32 | isLoading: boolean
33 | };
34 |
35 | class Chat extends Component<{}, State> {
36 | input: ?HTMLElement;
37 | scrollView: ?ScrollView;
38 |
39 | state = {
40 | input: '',
41 | messages: generateMessages(10),
42 | isLoading: false
43 | };
44 |
45 | componentDidMount() {
46 | if (!this.input) return;
47 | this.input.focus();
48 | }
49 |
50 | handleSubmit = e => {
51 | e.preventDefault();
52 |
53 | if (this.state.input === '') return;
54 |
55 | this.setState(
56 | state => ({
57 | messages: [...state.messages, { text: state.input, id: casual.uuid, user: 'me' }],
58 | input: ''
59 | }),
60 | () => {
61 | this.scrollToBottom();
62 | }
63 | );
64 | };
65 |
66 | scrollToBottom() {
67 | if (!this.scrollView) return;
68 | this.scrollView.scrollToBottom();
69 | }
70 |
71 | handleScroll = ({ scrollTop, scrollBottom }) => {
72 | const { isLoading } = this.state;
73 |
74 | if (isLoading || scrollTop > 100) return;
75 |
76 | this.setState({ isLoading: true });
77 |
78 | fetchOlderMessages().then(olderMessages => {
79 | this.setState(({ messages }) => ({
80 | isLoading: false,
81 | messages: [...olderMessages, ...messages]
82 | }));
83 | });
84 | };
85 |
86 | render() {
87 | const { messages, input, isLoading } = this.state;
88 |
89 | return (
90 |
91 |
(this.scrollView = ref)}
94 | height={300}
95 | width={300}
96 | >
97 | {isLoading ? (
98 |
99 | Loading ...
100 |
101 | ) : null}
102 |
103 | {messages.map(message => )}
104 |
105 |
106 |
107 |
115 |
116 |
117 | );
118 | }
119 | }
120 |
121 | storiesOf('Chat', module).add('Chat', () => (
122 |
123 |
124 |
125 | ));
126 |
--------------------------------------------------------------------------------
/examples/images.js:
--------------------------------------------------------------------------------
1 | // @flow
2 |
3 | import _ from 'lodash';
4 | import { storiesOf } from '@storybook/react';
5 | import React, { Component } from 'react';
6 | import ScrollView from '../src/index';
7 |
8 | const ImageList = () => (
9 | {
11 | console.log('scrollTop', scrollTop);
12 | console.log('scrollBottom', scrollBottom);
13 | }}
14 | height={500}
15 | width={300}
16 | >
17 | {({ restoreScrollPosition }) =>
18 | _.range(10).map(i => (
19 |
20 |

restoreScrollPosition()}
24 | />
25 |
26 | ))
27 | }
28 |
29 | );
30 |
31 | storiesOf('ImageList', module).add('ImageList', () => (
32 |
33 |
34 |
35 | ));
36 |
--------------------------------------------------------------------------------
/examples/index.js:
--------------------------------------------------------------------------------
1 | import './chat';
2 | import './images';
3 |
--------------------------------------------------------------------------------
/flow-typed/npm/@storybook/react_v3.x.x.js:
--------------------------------------------------------------------------------
1 | // flow-typed signature: 1aeadf523ef2d96985697463dd71c89d
2 | // flow-typed version: 35108faf5b/@storybook/react_v3.x.x/flow_>=v0.72.x
3 |
4 | type NodeModule = typeof module;
5 |
6 | declare module '@storybook/react' {
7 | declare type Context = { kind: string, story: string };
8 | declare type Renderable = React$Element<*>;
9 | declare type RenderCallback = (context: Context) => Renderable | Array;
10 | declare type RenderFunction = () => Renderable | Array;
11 |
12 | declare type StoryDecorator = (story: RenderFunction, context: Context) => Renderable | null;
13 |
14 | declare interface Story {
15 | +kind: string;
16 | add(storyName: string, callback: RenderCallback): Story;
17 | addDecorator(decorator: StoryDecorator): Story;
18 | }
19 |
20 | declare interface StoryObject {
21 | name: string;
22 | render: RenderFunction;
23 | }
24 |
25 | declare interface StoryBucket {
26 | kind: string;
27 | filename: string;
28 | stories: Array;
29 | }
30 |
31 | declare function addDecorator(decorator: StoryDecorator): void;
32 | declare function configure(fn: () => void, module: NodeModule): void;
33 | declare function setAddon(addon: Object): void;
34 | declare function storiesOf(name: string, module: NodeModule): Story;
35 | declare function storiesOf(name: string, module: NodeModule): Story & T;
36 | declare function forceReRender(): void;
37 |
38 | declare function getStorybook(): Array;
39 | }
40 |
--------------------------------------------------------------------------------
/flow-typed/npm/babel-cli_vx.x.x.js:
--------------------------------------------------------------------------------
1 | // flow-typed signature: 89ccd8f6b78c4893189f4d37a1275ff7
2 | // flow-typed version: <>/babel-cli_v^6.26.0/flow_v0.103.0
3 |
4 | /**
5 | * This is an autogenerated libdef stub for:
6 | *
7 | * 'babel-cli'
8 | *
9 | * Fill this stub out by replacing all the `any` types.
10 | *
11 | * Once filled out, we encourage you to share your work with the
12 | * community by sending a pull request to:
13 | * https://github.com/flowtype/flow-typed
14 | */
15 |
16 | declare module 'babel-cli' {
17 | declare module.exports: any;
18 | }
19 |
20 | /**
21 | * We include stubs for each file inside this npm package in case you need to
22 | * require those files directly. Feel free to delete any files that aren't
23 | * needed.
24 | */
25 | declare module 'babel-cli/bin/babel-doctor' {
26 | declare module.exports: any;
27 | }
28 |
29 | declare module 'babel-cli/bin/babel-external-helpers' {
30 | declare module.exports: any;
31 | }
32 |
33 | declare module 'babel-cli/bin/babel-node' {
34 | declare module.exports: any;
35 | }
36 |
37 | declare module 'babel-cli/bin/babel' {
38 | declare module.exports: any;
39 | }
40 |
41 | declare module 'babel-cli/lib/_babel-node' {
42 | declare module.exports: any;
43 | }
44 |
45 | declare module 'babel-cli/lib/babel-external-helpers' {
46 | declare module.exports: any;
47 | }
48 |
49 | declare module 'babel-cli/lib/babel-node' {
50 | declare module.exports: any;
51 | }
52 |
53 | declare module 'babel-cli/lib/babel/dir' {
54 | declare module.exports: any;
55 | }
56 |
57 | declare module 'babel-cli/lib/babel/file' {
58 | declare module.exports: any;
59 | }
60 |
61 | declare module 'babel-cli/lib/babel' {
62 | declare module.exports: any;
63 | }
64 |
65 | declare module 'babel-cli/lib/babel/util' {
66 | declare module.exports: any;
67 | }
68 |
69 | // Filename aliases
70 | declare module 'babel-cli/bin/babel-doctor.js' {
71 | declare module.exports: $Exports<'babel-cli/bin/babel-doctor'>;
72 | }
73 | declare module 'babel-cli/bin/babel-external-helpers.js' {
74 | declare module.exports: $Exports<'babel-cli/bin/babel-external-helpers'>;
75 | }
76 | declare module 'babel-cli/bin/babel-node.js' {
77 | declare module.exports: $Exports<'babel-cli/bin/babel-node'>;
78 | }
79 | declare module 'babel-cli/bin/babel.js' {
80 | declare module.exports: $Exports<'babel-cli/bin/babel'>;
81 | }
82 | declare module 'babel-cli/index' {
83 | declare module.exports: $Exports<'babel-cli'>;
84 | }
85 | declare module 'babel-cli/index.js' {
86 | declare module.exports: $Exports<'babel-cli'>;
87 | }
88 | declare module 'babel-cli/lib/_babel-node.js' {
89 | declare module.exports: $Exports<'babel-cli/lib/_babel-node'>;
90 | }
91 | declare module 'babel-cli/lib/babel-external-helpers.js' {
92 | declare module.exports: $Exports<'babel-cli/lib/babel-external-helpers'>;
93 | }
94 | declare module 'babel-cli/lib/babel-node.js' {
95 | declare module.exports: $Exports<'babel-cli/lib/babel-node'>;
96 | }
97 | declare module 'babel-cli/lib/babel/dir.js' {
98 | declare module.exports: $Exports<'babel-cli/lib/babel/dir'>;
99 | }
100 | declare module 'babel-cli/lib/babel/file.js' {
101 | declare module.exports: $Exports<'babel-cli/lib/babel/file'>;
102 | }
103 | declare module 'babel-cli/lib/babel/index' {
104 | declare module.exports: $Exports<'babel-cli/lib/babel'>;
105 | }
106 | declare module 'babel-cli/lib/babel/index.js' {
107 | declare module.exports: $Exports<'babel-cli/lib/babel'>;
108 | }
109 | declare module 'babel-cli/lib/babel/util.js' {
110 | declare module.exports: $Exports<'babel-cli/lib/babel/util'>;
111 | }
112 |
--------------------------------------------------------------------------------
/flow-typed/npm/babel-plugin-transform-class-properties_vx.x.x.js:
--------------------------------------------------------------------------------
1 | // flow-typed signature: ba19ceb3d1c9382a157deae682c377a8
2 | // flow-typed version: <>/babel-plugin-transform-class-properties_v^6.24.1/flow_v0.103.0
3 |
4 | /**
5 | * This is an autogenerated libdef stub for:
6 | *
7 | * 'babel-plugin-transform-class-properties'
8 | *
9 | * Fill this stub out by replacing all the `any` types.
10 | *
11 | * Once filled out, we encourage you to share your work with the
12 | * community by sending a pull request to:
13 | * https://github.com/flowtype/flow-typed
14 | */
15 |
16 | declare module 'babel-plugin-transform-class-properties' {
17 | declare module.exports: any;
18 | }
19 |
20 | /**
21 | * We include stubs for each file inside this npm package in case you need to
22 | * require those files directly. Feel free to delete any files that aren't
23 | * needed.
24 | */
25 | declare module 'babel-plugin-transform-class-properties/lib' {
26 | declare module.exports: any;
27 | }
28 |
29 | // Filename aliases
30 | declare module 'babel-plugin-transform-class-properties/lib/index' {
31 | declare module.exports: $Exports<'babel-plugin-transform-class-properties/lib'>;
32 | }
33 | declare module 'babel-plugin-transform-class-properties/lib/index.js' {
34 | declare module.exports: $Exports<'babel-plugin-transform-class-properties/lib'>;
35 | }
36 |
--------------------------------------------------------------------------------
/flow-typed/npm/babel-plugin-transform-flow-strip-types_vx.x.x.js:
--------------------------------------------------------------------------------
1 | // flow-typed signature: 6703bae7be440cfc0432158d1df1f402
2 | // flow-typed version: <>/babel-plugin-transform-flow-strip-types_v^6.22.0/flow_v0.103.0
3 |
4 | /**
5 | * This is an autogenerated libdef stub for:
6 | *
7 | * 'babel-plugin-transform-flow-strip-types'
8 | *
9 | * Fill this stub out by replacing all the `any` types.
10 | *
11 | * Once filled out, we encourage you to share your work with the
12 | * community by sending a pull request to:
13 | * https://github.com/flowtype/flow-typed
14 | */
15 |
16 | declare module 'babel-plugin-transform-flow-strip-types' {
17 | declare module.exports: any;
18 | }
19 |
20 | /**
21 | * We include stubs for each file inside this npm package in case you need to
22 | * require those files directly. Feel free to delete any files that aren't
23 | * needed.
24 | */
25 | declare module 'babel-plugin-transform-flow-strip-types/lib' {
26 | declare module.exports: any;
27 | }
28 |
29 | // Filename aliases
30 | declare module 'babel-plugin-transform-flow-strip-types/lib/index' {
31 | declare module.exports: $Exports<'babel-plugin-transform-flow-strip-types/lib'>;
32 | }
33 | declare module 'babel-plugin-transform-flow-strip-types/lib/index.js' {
34 | declare module.exports: $Exports<'babel-plugin-transform-flow-strip-types/lib'>;
35 | }
36 |
--------------------------------------------------------------------------------
/flow-typed/npm/babel-plugin-transform-object-rest-spread_vx.x.x.js:
--------------------------------------------------------------------------------
1 | // flow-typed signature: 8a2a98aafa2a9bab25d30c40a81386ad
2 | // flow-typed version: <>/babel-plugin-transform-object-rest-spread_v^6.26.0/flow_v0.103.0
3 |
4 | /**
5 | * This is an autogenerated libdef stub for:
6 | *
7 | * 'babel-plugin-transform-object-rest-spread'
8 | *
9 | * Fill this stub out by replacing all the `any` types.
10 | *
11 | * Once filled out, we encourage you to share your work with the
12 | * community by sending a pull request to:
13 | * https://github.com/flowtype/flow-typed
14 | */
15 |
16 | declare module 'babel-plugin-transform-object-rest-spread' {
17 | declare module.exports: any;
18 | }
19 |
20 | /**
21 | * We include stubs for each file inside this npm package in case you need to
22 | * require those files directly. Feel free to delete any files that aren't
23 | * needed.
24 | */
25 | declare module 'babel-plugin-transform-object-rest-spread/lib' {
26 | declare module.exports: any;
27 | }
28 |
29 | // Filename aliases
30 | declare module 'babel-plugin-transform-object-rest-spread/lib/index' {
31 | declare module.exports: $Exports<'babel-plugin-transform-object-rest-spread/lib'>;
32 | }
33 | declare module 'babel-plugin-transform-object-rest-spread/lib/index.js' {
34 | declare module.exports: $Exports<'babel-plugin-transform-object-rest-spread/lib'>;
35 | }
36 |
--------------------------------------------------------------------------------
/flow-typed/npm/babel-preset-env_vx.x.x.js:
--------------------------------------------------------------------------------
1 | // flow-typed signature: 18b0ad2257916e44eca45b1b1997dd55
2 | // flow-typed version: <>/babel-preset-env_v^1.7.0/flow_v0.103.0
3 |
4 | /**
5 | * This is an autogenerated libdef stub for:
6 | *
7 | * 'babel-preset-env'
8 | *
9 | * Fill this stub out by replacing all the `any` types.
10 | *
11 | * Once filled out, we encourage you to share your work with the
12 | * community by sending a pull request to:
13 | * https://github.com/flowtype/flow-typed
14 | */
15 |
16 | declare module 'babel-preset-env' {
17 | declare module.exports: any;
18 | }
19 |
20 | /**
21 | * We include stubs for each file inside this npm package in case you need to
22 | * require those files directly. Feel free to delete any files that aren't
23 | * needed.
24 | */
25 | declare module 'babel-preset-env/data/built-in-features' {
26 | declare module.exports: any;
27 | }
28 |
29 | declare module 'babel-preset-env/data/plugin-features' {
30 | declare module.exports: any;
31 | }
32 |
33 | declare module 'babel-preset-env/lib/default-includes' {
34 | declare module.exports: any;
35 | }
36 |
37 | declare module 'babel-preset-env/lib' {
38 | declare module.exports: any;
39 | }
40 |
41 | declare module 'babel-preset-env/lib/module-transformations' {
42 | declare module.exports: any;
43 | }
44 |
45 | declare module 'babel-preset-env/lib/normalize-options' {
46 | declare module.exports: any;
47 | }
48 |
49 | declare module 'babel-preset-env/lib/targets-parser' {
50 | declare module.exports: any;
51 | }
52 |
53 | declare module 'babel-preset-env/lib/transform-polyfill-require-plugin' {
54 | declare module.exports: any;
55 | }
56 |
57 | declare module 'babel-preset-env/lib/utils' {
58 | declare module.exports: any;
59 | }
60 |
61 | // Filename aliases
62 | declare module 'babel-preset-env/data/built-in-features.js' {
63 | declare module.exports: $Exports<'babel-preset-env/data/built-in-features'>;
64 | }
65 | declare module 'babel-preset-env/data/plugin-features.js' {
66 | declare module.exports: $Exports<'babel-preset-env/data/plugin-features'>;
67 | }
68 | declare module 'babel-preset-env/lib/default-includes.js' {
69 | declare module.exports: $Exports<'babel-preset-env/lib/default-includes'>;
70 | }
71 | declare module 'babel-preset-env/lib/index' {
72 | declare module.exports: $Exports<'babel-preset-env/lib'>;
73 | }
74 | declare module 'babel-preset-env/lib/index.js' {
75 | declare module.exports: $Exports<'babel-preset-env/lib'>;
76 | }
77 | declare module 'babel-preset-env/lib/module-transformations.js' {
78 | declare module.exports: $Exports<'babel-preset-env/lib/module-transformations'>;
79 | }
80 | declare module 'babel-preset-env/lib/normalize-options.js' {
81 | declare module.exports: $Exports<'babel-preset-env/lib/normalize-options'>;
82 | }
83 | declare module 'babel-preset-env/lib/targets-parser.js' {
84 | declare module.exports: $Exports<'babel-preset-env/lib/targets-parser'>;
85 | }
86 | declare module 'babel-preset-env/lib/transform-polyfill-require-plugin.js' {
87 | declare module.exports: $Exports<'babel-preset-env/lib/transform-polyfill-require-plugin'>;
88 | }
89 | declare module 'babel-preset-env/lib/utils.js' {
90 | declare module.exports: $Exports<'babel-preset-env/lib/utils'>;
91 | }
92 |
--------------------------------------------------------------------------------
/flow-typed/npm/babel-preset-react_vx.x.x.js:
--------------------------------------------------------------------------------
1 | // flow-typed signature: f5d51cf2f5fef48636d23680801eed45
2 | // flow-typed version: <>/babel-preset-react_v^6.24.1/flow_v0.103.0
3 |
4 | /**
5 | * This is an autogenerated libdef stub for:
6 | *
7 | * 'babel-preset-react'
8 | *
9 | * Fill this stub out by replacing all the `any` types.
10 | *
11 | * Once filled out, we encourage you to share your work with the
12 | * community by sending a pull request to:
13 | * https://github.com/flowtype/flow-typed
14 | */
15 |
16 | declare module 'babel-preset-react' {
17 | declare module.exports: any;
18 | }
19 |
20 | /**
21 | * We include stubs for each file inside this npm package in case you need to
22 | * require those files directly. Feel free to delete any files that aren't
23 | * needed.
24 | */
25 | declare module 'babel-preset-react/lib' {
26 | declare module.exports: any;
27 | }
28 |
29 | // Filename aliases
30 | declare module 'babel-preset-react/lib/index' {
31 | declare module.exports: $Exports<'babel-preset-react/lib'>;
32 | }
33 | declare module 'babel-preset-react/lib/index.js' {
34 | declare module.exports: $Exports<'babel-preset-react/lib'>;
35 | }
36 |
--------------------------------------------------------------------------------
/flow-typed/npm/casual-browserify_vx.x.x.js:
--------------------------------------------------------------------------------
1 | // flow-typed signature: a23340c2b1554d9c832ccdfa6de0a1f4
2 | // flow-typed version: <>/casual-browserify_v^1.5.19-2/flow_v0.103.0
3 |
4 | /**
5 | * This is an autogenerated libdef stub for:
6 | *
7 | * 'casual-browserify'
8 | *
9 | * Fill this stub out by replacing all the `any` types.
10 | *
11 | * Once filled out, we encourage you to share your work with the
12 | * community by sending a pull request to:
13 | * https://github.com/flowtype/flow-typed
14 | */
15 |
16 | declare module 'casual-browserify' {
17 | declare module.exports: any;
18 | }
19 |
20 | /**
21 | * We include stubs for each file inside this npm package in case you need to
22 | * require those files directly. Feel free to delete any files that aren't
23 | * needed.
24 | */
25 | declare module 'casual-browserify/scripts/generate' {
26 | declare module.exports: any;
27 | }
28 |
29 | declare module 'casual-browserify/src/casual_browserify' {
30 | declare module.exports: any;
31 | }
32 |
33 | declare module 'casual-browserify/src/casual' {
34 | declare module.exports: any;
35 | }
36 |
37 | declare module 'casual-browserify/src/helpers' {
38 | declare module.exports: any;
39 | }
40 |
41 | declare module 'casual-browserify/src/providers/address' {
42 | declare module.exports: any;
43 | }
44 |
45 | declare module 'casual-browserify/src/providers/ar_SY/address' {
46 | declare module.exports: any;
47 | }
48 |
49 | declare module 'casual-browserify/src/providers/ar_SY/color' {
50 | declare module.exports: any;
51 | }
52 |
53 | declare module 'casual-browserify/src/providers/ar_SY/date' {
54 | declare module.exports: any;
55 | }
56 |
57 | declare module 'casual-browserify/src/providers/ar_SY/person' {
58 | declare module.exports: any;
59 | }
60 |
61 | declare module 'casual-browserify/src/providers/ar_SY/text' {
62 | declare module.exports: any;
63 | }
64 |
65 | declare module 'casual-browserify/src/providers/color' {
66 | declare module.exports: any;
67 | }
68 |
69 | declare module 'casual-browserify/src/providers/date' {
70 | declare module.exports: any;
71 | }
72 |
73 | declare module 'casual-browserify/src/providers/de_DE/address' {
74 | declare module.exports: any;
75 | }
76 |
77 | declare module 'casual-browserify/src/providers/de_DE/date' {
78 | declare module.exports: any;
79 | }
80 |
81 | declare module 'casual-browserify/src/providers/de_DE/person' {
82 | declare module.exports: any;
83 | }
84 |
85 | declare module 'casual-browserify/src/providers/de_DE/text' {
86 | declare module.exports: any;
87 | }
88 |
89 | declare module 'casual-browserify/src/providers/en_CA/address' {
90 | declare module.exports: any;
91 | }
92 |
93 | declare module 'casual-browserify/src/providers/en_US/address' {
94 | declare module.exports: any;
95 | }
96 |
97 | declare module 'casual-browserify/src/providers/fr_FR/address' {
98 | declare module.exports: any;
99 | }
100 |
101 | declare module 'casual-browserify/src/providers/fr_FR/person' {
102 | declare module.exports: any;
103 | }
104 |
105 | declare module 'casual-browserify/src/providers/id_ID/address' {
106 | declare module.exports: any;
107 | }
108 |
109 | declare module 'casual-browserify/src/providers/internet' {
110 | declare module.exports: any;
111 | }
112 |
113 | declare module 'casual-browserify/src/providers/it_CH/address' {
114 | declare module.exports: any;
115 | }
116 |
117 | declare module 'casual-browserify/src/providers/it_CH/date' {
118 | declare module.exports: any;
119 | }
120 |
121 | declare module 'casual-browserify/src/providers/it_CH/person' {
122 | declare module.exports: any;
123 | }
124 |
125 | declare module 'casual-browserify/src/providers/it_IT/address' {
126 | declare module.exports: any;
127 | }
128 |
129 | declare module 'casual-browserify/src/providers/it_IT/date' {
130 | declare module.exports: any;
131 | }
132 |
133 | declare module 'casual-browserify/src/providers/it_IT/person' {
134 | declare module.exports: any;
135 | }
136 |
137 | declare module 'casual-browserify/src/providers/misc' {
138 | declare module.exports: any;
139 | }
140 |
141 | declare module 'casual-browserify/src/providers/nb_NO/address' {
142 | declare module.exports: any;
143 | }
144 |
145 | declare module 'casual-browserify/src/providers/nb_NO/color' {
146 | declare module.exports: any;
147 | }
148 |
149 | declare module 'casual-browserify/src/providers/nb_NO/date' {
150 | declare module.exports: any;
151 | }
152 |
153 | declare module 'casual-browserify/src/providers/nb_NO/person' {
154 | declare module.exports: any;
155 | }
156 |
157 | declare module 'casual-browserify/src/providers/nl_NL/address' {
158 | declare module.exports: any;
159 | }
160 |
161 | declare module 'casual-browserify/src/providers/nl_NL/person' {
162 | declare module.exports: any;
163 | }
164 |
165 | declare module 'casual-browserify/src/providers/number' {
166 | declare module.exports: any;
167 | }
168 |
169 | declare module 'casual-browserify/src/providers/payment' {
170 | declare module.exports: any;
171 | }
172 |
173 | declare module 'casual-browserify/src/providers/person' {
174 | declare module.exports: any;
175 | }
176 |
177 | declare module 'casual-browserify/src/providers/pt_BR/address' {
178 | declare module.exports: any;
179 | }
180 |
181 | declare module 'casual-browserify/src/providers/pt_BR/color' {
182 | declare module.exports: any;
183 | }
184 |
185 | declare module 'casual-browserify/src/providers/pt_BR/person' {
186 | declare module.exports: any;
187 | }
188 |
189 | declare module 'casual-browserify/src/providers/ro_RO/address' {
190 | declare module.exports: any;
191 | }
192 |
193 | declare module 'casual-browserify/src/providers/ro_RO/date' {
194 | declare module.exports: any;
195 | }
196 |
197 | declare module 'casual-browserify/src/providers/ro_RO/person' {
198 | declare module.exports: any;
199 | }
200 |
201 | declare module 'casual-browserify/src/providers/ru_RU/address' {
202 | declare module.exports: any;
203 | }
204 |
205 | declare module 'casual-browserify/src/providers/ru_RU/color' {
206 | declare module.exports: any;
207 | }
208 |
209 | declare module 'casual-browserify/src/providers/ru_RU/internet' {
210 | declare module.exports: any;
211 | }
212 |
213 | declare module 'casual-browserify/src/providers/ru_RU/person' {
214 | declare module.exports: any;
215 | }
216 |
217 | declare module 'casual-browserify/src/providers/ru_RU/text' {
218 | declare module.exports: any;
219 | }
220 |
221 | declare module 'casual-browserify/src/providers/sv_SE/address' {
222 | declare module.exports: any;
223 | }
224 |
225 | declare module 'casual-browserify/src/providers/sv_SE/person' {
226 | declare module.exports: any;
227 | }
228 |
229 | declare module 'casual-browserify/src/providers/sv_SE/text' {
230 | declare module.exports: any;
231 | }
232 |
233 | declare module 'casual-browserify/src/providers/text' {
234 | declare module.exports: any;
235 | }
236 |
237 | declare module 'casual-browserify/src/providers/uk_UA/address' {
238 | declare module.exports: any;
239 | }
240 |
241 | declare module 'casual-browserify/src/providers/uk_UA/color' {
242 | declare module.exports: any;
243 | }
244 |
245 | declare module 'casual-browserify/src/providers/uk_UA/text' {
246 | declare module.exports: any;
247 | }
248 |
249 | declare module 'casual-browserify/src/require_provider_browserify' {
250 | declare module.exports: any;
251 | }
252 |
253 | declare module 'casual-browserify/src/safe_require_browserify' {
254 | declare module.exports: any;
255 | }
256 |
257 | declare module 'casual-browserify/test/casual' {
258 | declare module.exports: any;
259 | }
260 |
261 | declare module 'casual-browserify/utils/show' {
262 | declare module.exports: any;
263 | }
264 |
265 | // Filename aliases
266 | declare module 'casual-browserify/scripts/generate.js' {
267 | declare module.exports: $Exports<'casual-browserify/scripts/generate'>;
268 | }
269 | declare module 'casual-browserify/src/casual_browserify.js' {
270 | declare module.exports: $Exports<'casual-browserify/src/casual_browserify'>;
271 | }
272 | declare module 'casual-browserify/src/casual.js' {
273 | declare module.exports: $Exports<'casual-browserify/src/casual'>;
274 | }
275 | declare module 'casual-browserify/src/helpers.js' {
276 | declare module.exports: $Exports<'casual-browserify/src/helpers'>;
277 | }
278 | declare module 'casual-browserify/src/providers/address.js' {
279 | declare module.exports: $Exports<'casual-browserify/src/providers/address'>;
280 | }
281 | declare module 'casual-browserify/src/providers/ar_SY/address.js' {
282 | declare module.exports: $Exports<'casual-browserify/src/providers/ar_SY/address'>;
283 | }
284 | declare module 'casual-browserify/src/providers/ar_SY/color.js' {
285 | declare module.exports: $Exports<'casual-browserify/src/providers/ar_SY/color'>;
286 | }
287 | declare module 'casual-browserify/src/providers/ar_SY/date.js' {
288 | declare module.exports: $Exports<'casual-browserify/src/providers/ar_SY/date'>;
289 | }
290 | declare module 'casual-browserify/src/providers/ar_SY/person.js' {
291 | declare module.exports: $Exports<'casual-browserify/src/providers/ar_SY/person'>;
292 | }
293 | declare module 'casual-browserify/src/providers/ar_SY/text.js' {
294 | declare module.exports: $Exports<'casual-browserify/src/providers/ar_SY/text'>;
295 | }
296 | declare module 'casual-browserify/src/providers/color.js' {
297 | declare module.exports: $Exports<'casual-browserify/src/providers/color'>;
298 | }
299 | declare module 'casual-browserify/src/providers/date.js' {
300 | declare module.exports: $Exports<'casual-browserify/src/providers/date'>;
301 | }
302 | declare module 'casual-browserify/src/providers/de_DE/address.js' {
303 | declare module.exports: $Exports<'casual-browserify/src/providers/de_DE/address'>;
304 | }
305 | declare module 'casual-browserify/src/providers/de_DE/date.js' {
306 | declare module.exports: $Exports<'casual-browserify/src/providers/de_DE/date'>;
307 | }
308 | declare module 'casual-browserify/src/providers/de_DE/person.js' {
309 | declare module.exports: $Exports<'casual-browserify/src/providers/de_DE/person'>;
310 | }
311 | declare module 'casual-browserify/src/providers/de_DE/text.js' {
312 | declare module.exports: $Exports<'casual-browserify/src/providers/de_DE/text'>;
313 | }
314 | declare module 'casual-browserify/src/providers/en_CA/address.js' {
315 | declare module.exports: $Exports<'casual-browserify/src/providers/en_CA/address'>;
316 | }
317 | declare module 'casual-browserify/src/providers/en_US/address.js' {
318 | declare module.exports: $Exports<'casual-browserify/src/providers/en_US/address'>;
319 | }
320 | declare module 'casual-browserify/src/providers/fr_FR/address.js' {
321 | declare module.exports: $Exports<'casual-browserify/src/providers/fr_FR/address'>;
322 | }
323 | declare module 'casual-browserify/src/providers/fr_FR/person.js' {
324 | declare module.exports: $Exports<'casual-browserify/src/providers/fr_FR/person'>;
325 | }
326 | declare module 'casual-browserify/src/providers/id_ID/address.js' {
327 | declare module.exports: $Exports<'casual-browserify/src/providers/id_ID/address'>;
328 | }
329 | declare module 'casual-browserify/src/providers/internet.js' {
330 | declare module.exports: $Exports<'casual-browserify/src/providers/internet'>;
331 | }
332 | declare module 'casual-browserify/src/providers/it_CH/address.js' {
333 | declare module.exports: $Exports<'casual-browserify/src/providers/it_CH/address'>;
334 | }
335 | declare module 'casual-browserify/src/providers/it_CH/date.js' {
336 | declare module.exports: $Exports<'casual-browserify/src/providers/it_CH/date'>;
337 | }
338 | declare module 'casual-browserify/src/providers/it_CH/person.js' {
339 | declare module.exports: $Exports<'casual-browserify/src/providers/it_CH/person'>;
340 | }
341 | declare module 'casual-browserify/src/providers/it_IT/address.js' {
342 | declare module.exports: $Exports<'casual-browserify/src/providers/it_IT/address'>;
343 | }
344 | declare module 'casual-browserify/src/providers/it_IT/date.js' {
345 | declare module.exports: $Exports<'casual-browserify/src/providers/it_IT/date'>;
346 | }
347 | declare module 'casual-browserify/src/providers/it_IT/person.js' {
348 | declare module.exports: $Exports<'casual-browserify/src/providers/it_IT/person'>;
349 | }
350 | declare module 'casual-browserify/src/providers/misc.js' {
351 | declare module.exports: $Exports<'casual-browserify/src/providers/misc'>;
352 | }
353 | declare module 'casual-browserify/src/providers/nb_NO/address.js' {
354 | declare module.exports: $Exports<'casual-browserify/src/providers/nb_NO/address'>;
355 | }
356 | declare module 'casual-browserify/src/providers/nb_NO/color.js' {
357 | declare module.exports: $Exports<'casual-browserify/src/providers/nb_NO/color'>;
358 | }
359 | declare module 'casual-browserify/src/providers/nb_NO/date.js' {
360 | declare module.exports: $Exports<'casual-browserify/src/providers/nb_NO/date'>;
361 | }
362 | declare module 'casual-browserify/src/providers/nb_NO/person.js' {
363 | declare module.exports: $Exports<'casual-browserify/src/providers/nb_NO/person'>;
364 | }
365 | declare module 'casual-browserify/src/providers/nl_NL/address.js' {
366 | declare module.exports: $Exports<'casual-browserify/src/providers/nl_NL/address'>;
367 | }
368 | declare module 'casual-browserify/src/providers/nl_NL/person.js' {
369 | declare module.exports: $Exports<'casual-browserify/src/providers/nl_NL/person'>;
370 | }
371 | declare module 'casual-browserify/src/providers/number.js' {
372 | declare module.exports: $Exports<'casual-browserify/src/providers/number'>;
373 | }
374 | declare module 'casual-browserify/src/providers/payment.js' {
375 | declare module.exports: $Exports<'casual-browserify/src/providers/payment'>;
376 | }
377 | declare module 'casual-browserify/src/providers/person.js' {
378 | declare module.exports: $Exports<'casual-browserify/src/providers/person'>;
379 | }
380 | declare module 'casual-browserify/src/providers/pt_BR/address.js' {
381 | declare module.exports: $Exports<'casual-browserify/src/providers/pt_BR/address'>;
382 | }
383 | declare module 'casual-browserify/src/providers/pt_BR/color.js' {
384 | declare module.exports: $Exports<'casual-browserify/src/providers/pt_BR/color'>;
385 | }
386 | declare module 'casual-browserify/src/providers/pt_BR/person.js' {
387 | declare module.exports: $Exports<'casual-browserify/src/providers/pt_BR/person'>;
388 | }
389 | declare module 'casual-browserify/src/providers/ro_RO/address.js' {
390 | declare module.exports: $Exports<'casual-browserify/src/providers/ro_RO/address'>;
391 | }
392 | declare module 'casual-browserify/src/providers/ro_RO/date.js' {
393 | declare module.exports: $Exports<'casual-browserify/src/providers/ro_RO/date'>;
394 | }
395 | declare module 'casual-browserify/src/providers/ro_RO/person.js' {
396 | declare module.exports: $Exports<'casual-browserify/src/providers/ro_RO/person'>;
397 | }
398 | declare module 'casual-browserify/src/providers/ru_RU/address.js' {
399 | declare module.exports: $Exports<'casual-browserify/src/providers/ru_RU/address'>;
400 | }
401 | declare module 'casual-browserify/src/providers/ru_RU/color.js' {
402 | declare module.exports: $Exports<'casual-browserify/src/providers/ru_RU/color'>;
403 | }
404 | declare module 'casual-browserify/src/providers/ru_RU/internet.js' {
405 | declare module.exports: $Exports<'casual-browserify/src/providers/ru_RU/internet'>;
406 | }
407 | declare module 'casual-browserify/src/providers/ru_RU/person.js' {
408 | declare module.exports: $Exports<'casual-browserify/src/providers/ru_RU/person'>;
409 | }
410 | declare module 'casual-browserify/src/providers/ru_RU/text.js' {
411 | declare module.exports: $Exports<'casual-browserify/src/providers/ru_RU/text'>;
412 | }
413 | declare module 'casual-browserify/src/providers/sv_SE/address.js' {
414 | declare module.exports: $Exports<'casual-browserify/src/providers/sv_SE/address'>;
415 | }
416 | declare module 'casual-browserify/src/providers/sv_SE/person.js' {
417 | declare module.exports: $Exports<'casual-browserify/src/providers/sv_SE/person'>;
418 | }
419 | declare module 'casual-browserify/src/providers/sv_SE/text.js' {
420 | declare module.exports: $Exports<'casual-browserify/src/providers/sv_SE/text'>;
421 | }
422 | declare module 'casual-browserify/src/providers/text.js' {
423 | declare module.exports: $Exports<'casual-browserify/src/providers/text'>;
424 | }
425 | declare module 'casual-browserify/src/providers/uk_UA/address.js' {
426 | declare module.exports: $Exports<'casual-browserify/src/providers/uk_UA/address'>;
427 | }
428 | declare module 'casual-browserify/src/providers/uk_UA/color.js' {
429 | declare module.exports: $Exports<'casual-browserify/src/providers/uk_UA/color'>;
430 | }
431 | declare module 'casual-browserify/src/providers/uk_UA/text.js' {
432 | declare module.exports: $Exports<'casual-browserify/src/providers/uk_UA/text'>;
433 | }
434 | declare module 'casual-browserify/src/require_provider_browserify.js' {
435 | declare module.exports: $Exports<'casual-browserify/src/require_provider_browserify'>;
436 | }
437 | declare module 'casual-browserify/src/safe_require_browserify.js' {
438 | declare module.exports: $Exports<'casual-browserify/src/safe_require_browserify'>;
439 | }
440 | declare module 'casual-browserify/test/casual.js' {
441 | declare module.exports: $Exports<'casual-browserify/test/casual'>;
442 | }
443 | declare module 'casual-browserify/utils/show.js' {
444 | declare module.exports: $Exports<'casual-browserify/utils/show'>;
445 | }
446 |
--------------------------------------------------------------------------------
/flow-typed/npm/flow-bin_v0.x.x.js:
--------------------------------------------------------------------------------
1 | // flow-typed signature: 6a5610678d4b01e13bbfbbc62bdaf583
2 | // flow-typed version: 3817bc6980/flow-bin_v0.x.x/flow_>=v0.25.x
3 |
4 | declare module "flow-bin" {
5 | declare module.exports: string;
6 | }
7 |
--------------------------------------------------------------------------------
/flow-typed/npm/flow-copy-source_vx.x.x.js:
--------------------------------------------------------------------------------
1 | // flow-typed signature: bd40082a025a56d7d74fe667291d28d9
2 | // flow-typed version: <>/flow-copy-source_v^2.0.0/flow_v0.103.0
3 |
4 | /**
5 | * This is an autogenerated libdef stub for:
6 | *
7 | * 'flow-copy-source'
8 | *
9 | * Fill this stub out by replacing all the `any` types.
10 | *
11 | * Once filled out, we encourage you to share your work with the
12 | * community by sending a pull request to:
13 | * https://github.com/flowtype/flow-typed
14 | */
15 |
16 | declare module 'flow-copy-source' {
17 | declare module.exports: any;
18 | }
19 |
20 | /**
21 | * We include stubs for each file inside this npm package in case you need to
22 | * require those files directly. Feel free to delete any files that aren't
23 | * needed.
24 | */
25 | declare module 'flow-copy-source/bin/flow-copy-source' {
26 | declare module.exports: any;
27 | }
28 |
29 | declare module 'flow-copy-source/src' {
30 | declare module.exports: any;
31 | }
32 |
33 | declare module 'flow-copy-source/src/kefir-copy-file' {
34 | declare module.exports: any;
35 | }
36 |
37 | declare module 'flow-copy-source/src/kefir-glob' {
38 | declare module.exports: any;
39 | }
40 |
41 | // Filename aliases
42 | declare module 'flow-copy-source/bin/flow-copy-source.js' {
43 | declare module.exports: $Exports<'flow-copy-source/bin/flow-copy-source'>;
44 | }
45 | declare module 'flow-copy-source/src/index' {
46 | declare module.exports: $Exports<'flow-copy-source/src'>;
47 | }
48 | declare module 'flow-copy-source/src/index.js' {
49 | declare module.exports: $Exports<'flow-copy-source/src'>;
50 | }
51 | declare module 'flow-copy-source/src/kefir-copy-file.js' {
52 | declare module.exports: $Exports<'flow-copy-source/src/kefir-copy-file'>;
53 | }
54 | declare module 'flow-copy-source/src/kefir-glob.js' {
55 | declare module.exports: $Exports<'flow-copy-source/src/kefir-glob'>;
56 | }
57 |
--------------------------------------------------------------------------------
/flow-typed/npm/husky_vx.x.x.js:
--------------------------------------------------------------------------------
1 | // flow-typed signature: 81a310dfeb5819074ab95b16021bcb64
2 | // flow-typed version: <>/husky_v^0.14.3/flow_v0.103.0
3 |
4 | /**
5 | * This is an autogenerated libdef stub for:
6 | *
7 | * 'husky'
8 | *
9 | * Fill this stub out by replacing all the `any` types.
10 | *
11 | * Once filled out, we encourage you to share your work with the
12 | * community by sending a pull request to:
13 | * https://github.com/flowtype/flow-typed
14 | */
15 |
16 | declare module 'husky' {
17 | declare module.exports: any;
18 | }
19 |
20 | /**
21 | * We include stubs for each file inside this npm package in case you need to
22 | * require those files directly. Feel free to delete any files that aren't
23 | * needed.
24 | */
25 | declare module 'husky/__tests__' {
26 | declare module.exports: any;
27 | }
28 |
29 | declare module 'husky/bin/install' {
30 | declare module.exports: any;
31 | }
32 |
33 | declare module 'husky/bin/uninstall' {
34 | declare module.exports: any;
35 | }
36 |
37 | declare module 'husky/src/install' {
38 | declare module.exports: any;
39 | }
40 |
41 | declare module 'husky/src/uninstall' {
42 | declare module.exports: any;
43 | }
44 |
45 | declare module 'husky/src/utils/find-hooks-dir' {
46 | declare module.exports: any;
47 | }
48 |
49 | declare module 'husky/src/utils/find-parent' {
50 | declare module.exports: any;
51 | }
52 |
53 | declare module 'husky/src/utils/get-hook-script' {
54 | declare module.exports: any;
55 | }
56 |
57 | declare module 'husky/src/utils/is-husky' {
58 | declare module.exports: any;
59 | }
60 |
61 | // Filename aliases
62 | declare module 'husky/__tests__/index' {
63 | declare module.exports: $Exports<'husky/__tests__'>;
64 | }
65 | declare module 'husky/__tests__/index.js' {
66 | declare module.exports: $Exports<'husky/__tests__'>;
67 | }
68 | declare module 'husky/bin/install.js' {
69 | declare module.exports: $Exports<'husky/bin/install'>;
70 | }
71 | declare module 'husky/bin/uninstall.js' {
72 | declare module.exports: $Exports<'husky/bin/uninstall'>;
73 | }
74 | declare module 'husky/src/install.js' {
75 | declare module.exports: $Exports<'husky/src/install'>;
76 | }
77 | declare module 'husky/src/uninstall.js' {
78 | declare module.exports: $Exports<'husky/src/uninstall'>;
79 | }
80 | declare module 'husky/src/utils/find-hooks-dir.js' {
81 | declare module.exports: $Exports<'husky/src/utils/find-hooks-dir'>;
82 | }
83 | declare module 'husky/src/utils/find-parent.js' {
84 | declare module.exports: $Exports<'husky/src/utils/find-parent'>;
85 | }
86 | declare module 'husky/src/utils/get-hook-script.js' {
87 | declare module.exports: $Exports<'husky/src/utils/get-hook-script'>;
88 | }
89 | declare module 'husky/src/utils/is-husky.js' {
90 | declare module.exports: $Exports<'husky/src/utils/is-husky'>;
91 | }
92 |
--------------------------------------------------------------------------------
/flow-typed/npm/jest_v23.x.x.js:
--------------------------------------------------------------------------------
1 | // flow-typed signature: 78c200acffbcc16bba9478f5396c3a00
2 | // flow-typed version: b2980740dd/jest_v23.x.x/flow_>=v0.39.x
3 |
4 | type JestMockFn, TReturn> = {
5 | (...args: TArguments): TReturn,
6 | /**
7 | * An object for introspecting mock calls
8 | */
9 | mock: {
10 | /**
11 | * An array that represents all calls that have been made into this mock
12 | * function. Each call is represented by an array of arguments that were
13 | * passed during the call.
14 | */
15 | calls: Array,
16 | /**
17 | * An array that contains all the object instances that have been
18 | * instantiated from this mock function.
19 | */
20 | instances: Array,
21 | /**
22 | * An array that contains all the object results that have been
23 | * returned by this mock function call
24 | */
25 | results: Array<{ isThrow: boolean, value: TReturn }>
26 | },
27 | /**
28 | * Resets all information stored in the mockFn.mock.calls and
29 | * mockFn.mock.instances arrays. Often this is useful when you want to clean
30 | * up a mock's usage data between two assertions.
31 | */
32 | mockClear(): void,
33 | /**
34 | * Resets all information stored in the mock. This is useful when you want to
35 | * completely restore a mock back to its initial state.
36 | */
37 | mockReset(): void,
38 | /**
39 | * Removes the mock and restores the initial implementation. This is useful
40 | * when you want to mock functions in certain test cases and restore the
41 | * original implementation in others. Beware that mockFn.mockRestore only
42 | * works when mock was created with jest.spyOn. Thus you have to take care of
43 | * restoration yourself when manually assigning jest.fn().
44 | */
45 | mockRestore(): void,
46 | /**
47 | * Accepts a function that should be used as the implementation of the mock.
48 | * The mock itself will still record all calls that go into and instances
49 | * that come from itself -- the only difference is that the implementation
50 | * will also be executed when the mock is called.
51 | */
52 | mockImplementation(fn: (...args: TArguments) => TReturn): JestMockFn,
53 | /**
54 | * Accepts a function that will be used as an implementation of the mock for
55 | * one call to the mocked function. Can be chained so that multiple function
56 | * calls produce different results.
57 | */
58 | mockImplementationOnce(fn: (...args: TArguments) => TReturn): JestMockFn,
59 | /**
60 | * Accepts a string to use in test result output in place of "jest.fn()" to
61 | * indicate which mock function is being referenced.
62 | */
63 | mockName(name: string): JestMockFn,
64 | /**
65 | * Just a simple sugar function for returning `this`
66 | */
67 | mockReturnThis(): void,
68 | /**
69 | * Accepts a value that will be returned whenever the mock function is called.
70 | */
71 | mockReturnValue(value: TReturn): JestMockFn,
72 | /**
73 | * Sugar for only returning a value once inside your mock
74 | */
75 | mockReturnValueOnce(value: TReturn): JestMockFn,
76 | /**
77 | * Sugar for jest.fn().mockImplementation(() => Promise.resolve(value))
78 | */
79 | mockResolvedValue(value: TReturn): JestMockFn>,
80 | /**
81 | * Sugar for jest.fn().mockImplementationOnce(() => Promise.resolve(value))
82 | */
83 | mockResolvedValueOnce(value: TReturn): JestMockFn>,
84 | /**
85 | * Sugar for jest.fn().mockImplementation(() => Promise.reject(value))
86 | */
87 | mockRejectedValue(value: TReturn): JestMockFn>,
88 | /**
89 | * Sugar for jest.fn().mockImplementationOnce(() => Promise.reject(value))
90 | */
91 | mockRejectedValueOnce(value: TReturn): JestMockFn>
92 | };
93 |
94 | type JestAsymmetricEqualityType = {
95 | /**
96 | * A custom Jasmine equality tester
97 | */
98 | asymmetricMatch(value: mixed): boolean
99 | };
100 |
101 | type JestCallsType = {
102 | allArgs(): mixed,
103 | all(): mixed,
104 | any(): boolean,
105 | count(): number,
106 | first(): mixed,
107 | mostRecent(): mixed,
108 | reset(): void
109 | };
110 |
111 | type JestClockType = {
112 | install(): void,
113 | mockDate(date: Date): void,
114 | tick(milliseconds?: number): void,
115 | uninstall(): void
116 | };
117 |
118 | type JestMatcherResult = {
119 | message?: string | (() => string),
120 | pass: boolean
121 | };
122 |
123 | type JestMatcher = (actual: any, expected: any) => JestMatcherResult | Promise;
124 |
125 | type JestPromiseType = {
126 | /**
127 | * Use rejects to unwrap the reason of a rejected promise so any other
128 | * matcher can be chained. If the promise is fulfilled the assertion fails.
129 | */
130 | rejects: JestExpectType,
131 | /**
132 | * Use resolves to unwrap the value of a fulfilled promise so any other
133 | * matcher can be chained. If the promise is rejected the assertion fails.
134 | */
135 | resolves: JestExpectType
136 | };
137 |
138 | /**
139 | * Jest allows functions and classes to be used as test names in test() and
140 | * describe()
141 | */
142 | type JestTestName = string | Function;
143 |
144 | /**
145 | * Plugin: jest-styled-components
146 | */
147 |
148 | type JestStyledComponentsMatcherValue =
149 | | string
150 | | JestAsymmetricEqualityType
151 | | RegExp
152 | | typeof undefined;
153 |
154 | type JestStyledComponentsMatcherOptions = {
155 | media?: string,
156 | modifier?: string,
157 | supports?: string
158 | };
159 |
160 | type JestStyledComponentsMatchersType = {
161 | toHaveStyleRule(
162 | property: string,
163 | value: JestStyledComponentsMatcherValue,
164 | options?: JestStyledComponentsMatcherOptions
165 | ): void
166 | };
167 |
168 | /**
169 | * Plugin: jest-enzyme
170 | */
171 | type EnzymeMatchersType = {
172 | // 5.x
173 | toBeEmpty(): void,
174 | toBePresent(): void,
175 | // 6.x
176 | toBeChecked(): void,
177 | toBeDisabled(): void,
178 | toBeEmptyRender(): void,
179 | toContainMatchingElement(selector: string): void,
180 | toContainMatchingElements(n: number, selector: string): void,
181 | toContainExactlyOneMatchingElement(selector: string): void,
182 | toContainReact(element: React$Element): void,
183 | toExist(): void,
184 | toHaveClassName(className: string): void,
185 | toHaveHTML(html: string): void,
186 | toHaveProp: ((propKey: string, propValue?: any) => void) & ((props: Object) => void),
187 | toHaveRef(refName: string): void,
188 | toHaveState: ((stateKey: string, stateValue?: any) => void) & ((state: Object) => void),
189 | toHaveStyle: ((styleKey: string, styleValue?: any) => void) & ((style: Object) => void),
190 | toHaveTagName(tagName: string): void,
191 | toHaveText(text: string): void,
192 | toHaveValue(value: any): void,
193 | toIncludeText(text: string): void,
194 | toMatchElement(
195 | element: React$Element,
196 | options?: {| ignoreProps?: boolean, verbose?: boolean |}
197 | ): void,
198 | toMatchSelector(selector: string): void,
199 | // 7.x
200 | toHaveDisplayName(name: string): void
201 | };
202 |
203 | // DOM testing library extensions https://github.com/kentcdodds/dom-testing-library#custom-jest-matchers
204 | type DomTestingLibraryType = {
205 | toBeDisabled(): void,
206 | toBeEmpty(): void,
207 | toBeInTheDocument(): void,
208 | toBeVisible(): void,
209 | toContainElement(element: HTMLElement | null): void,
210 | toContainHTML(htmlText: string): void,
211 | toHaveAttribute(name: string, expectedValue?: string): void,
212 | toHaveClass(...classNames: string[]): void,
213 | toHaveFocus(): void,
214 | toHaveFormValues(expectedValues: { [name: string]: any }): void,
215 | toHaveStyle(css: string): void,
216 | toHaveTextContent(content: string | RegExp, options?: { normalizeWhitespace: boolean }): void,
217 | toBeInTheDOM(): void
218 | };
219 |
220 | // Jest JQuery Matchers: https://github.com/unindented/custom-jquery-matchers
221 | type JestJQueryMatchersType = {
222 | toExist(): void,
223 | toHaveLength(len: number): void,
224 | toHaveId(id: string): void,
225 | toHaveClass(className: string): void,
226 | toHaveTag(tag: string): void,
227 | toHaveAttr(key: string, val?: any): void,
228 | toHaveProp(key: string, val?: any): void,
229 | toHaveText(text: string | RegExp): void,
230 | toHaveData(key: string, val?: any): void,
231 | toHaveValue(val: any): void,
232 | toHaveCss(css: { [key: string]: any }): void,
233 | toBeChecked(): void,
234 | toBeDisabled(): void,
235 | toBeEmpty(): void,
236 | toBeHidden(): void,
237 | toBeSelected(): void,
238 | toBeVisible(): void,
239 | toBeFocused(): void,
240 | toBeInDom(): void,
241 | toBeMatchedBy(sel: string): void,
242 | toHaveDescendant(sel: string): void,
243 | toHaveDescendantWithText(sel: string, text: string | RegExp): void
244 | };
245 |
246 | // Jest Extended Matchers: https://github.com/jest-community/jest-extended
247 | type JestExtendedMatchersType = {
248 | /**
249 | * Note: Currently unimplemented
250 | * Passing assertion
251 | *
252 | * @param {String} message
253 | */
254 | // pass(message: string): void;
255 |
256 | /**
257 | * Note: Currently unimplemented
258 | * Failing assertion
259 | *
260 | * @param {String} message
261 | */
262 | // fail(message: string): void;
263 |
264 | /**
265 | * Use .toBeEmpty when checking if a String '', Array [] or Object {} is empty.
266 | */
267 | toBeEmpty(): void,
268 |
269 | /**
270 | * Use .toBeOneOf when checking if a value is a member of a given Array.
271 | * @param {Array.<*>} members
272 | */
273 | toBeOneOf(members: any[]): void,
274 |
275 | /**
276 | * Use `.toBeNil` when checking a value is `null` or `undefined`.
277 | */
278 | toBeNil(): void,
279 |
280 | /**
281 | * Use `.toSatisfy` when you want to use a custom matcher by supplying a predicate function that returns a `Boolean`.
282 | * @param {Function} predicate
283 | */
284 | toSatisfy(predicate: (n: any) => boolean): void,
285 |
286 | /**
287 | * Use `.toBeArray` when checking if a value is an `Array`.
288 | */
289 | toBeArray(): void,
290 |
291 | /**
292 | * Use `.toBeArrayOfSize` when checking if a value is an `Array` of size x.
293 | * @param {Number} x
294 | */
295 | toBeArrayOfSize(x: number): void,
296 |
297 | /**
298 | * Use `.toIncludeAllMembers` when checking if an `Array` contains all of the same members of a given set.
299 | * @param {Array.<*>} members
300 | */
301 | toIncludeAllMembers(members: any[]): void,
302 |
303 | /**
304 | * Use `.toIncludeAnyMembers` when checking if an `Array` contains any of the members of a given set.
305 | * @param {Array.<*>} members
306 | */
307 | toIncludeAnyMembers(members: any[]): void,
308 |
309 | /**
310 | * Use `.toSatisfyAll` when you want to use a custom matcher by supplying a predicate function that returns a `Boolean` for all values in an array.
311 | * @param {Function} predicate
312 | */
313 | toSatisfyAll(predicate: (n: any) => boolean): void,
314 |
315 | /**
316 | * Use `.toBeBoolean` when checking if a value is a `Boolean`.
317 | */
318 | toBeBoolean(): void,
319 |
320 | /**
321 | * Use `.toBeTrue` when checking a value is equal (===) to `true`.
322 | */
323 | toBeTrue(): void,
324 |
325 | /**
326 | * Use `.toBeFalse` when checking a value is equal (===) to `false`.
327 | */
328 | toBeFalse(): void,
329 |
330 | /**
331 | * Use .toBeDate when checking if a value is a Date.
332 | */
333 | toBeDate(): void,
334 |
335 | /**
336 | * Use `.toBeFunction` when checking if a value is a `Function`.
337 | */
338 | toBeFunction(): void,
339 |
340 | /**
341 | * Use `.toHaveBeenCalledBefore` when checking if a `Mock` was called before another `Mock`.
342 | *
343 | * Note: Required Jest version >22
344 | * Note: Your mock functions will have to be asynchronous to cause the timestamps inside of Jest to occur in a differentJS event loop, otherwise the mock timestamps will all be the same
345 | *
346 | * @param {Mock} mock
347 | */
348 | toHaveBeenCalledBefore(mock: JestMockFn): void,
349 |
350 | /**
351 | * Use `.toBeNumber` when checking if a value is a `Number`.
352 | */
353 | toBeNumber(): void,
354 |
355 | /**
356 | * Use `.toBeNaN` when checking a value is `NaN`.
357 | */
358 | toBeNaN(): void,
359 |
360 | /**
361 | * Use `.toBeFinite` when checking if a value is a `Number`, not `NaN` or `Infinity`.
362 | */
363 | toBeFinite(): void,
364 |
365 | /**
366 | * Use `.toBePositive` when checking if a value is a positive `Number`.
367 | */
368 | toBePositive(): void,
369 |
370 | /**
371 | * Use `.toBeNegative` when checking if a value is a negative `Number`.
372 | */
373 | toBeNegative(): void,
374 |
375 | /**
376 | * Use `.toBeEven` when checking if a value is an even `Number`.
377 | */
378 | toBeEven(): void,
379 |
380 | /**
381 | * Use `.toBeOdd` when checking if a value is an odd `Number`.
382 | */
383 | toBeOdd(): void,
384 |
385 | /**
386 | * Use `.toBeWithin` when checking if a number is in between the given bounds of: start (inclusive) and end (exclusive).
387 | *
388 | * @param {Number} start
389 | * @param {Number} end
390 | */
391 | toBeWithin(start: number, end: number): void,
392 |
393 | /**
394 | * Use `.toBeObject` when checking if a value is an `Object`.
395 | */
396 | toBeObject(): void,
397 |
398 | /**
399 | * Use `.toContainKey` when checking if an object contains the provided key.
400 | *
401 | * @param {String} key
402 | */
403 | toContainKey(key: string): void,
404 |
405 | /**
406 | * Use `.toContainKeys` when checking if an object has all of the provided keys.
407 | *
408 | * @param {Array.} keys
409 | */
410 | toContainKeys(keys: string[]): void,
411 |
412 | /**
413 | * Use `.toContainAllKeys` when checking if an object only contains all of the provided keys.
414 | *
415 | * @param {Array.} keys
416 | */
417 | toContainAllKeys(keys: string[]): void,
418 |
419 | /**
420 | * Use `.toContainAnyKeys` when checking if an object contains at least one of the provided keys.
421 | *
422 | * @param {Array.} keys
423 | */
424 | toContainAnyKeys(keys: string[]): void,
425 |
426 | /**
427 | * Use `.toContainValue` when checking if an object contains the provided value.
428 | *
429 | * @param {*} value
430 | */
431 | toContainValue(value: any): void,
432 |
433 | /**
434 | * Use `.toContainValues` when checking if an object contains all of the provided values.
435 | *
436 | * @param {Array.<*>} values
437 | */
438 | toContainValues(values: any[]): void,
439 |
440 | /**
441 | * Use `.toContainAllValues` when checking if an object only contains all of the provided values.
442 | *
443 | * @param {Array.<*>} values
444 | */
445 | toContainAllValues(values: any[]): void,
446 |
447 | /**
448 | * Use `.toContainAnyValues` when checking if an object contains at least one of the provided values.
449 | *
450 | * @param {Array.<*>} values
451 | */
452 | toContainAnyValues(values: any[]): void,
453 |
454 | /**
455 | * Use `.toContainEntry` when checking if an object contains the provided entry.
456 | *
457 | * @param {Array.} entry
458 | */
459 | toContainEntry(entry: [string, string]): void,
460 |
461 | /**
462 | * Use `.toContainEntries` when checking if an object contains all of the provided entries.
463 | *
464 | * @param {Array.>} entries
465 | */
466 | toContainEntries(entries: [string, string][]): void,
467 |
468 | /**
469 | * Use `.toContainAllEntries` when checking if an object only contains all of the provided entries.
470 | *
471 | * @param {Array.>} entries
472 | */
473 | toContainAllEntries(entries: [string, string][]): void,
474 |
475 | /**
476 | * Use `.toContainAnyEntries` when checking if an object contains at least one of the provided entries.
477 | *
478 | * @param {Array.>} entries
479 | */
480 | toContainAnyEntries(entries: [string, string][]): void,
481 |
482 | /**
483 | * Use `.toBeExtensible` when checking if an object is extensible.
484 | */
485 | toBeExtensible(): void,
486 |
487 | /**
488 | * Use `.toBeFrozen` when checking if an object is frozen.
489 | */
490 | toBeFrozen(): void,
491 |
492 | /**
493 | * Use `.toBeSealed` when checking if an object is sealed.
494 | */
495 | toBeSealed(): void,
496 |
497 | /**
498 | * Use `.toBeString` when checking if a value is a `String`.
499 | */
500 | toBeString(): void,
501 |
502 | /**
503 | * Use `.toEqualCaseInsensitive` when checking if a string is equal (===) to another ignoring the casing of both strings.
504 | *
505 | * @param {String} string
506 | */
507 | toEqualCaseInsensitive(string: string): void,
508 |
509 | /**
510 | * Use `.toStartWith` when checking if a `String` starts with a given `String` prefix.
511 | *
512 | * @param {String} prefix
513 | */
514 | toStartWith(prefix: string): void,
515 |
516 | /**
517 | * Use `.toEndWith` when checking if a `String` ends with a given `String` suffix.
518 | *
519 | * @param {String} suffix
520 | */
521 | toEndWith(suffix: string): void,
522 |
523 | /**
524 | * Use `.toInclude` when checking if a `String` includes the given `String` substring.
525 | *
526 | * @param {String} substring
527 | */
528 | toInclude(substring: string): void,
529 |
530 | /**
531 | * Use `.toIncludeRepeated` when checking if a `String` includes the given `String` substring the correct number of times.
532 | *
533 | * @param {String} substring
534 | * @param {Number} times
535 | */
536 | toIncludeRepeated(substring: string, times: number): void,
537 |
538 | /**
539 | * Use `.toIncludeMultiple` when checking if a `String` includes all of the given substrings.
540 | *
541 | * @param {Array.} substring
542 | */
543 | toIncludeMultiple(substring: string[]): void
544 | };
545 |
546 | interface JestExpectType {
547 | not: JestExpectType &
548 | EnzymeMatchersType &
549 | DomTestingLibraryType &
550 | JestJQueryMatchersType &
551 | JestStyledComponentsMatchersType &
552 | JestExtendedMatchersType;
553 | /**
554 | * If you have a mock function, you can use .lastCalledWith to test what
555 | * arguments it was last called with.
556 | */
557 | lastCalledWith(...args: Array): void;
558 | /**
559 | * toBe just checks that a value is what you expect. It uses === to check
560 | * strict equality.
561 | */
562 | toBe(value: any): void;
563 | /**
564 | * Use .toBeCalledWith to ensure that a mock function was called with
565 | * specific arguments.
566 | */
567 | toBeCalledWith(...args: Array): void;
568 | /**
569 | * Using exact equality with floating point numbers is a bad idea. Rounding
570 | * means that intuitive things fail.
571 | */
572 | toBeCloseTo(num: number, delta: any): void;
573 | /**
574 | * Use .toBeDefined to check that a variable is not undefined.
575 | */
576 | toBeDefined(): void;
577 | /**
578 | * Use .toBeFalsy when you don't care what a value is, you just want to
579 | * ensure a value is false in a boolean context.
580 | */
581 | toBeFalsy(): void;
582 | /**
583 | * To compare floating point numbers, you can use toBeGreaterThan.
584 | */
585 | toBeGreaterThan(number: number): void;
586 | /**
587 | * To compare floating point numbers, you can use toBeGreaterThanOrEqual.
588 | */
589 | toBeGreaterThanOrEqual(number: number): void;
590 | /**
591 | * To compare floating point numbers, you can use toBeLessThan.
592 | */
593 | toBeLessThan(number: number): void;
594 | /**
595 | * To compare floating point numbers, you can use toBeLessThanOrEqual.
596 | */
597 | toBeLessThanOrEqual(number: number): void;
598 | /**
599 | * Use .toBeInstanceOf(Class) to check that an object is an instance of a
600 | * class.
601 | */
602 | toBeInstanceOf(cls: Class<*>): void;
603 | /**
604 | * .toBeNull() is the same as .toBe(null) but the error messages are a bit
605 | * nicer.
606 | */
607 | toBeNull(): void;
608 | /**
609 | * Use .toBeTruthy when you don't care what a value is, you just want to
610 | * ensure a value is true in a boolean context.
611 | */
612 | toBeTruthy(): void;
613 | /**
614 | * Use .toBeUndefined to check that a variable is undefined.
615 | */
616 | toBeUndefined(): void;
617 | /**
618 | * Use .toContain when you want to check that an item is in a list. For
619 | * testing the items in the list, this uses ===, a strict equality check.
620 | */
621 | toContain(item: any): void;
622 | /**
623 | * Use .toContainEqual when you want to check that an item is in a list. For
624 | * testing the items in the list, this matcher recursively checks the
625 | * equality of all fields, rather than checking for object identity.
626 | */
627 | toContainEqual(item: any): void;
628 | /**
629 | * Use .toEqual when you want to check that two objects have the same value.
630 | * This matcher recursively checks the equality of all fields, rather than
631 | * checking for object identity.
632 | */
633 | toEqual(value: any): void;
634 | /**
635 | * Use .toHaveBeenCalled to ensure that a mock function got called.
636 | */
637 | toHaveBeenCalled(): void;
638 | toBeCalled(): void;
639 | /**
640 | * Use .toHaveBeenCalledTimes to ensure that a mock function got called exact
641 | * number of times.
642 | */
643 | toHaveBeenCalledTimes(number: number): void;
644 | toBeCalledTimes(number: number): void;
645 | /**
646 | *
647 | */
648 | toHaveBeenNthCalledWith(nthCall: number, ...args: Array): void;
649 | nthCalledWith(nthCall: number, ...args: Array): void;
650 | /**
651 | *
652 | */
653 | toHaveReturned(): void;
654 | toReturn(): void;
655 | /**
656 | *
657 | */
658 | toHaveReturnedTimes(number: number): void;
659 | toReturnTimes(number: number): void;
660 | /**
661 | *
662 | */
663 | toHaveReturnedWith(value: any): void;
664 | toReturnWith(value: any): void;
665 | /**
666 | *
667 | */
668 | toHaveLastReturnedWith(value: any): void;
669 | lastReturnedWith(value: any): void;
670 | /**
671 | *
672 | */
673 | toHaveNthReturnedWith(nthCall: number, value: any): void;
674 | nthReturnedWith(nthCall: number, value: any): void;
675 | /**
676 | * Use .toHaveBeenCalledWith to ensure that a mock function was called with
677 | * specific arguments.
678 | */
679 | toHaveBeenCalledWith(...args: Array): void;
680 | toBeCalledWith(...args: Array): void;
681 | /**
682 | * Use .toHaveBeenLastCalledWith to ensure that a mock function was last called
683 | * with specific arguments.
684 | */
685 | toHaveBeenLastCalledWith(...args: Array): void;
686 | lastCalledWith(...args: Array): void;
687 | /**
688 | * Check that an object has a .length property and it is set to a certain
689 | * numeric value.
690 | */
691 | toHaveLength(number: number): void;
692 | /**
693 | *
694 | */
695 | toHaveProperty(propPath: string, value?: any): void;
696 | /**
697 | * Use .toMatch to check that a string matches a regular expression or string.
698 | */
699 | toMatch(regexpOrString: RegExp | string): void;
700 | /**
701 | * Use .toMatchObject to check that a javascript object matches a subset of the properties of an object.
702 | */
703 | toMatchObject(object: Object | Array