From 640535dd9149bb31296a90816dd267dd5fa06a59 Mon Sep 17 00:00:00 2001 From: Gregory Beaver Date: Sun, 1 Sep 2019 12:37:57 -0400 Subject: [PATCH 1/7] fully move away from index.d.ts --- package.json | 5 ++--- test/typescript/tsconfig.json | 2 +- tsconfig.json | 6 +++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index f9fa58a233..3b2d598a1f 100644 --- a/package.json +++ b/package.json @@ -26,13 +26,12 @@ "main": "lib/redux.js", "unpkg": "dist/redux.js", "module": "es/redux.js", - "typings": "./index.d.ts", + "typings": "./es/index.d.ts", "files": [ "dist", "lib", "es", - "src", - "index.d.ts" + "src" ], "scripts": { "clean": "rimraf lib dist es coverage", diff --git a/test/typescript/tsconfig.json b/test/typescript/tsconfig.json index 497fa459db..1b3cc6d05d 100644 --- a/test/typescript/tsconfig.json +++ b/test/typescript/tsconfig.json @@ -4,7 +4,7 @@ "strict": true, "baseUrl": "../..", "paths": { - "redux": ["index.d.ts"] + "redux": ["es/index.d.ts"] } } } diff --git a/tsconfig.json b/tsconfig.json index 0abee9b5c3..e2b5a514c1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,11 +10,11 @@ // "allowJs": true /* Allow javascript files to be compiled. */, // "checkJs": true, /* Report errors in .js files. */ "jsx": "react" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */, - // "declaration": true /* Generates corresponding '.d.ts' file. */, - // "declarationMap": true /* Generates a sourcemap for each corresponding '.d.ts' file. */, + "declaration": true /* Generates corresponding '.d.ts' file. */, + "declarationMap": true /* Generates a sourcemap for each corresponding '.d.ts' file. */, "sourceMap": true /* Generates corresponding '.map' file. */, // "outFile": "./", /* Concatenate and emit output to single file. */ - // "outDir": "." /* Redirect output structure to the directory. */, + "outDir": "./dist" /* Redirect output structure to the directory. */, // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ // "composite": true, /* Enable project compilation */ "removeComments": false /* Do not emit comments to output. */, From 72be174f52ae9feb59da24de1ea9a428ec057dd3 Mon Sep 17 00:00:00 2001 From: Gregory Beaver Date: Tue, 3 Sep 2019 09:37:27 -0400 Subject: [PATCH 2/7] build types into the types/ directory --- package.json | 11 +- test/typescript/tsconfig.json | 2 +- tsconfig.json | 9 +- types/applyMiddleware.d.ts | 38 +++++ types/applyMiddleware.d.ts.map | 1 + types/bindActionCreators.d.ts | 28 ++++ types/bindActionCreators.d.ts.map | 1 + types/combineReducers.d.ts | 26 ++++ types/combineReducers.d.ts.map | 1 + types/compose.d.ts | 32 +++++ types/compose.d.ts.map | 1 + types/createStore.d.ts | 31 ++++ types/createStore.d.ts.map | 1 + types/index.d.ts | 13 ++ types/index.d.ts.map | 1 + types/types/actions.d.ts | 56 ++++++++ types/types/actions.d.ts.map | 1 + types/types/middleware.d.ts | 25 ++++ types/types/middleware.d.ts.map | 1 + types/types/reducers.d.ts | 63 +++++++++ types/types/reducers.d.ts.map | 1 + types/types/store.d.ts | 218 +++++++++++++++++++++++++++++ types/types/store.d.ts.map | 1 + types/utils/actionTypes.d.ts | 13 ++ types/utils/actionTypes.d.ts.map | 1 + types/utils/isPlainObject.d.ts | 6 + types/utils/isPlainObject.d.ts.map | 1 + types/utils/warning.d.ts | 8 ++ types/utils/warning.d.ts.map | 1 + 29 files changed, 582 insertions(+), 10 deletions(-) create mode 100644 types/applyMiddleware.d.ts create mode 100644 types/applyMiddleware.d.ts.map create mode 100644 types/bindActionCreators.d.ts create mode 100644 types/bindActionCreators.d.ts.map create mode 100644 types/combineReducers.d.ts create mode 100644 types/combineReducers.d.ts.map create mode 100644 types/compose.d.ts create mode 100644 types/compose.d.ts.map create mode 100644 types/createStore.d.ts create mode 100644 types/createStore.d.ts.map create mode 100644 types/index.d.ts create mode 100644 types/index.d.ts.map create mode 100644 types/types/actions.d.ts create mode 100644 types/types/actions.d.ts.map create mode 100644 types/types/middleware.d.ts create mode 100644 types/types/middleware.d.ts.map create mode 100644 types/types/reducers.d.ts create mode 100644 types/types/reducers.d.ts.map create mode 100644 types/types/store.d.ts create mode 100644 types/types/store.d.ts.map create mode 100644 types/utils/actionTypes.d.ts create mode 100644 types/utils/actionTypes.d.ts.map create mode 100644 types/utils/isPlainObject.d.ts create mode 100644 types/utils/isPlainObject.d.ts.map create mode 100644 types/utils/warning.d.ts create mode 100644 types/utils/warning.d.ts.map diff --git a/package.json b/package.json index 3b2d598a1f..9fdfa93c93 100644 --- a/package.json +++ b/package.json @@ -26,12 +26,13 @@ "main": "lib/redux.js", "unpkg": "dist/redux.js", "module": "es/redux.js", - "typings": "./es/index.d.ts", + "typings": "types/index.d.ts", "files": [ "dist", "lib", "es", - "src" + "src", + "types" ], "scripts": { "clean": "rimraf lib dist es coverage", @@ -42,9 +43,9 @@ "test": "jest", "test:watch": "npm test -- --watch", "test:cov": "npm test -- --coverage", - "build": "rollup -c", - "prepare": "npm run clean && npm run check-types && npm run format:check && npm run lint && npm test", - "check-types": "tsc", + "build": "npm run build-types && rollup -c", + "prepare": "npm run clean && npm run format:check && npm run lint && npm test", + "build-types": "tsc", "examples:lint": "eslint --ext js,ts examples", "examples:test": "cross-env CI=true babel-node examples/testAll.js" }, diff --git a/test/typescript/tsconfig.json b/test/typescript/tsconfig.json index 1b3cc6d05d..eb36059da2 100644 --- a/test/typescript/tsconfig.json +++ b/test/typescript/tsconfig.json @@ -4,7 +4,7 @@ "strict": true, "baseUrl": "../..", "paths": { - "redux": ["es/index.d.ts"] + "redux": ["types/index.d.ts"] } } } diff --git a/tsconfig.json b/tsconfig.json index e2b5a514c1..74bb33b2ce 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,9 +12,10 @@ "jsx": "react" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */, "declaration": true /* Generates corresponding '.d.ts' file. */, "declarationMap": true /* Generates a sourcemap for each corresponding '.d.ts' file. */, + "declarationDir": "./types" /* Output directory for generated declaration files. */, "sourceMap": true /* Generates corresponding '.map' file. */, // "outFile": "./", /* Concatenate and emit output to single file. */ - "outDir": "./dist" /* Redirect output structure to the directory. */, + // "outDir": "./types" /* Redirect output structure to the directory. */, // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ // "composite": true, /* Enable project compilation */ "removeComments": false /* Do not emit comments to output. */, @@ -42,9 +43,9 @@ /* Module Resolution Options */ "moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */, "baseUrl": "./" /* Base directory to resolve non-absolute module names. */, - "paths": { - "*": ["*", "types/*"] - } /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */, + // "paths": { + // "*": ["*", "types/*"] + // } /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */, // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ // "typeRoots": [], /* List of folders to include type definitions from. */ // "types": [], /* Type declaration files to be included in compilation. */ diff --git a/types/applyMiddleware.d.ts b/types/applyMiddleware.d.ts new file mode 100644 index 0000000000..fd14124930 --- /dev/null +++ b/types/applyMiddleware.d.ts @@ -0,0 +1,38 @@ +import { Middleware } from './types/middleware'; +import { StoreEnhancer } from './types/store'; +/** + * Creates a store enhancer that applies middleware to the dispatch method + * of the Redux store. This is handy for a variety of tasks, such as expressing + * asynchronous actions in a concise manner, or logging every action payload. + * + * See `redux-thunk` package as an example of the Redux middleware. + * + * Because middleware is potentially asynchronous, this should be the first + * store enhancer in the composition chain. + * + * Note that each middleware will be given the `dispatch` and `getState` functions + * as named arguments. + * + * @param {...Function} middlewares The middleware chain to be applied. + * @returns {Function} A store enhancer applying the middleware. + */ +export default function applyMiddleware(): StoreEnhancer; +export default function applyMiddleware(middleware1: Middleware): StoreEnhancer<{ + dispatch: Ext1; +}>; +export default function applyMiddleware(middleware1: Middleware, middleware2: Middleware): StoreEnhancer<{ + dispatch: Ext1 & Ext2; +}>; +export default function applyMiddleware(middleware1: Middleware, middleware2: Middleware, middleware3: Middleware): StoreEnhancer<{ + dispatch: Ext1 & Ext2 & Ext3; +}>; +export default function applyMiddleware(middleware1: Middleware, middleware2: Middleware, middleware3: Middleware, middleware4: Middleware): StoreEnhancer<{ + dispatch: Ext1 & Ext2 & Ext3 & Ext4; +}>; +export default function applyMiddleware(middleware1: Middleware, middleware2: Middleware, middleware3: Middleware, middleware4: Middleware, middleware5: Middleware): StoreEnhancer<{ + dispatch: Ext1 & Ext2 & Ext3 & Ext4 & Ext5; +}>; +export default function applyMiddleware(...middlewares: Middleware[]): StoreEnhancer<{ + dispatch: Ext; +}>; +//# sourceMappingURL=applyMiddleware.d.ts.map \ No newline at end of file diff --git a/types/applyMiddleware.d.ts.map b/types/applyMiddleware.d.ts.map new file mode 100644 index 0000000000..2982be2643 --- /dev/null +++ b/types/applyMiddleware.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"applyMiddleware.d.ts","sourceRoot":"","sources":["../src/applyMiddleware.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAiB,MAAM,oBAAoB,CAAA;AAE9D,OAAO,EAAE,aAAa,EAA0B,MAAM,eAAe,CAAA;AAGrE;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,IAAI,aAAa,CAAA;AACxD,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,IAAI,EAAE,CAAC,EAC7C,WAAW,EAAE,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,GACpC,aAAa,CAAC;IAAE,QAAQ,EAAE,IAAI,CAAA;CAAE,CAAC,CAAA;AACpC,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,EACnD,WAAW,EAAE,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,EACrC,WAAW,EAAE,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,GACpC,aAAa,CAAC;IAAE,QAAQ,EAAE,IAAI,GAAG,IAAI,CAAA;CAAE,CAAC,CAAA;AAC3C,MAAM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IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,GACpC,aAAa,CAAC;IAAE,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;CAAE,CAAC,CAAA;AAChE,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,GAAG,EAAE,CAAC,GAAG,GAAG,EAClD,GAAG,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,GACxC,aAAa,CAAC;IAAE,QAAQ,EAAE,GAAG,CAAA;CAAE,CAAC,CAAA"} \ No newline at end of file diff --git a/types/bindActionCreators.d.ts b/types/bindActionCreators.d.ts new file mode 100644 index 0000000000..eda24ca5ed --- /dev/null +++ b/types/bindActionCreators.d.ts @@ -0,0 +1,28 @@ +import { Dispatch } from './types/store'; +import { ActionCreator, ActionCreatorsMapObject } from './types/actions'; +/** + * Turns an object whose values are action creators, into an object with the + * same keys, but with every function wrapped into a `dispatch` call so they + * may be invoked directly. This is just a convenience method, as you can call + * `store.dispatch(MyActionCreators.doSomething())` yourself just fine. + * + * For convenience, you can also pass an action creator as the first argument, + * and get a dispatch wrapped function in return. + * + * @param actionCreators An object whose values are action + * creator functions. One handy way to obtain it is to use ES6 `import * as` + * syntax. You may also pass a single function. + * + * @param dispatch The `dispatch` function available on your Redux + * store. + * + * @returns The object mimicking the original object, but with + * every action creator wrapped into the `dispatch` call. If you passed a + * function as `actionCreators`, the return value will also be a single + * function. + */ +export default function bindActionCreators>(actionCreator: C, dispatch: Dispatch): C; +export default function bindActionCreators, B extends ActionCreator>(actionCreator: A, dispatch: Dispatch): B; +export default function bindActionCreators>(actionCreators: M, dispatch: Dispatch): M; +export default function bindActionCreators, N extends ActionCreatorsMapObject>(actionCreators: M, dispatch: Dispatch): N; +//# sourceMappingURL=bindActionCreators.d.ts.map \ No newline at end of file diff --git a/types/bindActionCreators.d.ts.map b/types/bindActionCreators.d.ts.map new file mode 100644 index 0000000000..36d9c8b67a --- /dev/null +++ b/types/bindActionCreators.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"bindActionCreators.d.ts","sourceRoot":"","sources":["../src/bindActionCreators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAEL,aAAa,EACb,uBAAuB,EACxB,MAAM,iBAAiB,CAAA;AAWxB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,CAAC,EAAE,CAAC,SAAS,aAAa,CAAC,CAAC,CAAC,EACtE,aAAa,EAAE,CAAC,EAChB,QAAQ,EAAE,QAAQ,GACjB,CAAC,CAAA;AAEJ,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,CAAC,SAAS,aAAa,CAAC,GAAG,CAAC,EAC5B,CAAC,SAAS,aAAa,CAAC,GAAG,CAAC,EAC5B,aAAa,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,CAAC,CAAA;AAE1C,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,CAAC,EACD,CAAC,SAAS,uBAAuB,CAAC,CAAC,CAAC,EACpC,cAAc,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,CAAC,CAAA;AAC3C,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,CAAC,SAAS,uBAAuB,CAAC,GAAG,CAAC,EACtC,CAAC,SAAS,uBAAuB,CAAC,GAAG,CAAC,EACtC,cAAc,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,CAAC,CAAA"} \ No newline at end of file diff --git a/types/combineReducers.d.ts b/types/combineReducers.d.ts new file mode 100644 index 0000000000..802749043b --- /dev/null +++ b/types/combineReducers.d.ts @@ -0,0 +1,26 @@ +import { Reducer } from './types/reducers'; +import { AnyAction, Action } from './types/actions'; +import { ReducersMapObject, StateFromReducersMapObject, ActionFromReducersMapObject } from './types/reducers'; +import { CombinedState } from './types/store'; +/** + * Turns an object whose values are different reducer functions, into a single + * reducer function. It will call every child reducer, and gather their results + * into a single state object, whose keys correspond to the keys of the passed + * reducer functions. + * + * @template S Combined state object type. + * + * @param reducers An object whose values correspond to different reducer + * functions that need to be combined into one. One handy way to obtain it + * is to use ES6 `import * as reducers` syntax. The reducers may never + * return undefined for any action. Instead, they should return their + * initial state if the state passed to them was undefined, and the current + * state for any unrecognized action. + * + * @returns A reducer function that invokes every reducer inside the passed + * object, and builds a state object with the same shape. + */ +export default function combineReducers(reducers: ReducersMapObject): Reducer>; +export default function combineReducers(reducers: ReducersMapObject): Reducer, A>; +export default function combineReducers>(reducers: M): Reducer>, ActionFromReducersMapObject>; +//# sourceMappingURL=combineReducers.d.ts.map \ No newline at end of file diff --git a/types/combineReducers.d.ts.map b/types/combineReducers.d.ts.map new file mode 100644 index 0000000000..da0bacfbcb --- /dev/null +++ b/types/combineReducers.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"combineReducers.d.ts","sourceRoot":"","sources":["../src/combineReducers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAInD,OAAO,EACL,iBAAiB,EACjB,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAkG7C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,CAAC,EACvC,QAAQ,EAAE,iBAAiB,CAAC,CAAC,EAAE,GAAG,CAAC,GAClC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;AAC5B,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,SAAS,EACrE,QAAQ,EAAE,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,GAChC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AAC/B,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,CAAC,SAAS,iBAAiB,CAAC,GAAG,EAAE,GAAG,CAAC,EAC3E,QAAQ,EAAE,CAAC,GACV,OAAO,CACR,aAAa,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC,EAC5C,2BAA2B,CAAC,CAAC,CAAC,CAC/B,CAAA"} \ No newline at end of file diff --git a/types/compose.d.ts b/types/compose.d.ts new file mode 100644 index 0000000000..e6284ee180 --- /dev/null +++ b/types/compose.d.ts @@ -0,0 +1,32 @@ +declare type Func0 = () => R; +declare type Func1 = (a1: T1) => R; +declare type Func2 = (a1: T1, a2: T2) => R; +declare type Func3 = (a1: T1, a2: T2, a3: T3, ...args: any[]) => R; +/** + * Composes single-argument functions from right to left. The rightmost + * function can take multiple arguments as it provides the signature for the + * resulting composite function. + * + * @param funcs The functions to compose. + * @returns R function obtained by composing the argument functions from right + * to left. For example, `compose(f, g, h)` is identical to doing + * `(...args) => f(g(h(...args)))`. + */ +export default function compose(): (a: R) => R; +export default function compose(f: F): F; +export default function compose(f1: (b: A) => R, f2: Func0): Func0; +export default function compose(f1: (b: A) => R, f2: Func1): Func1; +export default function compose(f1: (b: A) => R, f2: Func2): Func2; +export default function compose(f1: (b: A) => R, f2: Func3): Func3; +export default function compose(f1: (b: B) => R, f2: (a: A) => B, f3: Func0): Func0; +export default function compose(f1: (b: B) => R, f2: (a: A) => B, f3: Func1): Func1; +export default function compose(f1: (b: B) => R, f2: (a: A) => B, f3: Func2): Func2; +export default function compose(f1: (b: B) => R, f2: (a: A) => B, f3: Func3): Func3; +export default function compose(f1: (b: C) => R, f2: (a: B) => C, f3: (a: A) => B, f4: Func0): Func0; +export default function compose(f1: (b: C) => R, f2: (a: B) => C, f3: (a: A) => B, f4: Func1): Func1; +export default function compose(f1: (b: C) => R, f2: (a: B) => C, f3: (a: A) => B, f4: Func2): Func2; +export default function compose(f1: (b: C) => R, f2: (a: B) => C, f3: (a: A) => B, f4: Func3): Func3; +export default function compose(f1: (b: any) => R, ...funcs: Function[]): (...args: any[]) => R; +export default function compose(...funcs: Function[]): (...args: any[]) => R; +export {}; +//# sourceMappingURL=compose.d.ts.map \ No newline at end of file diff --git a/types/compose.d.ts.map b/types/compose.d.ts.map new file mode 100644 index 0000000000..b403dd0b26 --- /dev/null +++ b/types/compose.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../src/compose.ts"],"names":[],"mappings":"AAAA,aAAK,KAAK,CAAC,CAAC,IAAI,MAAM,CAAC,CAAA;AACvB,aAAK,KAAK,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,CAAA;AACjC,aAAK,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,CAAA;AAC7C,aAAK,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA;AAEzE;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;AAEjD,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,CAAC,SAAS,QAAQ,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAA;AAG5D,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,KA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AE,GACnB,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA;AAExB,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,QAAQ,EAAE,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA"} \ No newline at end of file diff --git a/types/createStore.d.ts b/types/createStore.d.ts new file mode 100644 index 0000000000..d17ddc9088 --- /dev/null +++ b/types/createStore.d.ts @@ -0,0 +1,31 @@ +import { Store, PreloadedState, StoreEnhancer } from './types/store'; +import { Action } from './types/actions'; +import { Reducer } from './types/reducers'; +/** + * Creates a Redux store that holds the state tree. + * The only way to change the data in the store is to call `dispatch()` on it. + * + * There should only be a single store in your app. To specify how different + * parts of the state tree respond to actions, you may combine several reducers + * into a single reducer function by using `combineReducers`. + * + * @param {Function} reducer A function that returns the next state tree, given + * the current state tree and the action to handle. + * + * @param {any} [preloadedState] The initial state. You may optionally specify it + * to hydrate the state from the server in universal apps, or to restore a + * previously serialized user session. + * If you use `combineReducers` to produce the root reducer function, this must be + * an object with the same shape as `combineReducers` keys. + * + * @param {Function} [enhancer] The store enhancer. You may optionally specify it + * to enhance the store with third-party capabilities such as middleware, + * time travel, persistence, etc. The only store enhancer that ships with Redux + * is `applyMiddleware()`. + * + * @returns {Store} A Redux store that lets you read the state, dispatch actions + * and subscribe to changes. + */ +export default function createStore(reducer: Reducer, enhancer?: StoreEnhancer): Store & Ext; +export default function createStore(reducer: Reducer, preloadedState?: PreloadedState, enhancer?: StoreEnhancer): Store & Ext; +//# sourceMappingURL=createStore.d.ts.map \ No newline at end of file diff --git a/types/createStore.d.ts.map b/types/createStore.d.ts.map new file mode 100644 index 0000000000..ba7716bce1 --- /dev/null +++ b/types/createStore.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"createStore.d.ts","sourceRoot":"","sources":["../src/createStore.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,EACL,cAAc,EACd,aAAa,EAGd,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAI1C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,QAAQ,EACpE,OAAO,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EACtB,QAAQ,CAAC,EAAE,aAAa,CAAC,GAAG,EAAE,QAAQ,CAAC,GACtC,KAAK,CAAC,CAAC,GAAG,QAAQ,EAAE,CAAC,CAAC,GAAG,GAAG,CAAA;AAC/B,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,QAAQ,EACpE,OAAO,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EACtB,cAAc,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,EAClC,QAAQ,CAAC,EAAE,aAAa,CAAC,GAAG,CAAC,GAC5B,KAAK,CAAC,CAAC,GAAG,QAAQ,EAAE,CAAC,CAAC,GAAG,GAAG,CAAA"} \ No newline at end of file diff --git a/types/index.d.ts b/types/index.d.ts new file mode 100644 index 0000000000..d7db2172e7 --- /dev/null +++ b/types/index.d.ts @@ -0,0 +1,13 @@ +import createStore from './createStore'; +import combineReducers from './combineReducers'; +import bindActionCreators from './bindActionCreators'; +import applyMiddleware from './applyMiddleware'; +import compose from './compose'; +import __DO_NOT_USE__ActionTypes from './utils/actionTypes'; +export { CombinedState, PreloadedState, Dispatch, Unsubscribe, Observable, Observer, Store, StoreCreator, StoreEnhancer, StoreEnhancerStoreCreator } from './types/store'; +export { Reducer, ReducerFromReducersMapObject, ReducersMapObject, StateFromReducersMapObject, ActionFromReducer, ActionFromReducersMapObject } from './types/reducers'; +export { ActionCreator, ActionCreatorsMapObject } from './types/actions'; +export { MiddlewareAPI, Middleware } from './types/middleware'; +export { Action, AnyAction } from './types/actions'; +export { createStore, combineReducers, bindActionCreators, applyMiddleware, compose, __DO_NOT_USE__ActionTypes }; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/index.d.ts.map b/types/index.d.ts.map new file mode 100644 index 0000000000..60e1e4c8f1 --- /dev/null +++ b/types/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,eAAe,CAAA;AACvC,OAAO,eAAe,MAAM,mBAAmB,CAAA;AAC/C,OAAO,kBAAkB,MAAM,sBAAsB,CAAA;AACrD,OAAO,eAAe,MAAM,mBAAmB,CAAA;AAC/C,OAAO,OAAO,MAAM,WAAW,CAAA;AAE/B,OAAO,yBAAyB,MAAM,qBAAqB,CAAA;AAI3D,OAAO,EACL,aAAa,EACb,cAAc,EACd,QAAQ,EACR,WAAW,EACX,UAAU,EACV,QAAQ,EACR,KAAK,EACL,YAAY,EACZ,aAAa,EACb,yBAAyB,EAC1B,MAAM,eAAe,CAAA;AAEtB,OAAO,EACL,OAAO,EACP,4BAA4B,EAC5B,iBAAiB,EACjB,0BAA0B,EAC1B,iBAAiB,EACjB,2BAA2B,EAC5B,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AAExE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAE9D,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAsBnD,OAAO,EACL,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,OAAO,EACP,yBAAyB,EAC1B,CAAA"} \ No newline at end of file diff --git a/types/types/actions.d.ts b/types/types/actions.d.ts new file mode 100644 index 0000000000..d15cf37772 --- /dev/null +++ b/types/types/actions.d.ts @@ -0,0 +1,56 @@ +/** + * An *action* is a plain object that represents an intention to change the + * state. Actions are the only way to get data into the store. Any data, + * whether from UI events, network callbacks, or other sources such as + * WebSockets needs to eventually be dispatched as actions. + * + * Actions must have a `type` field that indicates the type of action being + * performed. Types can be defined as constants and imported from another + * module. It's better to use strings for `type` than Symbols because strings + * are serializable. + * + * Other than `type`, the structure of an action object is really up to you. + * If you're interested, check out Flux Standard Action for recommendations on + * how actions should be constructed. + * + * @template T the type of the action's `type` tag. + */ +export interface Action { + type: T; +} +/** + * An Action type which accepts any other properties. + * This is mainly for the use of the `Reducer` type. + * This is not part of `Action` itself to prevent types that extend `Action` from + * having an index signature. + */ +export interface AnyAction extends Action { + [extraProps: string]: any; +} +/** + * An *action creator* is, quite simply, a function that creates an action. Do + * not confuse the two terms—again, an action is a payload of information, and + * an action creator is a factory that creates an action. + * + * Calling an action creator only produces an action, but does not dispatch + * it. You need to call the store's `dispatch` function to actually cause the + * mutation. Sometimes we say *bound action creators* to mean functions that + * call an action creator and immediately dispatch its result to a specific + * store instance. + * + * If an action creator needs to read the current state, perform an API call, + * or cause a side effect, like a routing transition, it should return an + * async action instead of an action. + * + * @template A Returned action type. + */ +export interface ActionCreator { + (...args: any[]): A; +} +/** + * Object whose values are action creator functions. + */ +export interface ActionCreatorsMapObject { + [key: string]: ActionCreator; +} +//# sourceMappingURL=actions.d.ts.map \ No newline at end of file diff --git a/types/types/actions.d.ts.map b/types/types/actions.d.ts.map new file mode 100644 index 0000000000..83619702c3 --- /dev/null +++ b/types/types/actions.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/types/actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,MAAM,CAAC,CAAC,GAAG,GAAG;IAC7B,IAAI,EAAE,CAAC,CAAA;CACR;AAED;;;;;GAKG;AACH,MAAM,WAAW,SAAU,SAAQ,MAAM;IAEvC,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG,CAAA;CAC1B;AAID;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC;IAC9B,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB,CAAC,CAAC,GAAG,GAAG;IAC9C,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,CAAA;CAChC"} \ No newline at end of file diff --git a/types/types/middleware.d.ts b/types/types/middleware.d.ts new file mode 100644 index 0000000000..ec11111496 --- /dev/null +++ b/types/types/middleware.d.ts @@ -0,0 +1,25 @@ +import { Dispatch } from './store'; +import { AnyAction } from './actions'; +export interface MiddlewareAPI { + dispatch: D; + getState(): S; +} +/** + * A middleware is a higher-order function that composes a dispatch function + * to return a new dispatch function. It often turns async actions into + * actions. + * + * Middleware is composable using function composition. It is useful for + * logging actions, performing side effects like routing, or turning an + * asynchronous API call into a series of synchronous actions. + * + * @template DispatchExt Extra Dispatch signature added by this middleware. + * @template S The type of the state supported by this middleware. + * @template D The type of Dispatch of the store where this middleware is + * installed. + */ +export interface Middleware<_DispatchExt = {}, // TODO: remove unused component +S = any, D extends Dispatch = Dispatch> { + (api: MiddlewareAPI): (next: Dispatch) => (action: any) => any; +} +//# sourceMappingURL=middleware.d.ts.map \ No newline at end of file diff --git a/types/types/middleware.d.ts.map b/types/types/middleware.d.ts.map new file mode 100644 index 0000000000..785b40d012 --- /dev/null +++ b/types/types/middleware.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/types/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ,EAAE,CAAC,GAAG,GAAG;IACnE,QAAQ,EAAE,CAAC,CAAA;IACX,QAAQ,IAAI,CAAC,CAAA;CACd;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,UAAU,CACzB,YAAY,GAAG,EAAE,EAAE,gCAAgC;AACnD,CAAC,GAAG,GAAG,EACP,CAAC,SAAS,QAAQ,GAAG,QAAQ;IAE7B,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAC1B,IAAI,EAAE,QAAQ,CAAC,SAAS,CAAC,KACtB,CAAC,MAAM,EAAE,GAAG,KAAK,GAAG,CAAA;CAC1B"} \ No newline at end of file diff --git a/types/types/reducers.d.ts b/types/types/reducers.d.ts new file mode 100644 index 0000000000..1230a81523 --- /dev/null +++ b/types/types/reducers.d.ts @@ -0,0 +1,63 @@ +import { Action, AnyAction } from './actions'; +/** + * A *reducer* (also called a *reducing function*) is a function that accepts + * an accumulation and a value and returns a new accumulation. They are used + * to reduce a collection of values down to a single value + * + * Reducers are not unique to Redux—they are a fundamental concept in + * functional programming. Even most non-functional languages, like + * JavaScript, have a built-in API for reducing. In JavaScript, it's + * `Array.prototype.reduce()`. + * + * In Redux, the accumulated value is the state object, and the values being + * accumulated are actions. Reducers calculate a new state given the previous + * state and an action. They must be *pure functions*—functions that return + * the exact same output for given inputs. They should also be free of + * side-effects. This is what enables exciting features like hot reloading and + * time travel. + * + * Reducers are the most important concept in Redux. + * + * *Do not put API calls into reducers.* + * + * @template S The type of state consumed and produced by this reducer. + * @template A The type of actions the reducer can potentially respond to. + */ +export declare type Reducer = (state: S | undefined, action: A) => S; +/** + * Object whose values correspond to different reducer functions. + * + * @template A The type of actions the reducers can potentially respond to. + */ +export declare type ReducersMapObject = { + [K in keyof S]: Reducer; +}; +/** + * Infer a combined state shape from a `ReducersMapObject`. + * + * @template M Object map of reducers as provided to `combineReducers(map: M)`. + */ +export declare type StateFromReducersMapObject = M extends ReducersMapObject ? { + [P in keyof M]: M[P] extends Reducer ? S : never; +} : never; +/** + * Infer reducer union type from a `ReducersMapObject`. + * + * @template M Object map of reducers as provided to `combineReducers(map: M)`. + */ +export declare type ReducerFromReducersMapObject = M extends { + [P in keyof M]: infer R; +} ? R extends Reducer ? R : never : never; +/** + * Infer action type from a reducer function. + * + * @template R Type of reducer. + */ +export declare type ActionFromReducer = R extends Reducer ? A : never; +/** + * Infer action union type from a `ReducersMapObject`. + * + * @template M Object map of reducers as provided to `combineReducers(map: M)`. + */ +export declare type ActionFromReducersMapObject = M extends ReducersMapObject ? ActionFromReducer> : never; +//# sourceMappingURL=reducers.d.ts.map \ No newline at end of file diff --git a/types/types/reducers.d.ts.map b/types/types/reducers.d.ts.map new file mode 100644 index 0000000000..35f63c3973 --- /dev/null +++ b/types/types/reducers.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"reducers.d.ts","sourceRoot":"","sources":["../../src/types/reducers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAI7C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,oBAAY,OAAO,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,MAAM,GAAG,SAAS,IAAI,CAC3D,KAAK,EAAE,CAAC,GAAG,SAAS,EACpB,MAAM,EAAE,CAAC,KACN,CAAC,CAAA;AAEN;;;;GAIG;AACH,oBAAY,iBAAiB,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI;KACjE,CAAC,IAAI,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;CACjC,CAAA;AAED;;;;GAIG;AACH,oBAAY,0BAA0B,CAAC,CAAC,IAAI,CAAC,SAAS,iBAAiB,CACrE,GAAG,EACH,GAAG,CACJ,GACG;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK;CAAE,GAClE,KAAK,CAAA;AAET;;;;GAIG;AACH,oBAAY,4BAA4B,CAAC,CAAC,IAAI,CAAC,SAAS;KACrD,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM,CAAC;CACxB,GACG,CAAC,SAAS,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,GACzB,CAAC,GACD,KAAK,GACP,KAAK,CAAA;AAET;;;;GAIG;AACH,oBAAY,iBAAiB,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;AAE9E;;;;GAIG;AACH,oBAAY,2BAA2B,CAAC,CAAC,IAAI,CAAC,SAAS,iBAAiB,CACtE,GAAG,EACH,GAAG,CACJ,GACG,iBAAiB,CAAC,4BAA4B,CAAC,CAAC,CAAC,CAAC,GAClD,KAAK,CAAA"} \ No newline at end of file diff --git a/types/types/store.d.ts b/types/types/store.d.ts new file mode 100644 index 0000000000..1c3bffa5a8 --- /dev/null +++ b/types/types/store.d.ts @@ -0,0 +1,218 @@ +import { Action, AnyAction } from './actions'; +import { Reducer } from './reducers'; +/** + * Internal "virtual" symbol used to make the `CombinedState` type unique. + */ +declare const $CombinedState: unique symbol; +/** + * State base type for reducers created with `combineReducers()`. + * + * This type allows the `createStore()` method to infer which levels of the + * preloaded state can be partial. + * + * Because Typescript is really duck-typed, a type needs to have some + * identifying property to differentiate it from other types with matching + * prototypes for type checking purposes. That's why this type has the + * `$CombinedState` symbol property. Without the property, this type would + * match any object. The symbol doesn't really exist because it's an internal + * (i.e. not exported), and internally we never check its value. Since it's a + * symbol property, it's not expected to be unumerable, and the value is + * typed as always undefined, so its never expected to have a meaningful + * value anyway. It just makes this type distinquishable from plain `{}`. + */ +export declare type CombinedState = { + readonly [$CombinedState]?: undefined; +} & S; +/** + * Recursively makes combined state objects partial. Only combined state _root + * objects_ (i.e. the generated higher level object with keys mapping to + * individual reducers) are partial. + */ +export declare type PreloadedState = Required extends { + [$CombinedState]: undefined; +} ? S extends CombinedState ? { + [K in keyof S1]?: S1[K] extends object ? PreloadedState : S1[K]; +} : never : { + [K in keyof S]: S[K] extends object ? PreloadedState : S[K]; +}; +/** + * A *dispatching function* (or simply *dispatch function*) is a function that + * accepts an action or an async action; it then may or may not dispatch one + * or more actions to the store. + * + * We must distinguish between dispatching functions in general and the base + * `dispatch` function provided by the store instance without any middleware. + * + * The base dispatch function *always* synchronously sends an action to the + * store's reducer, along with the previous state returned by the store, to + * calculate a new state. It expects actions to be plain objects ready to be + * consumed by the reducer. + * + * Middleware wraps the base dispatch function. It allows the dispatch + * function to handle async actions in addition to actions. Middleware may + * transform, delay, ignore, or otherwise interpret actions or async actions + * before passing them to the next middleware. + * + * @template A The type of things (actions or otherwise) which may be + * dispatched. + */ +export interface Dispatch { + (action: T, ...extraArgs: any[]): T; +} +/** + * Function to remove listener added by `Store.subscribe()`. + */ +export interface Unsubscribe { + (): void; +} +/** + * A minimal observable of state changes. + * For more information, see the observable proposal: + * https://github.com/tc39/proposal-observable + */ +export declare type Observable = { + /** + * The minimal observable subscription method. + * @param {Object} observer Any object that can be used as an observer. + * The observer object should have a `next` method. + * @returns {subscription} An object with an `unsubscribe` method that can + * be used to unsubscribe the observable from the store, and prevent further + * emission of values from the observable. + */ + subscribe: (observer: Observer) => { + unsubscribe: Unsubscribe; + }; + [Symbol.observable](): Observable; +}; +/** + * An Observer is used to receive data from an Observable, and is supplied as + * an argument to subscribe. + */ +export declare type Observer = { + next?(value: T): void; +}; +/** + * A store is an object that holds the application's state tree. + * There should only be a single store in a Redux app, as the composition + * happens on the reducer level. + * + * @template S The type of state held by this store. + * @template A the type of actions which may be dispatched by this store. + */ +export interface Store { + /** + * Dispatches an action. It is the only way to trigger a state change. + * + * The `reducer` function, used to create the store, will be called with the + * current state tree and the given `action`. Its return value will be + * considered the **next** state of the tree, and the change listeners will + * be notified. + * + * The base implementation only supports plain object actions. If you want + * to dispatch a Promise, an Observable, a thunk, or something else, you + * need to wrap your store creating function into the corresponding + * middleware. For example, see the documentation for the `redux-thunk` + * package. Even the middleware will eventually dispatch plain object + * actions using this method. + * + * @param action A plain object representing “what changed”. It is a good + * idea to keep actions serializable so you can record and replay user + * sessions, or use the time travelling `redux-devtools`. An action must + * have a `type` property which may not be `undefined`. It is a good idea + * to use string constants for action types. + * + * @returns For convenience, the same action object you dispatched. + * + * Note that, if you use a custom middleware, it may wrap `dispatch()` to + * return something else (for example, a Promise you can await). + */ + dispatch: Dispatch; + /** + * Reads the state tree managed by the store. + * + * @returns The current state tree of your application. + */ + getState(): S; + /** + * Adds a change listener. It will be called any time an action is + * dispatched, and some part of the state tree may potentially have changed. + * You may then call `getState()` to read the current state tree inside the + * callback. + * + * You may call `dispatch()` from a change listener, with the following + * caveats: + * + * 1. The subscriptions are snapshotted just before every `dispatch()` call. + * If you subscribe or unsubscribe while the listeners are being invoked, + * this will not have any effect on the `dispatch()` that is currently in + * progress. However, the next `dispatch()` call, whether nested or not, + * will use a more recent snapshot of the subscription list. + * + * 2. The listener should not expect to see all states changes, as the state + * might have been updated multiple times during a nested `dispatch()` before + * the listener is called. It is, however, guaranteed that all subscribers + * registered before the `dispatch()` started will be called with the latest + * state by the time it exits. + * + * @param listener A callback to be invoked on every dispatch. + * @returns A function to remove this change listener. + */ + subscribe(listener: () => void): Unsubscribe; + /** + * Replaces the reducer currently used by the store to calculate the state. + * + * You might need this if your app implements code splitting and you want to + * load some of the reducers dynamically. You might also need this if you + * implement a hot reloading mechanism for Redux. + * + * @param nextReducer The reducer for the store to use instead. + */ + replaceReducer(nextReducer: Reducer): Store; + /** + * Interoperability point for observable/reactive libraries. + * @returns {observable} A minimal observable of state changes. + * For more information, see the observable proposal: + * https://github.com/tc39/proposal-observable + */ + [Symbol.observable](): Observable; +} +/** + * A store creator is a function that creates a Redux store. Like with + * dispatching function, we must distinguish the base store creator, + * `createStore(reducer, preloadedState)` exported from the Redux package, from + * store creators that are returned from the store enhancers. + * + * @template S The type of state to be held by the store. + * @template A The type of actions which may be dispatched. + * @template Ext Store extension that is mixed in to the Store type. + * @template StateExt State extension that is mixed into the state type. + */ +export interface StoreCreator { + (reducer: Reducer, enhancer?: StoreEnhancer): Store & Ext; + (reducer: Reducer, preloadedState?: PreloadedState, enhancer?: StoreEnhancer): Store & Ext; +} +/** + * A store enhancer is a higher-order function that composes a store creator + * to return a new, enhanced store creator. This is similar to middleware in + * that it allows you to alter the store interface in a composable way. + * + * Store enhancers are much the same concept as higher-order components in + * React, which are also occasionally called “component enhancers”. + * + * Because a store is not an instance, but rather a plain-object collection of + * functions, copies can be easily created and modified without mutating the + * original store. There is an example in `compose` documentation + * demonstrating that. + * + * Most likely you'll never write a store enhancer, but you may use the one + * provided by the developer tools. It is what makes time travel possible + * without the app being aware it is happening. Amusingly, the Redux + * middleware implementation is itself a store enhancer. + * + * @template Ext Store extension that is mixed into the Store type. + * @template StateExt State extension that is mixed into the state type. + */ +export declare type StoreEnhancer = (next: StoreEnhancerStoreCreator) => StoreEnhancerStoreCreator; +export declare type StoreEnhancerStoreCreator = (reducer: Reducer, preloadedState?: PreloadedState) => Store & Ext; +export {}; +//# sourceMappingURL=store.d.ts.map \ No newline at end of file diff --git a/types/types/store.d.ts.map b/types/types/store.d.ts.map new file mode 100644 index 0000000000..6d7cb364a9 --- /dev/null +++ b/types/types/store.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/types/store.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEpC;;GAEG;AACH,OAAO,CAAC,MAAM,cAAc,EAAE,OAAO,MAAM,CAAA;AAE3C;;;;;;;;;;;;;;;GAeG;AACH,oBAAY,aAAa,CAAC,CAAC,IAAI;IAAE,QAAQ,CA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,CAAC,CAAC,GAAG,GAAG,CAAA;CAChC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,oBAAY,aAAa,CAAC,GAAG,GAAG,EAAE,EAAE,QAAQ,GAAG,EAAE,IAAI,CACnD,IAAI,EAAE,yBAAyB,KAC5B,yBAAyB,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;AAC7C,oBAAY,yBAAyB,CAAC,GAAG,GAAG,EAAE,EAAE,QAAQ,GAAG,EAAE,IAAI,CAC/D,CAAC,GAAG,GAAG,EACP,CAAC,SAAS,MAAM,GAAG,SAAS,EAE5B,OAAO,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EACtB,cAAc,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,KAC/B,KAAK,CAAC,CAAC,GAAG,QAAQ,EAAE,CAAC,CAAC,GAAG,GAAG,CAAA"} \ No newline at end of file diff --git a/types/utils/actionTypes.d.ts b/types/utils/actionTypes.d.ts new file mode 100644 index 0000000000..014652ec57 --- /dev/null +++ b/types/utils/actionTypes.d.ts @@ -0,0 +1,13 @@ +/** + * These are private action types reserved by Redux. + * For any unknown actions, you must return the current state. + * If the current state is undefined, you must return the initial state. + * Do not reference these action types directly in your code. + */ +declare const ActionTypes: { + INIT: string; + REPLACE: string; + PROBE_UNKNOWN_ACTION: () => string; +}; +export default ActionTypes; +//# sourceMappingURL=actionTypes.d.ts.map \ No newline at end of file diff --git a/types/utils/actionTypes.d.ts.map b/types/utils/actionTypes.d.ts.map new file mode 100644 index 0000000000..3810b928b2 --- /dev/null +++ b/types/utils/actionTypes.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"actionTypes.d.ts","sourceRoot":"","sources":["../../src/utils/actionTypes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,QAAA,MAAM,WAAW;;;;CAIhB,CAAA;AAED,eAAe,WAAW,CAAA"} \ No newline at end of file diff --git a/types/utils/isPlainObject.d.ts b/types/utils/isPlainObject.d.ts new file mode 100644 index 0000000000..6e205895bd --- /dev/null +++ b/types/utils/isPlainObject.d.ts @@ -0,0 +1,6 @@ +/** + * @param {any} obj The object to inspect. + * @returns {boolean} True if the argument appears to be a plain object. + */ +export default function isPlainObject(obj: unknown): boolean; +//# sourceMappingURL=isPlainObject.d.ts.map \ No newline at end of file diff --git a/types/utils/isPlainObject.d.ts.map b/types/utils/isPlainObject.d.ts.map new file mode 100644 index 0000000000..0d4bef53e4 --- /dev/null +++ b/types/utils/isPlainObject.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"isPlainObject.d.ts","sourceRoot":"","sources":["../../src/utils/isPlainObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,GAAG,EAAE,OAAO,WASjD"} \ No newline at end of file diff --git a/types/utils/warning.d.ts b/types/utils/warning.d.ts new file mode 100644 index 0000000000..821e3b191a --- /dev/null +++ b/types/utils/warning.d.ts @@ -0,0 +1,8 @@ +/** + * Prints a warning in the console if it exists. + * + * @param {String} message The warning message. + * @returns {void} + */ +export default function warning(message: string): void; +//# sourceMappingURL=warning.d.ts.map \ No newline at end of file diff --git a/types/utils/warning.d.ts.map b/types/utils/warning.d.ts.map new file mode 100644 index 0000000000..1dd18b1a3d --- /dev/null +++ b/types/utils/warning.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"warning.d.ts","sourceRoot":"","sources":["../../src/utils/warning.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,OAAO,EAAE,MAAM,QAY9C"} \ No newline at end of file From 28ac91890c74d8f438d41a63e6b0a4aed1f106cc Mon Sep 17 00:00:00 2001 From: Gregory Beaver Date: Tue, 3 Sep 2019 10:44:43 -0400 Subject: [PATCH 3/7] remove autogenerated types dir --- types/applyMiddleware.d.ts | 38 ----- types/applyMiddleware.d.ts.map | 1 - types/bindActionCreators.d.ts | 28 ---- types/bindActionCreators.d.ts.map | 1 - types/combineReducers.d.ts | 26 ---- types/combineReducers.d.ts.map | 1 - types/compose.d.ts | 32 ----- types/compose.d.ts.map | 1 - types/createStore.d.ts | 31 ---- types/createStore.d.ts.map | 1 - types/index.d.ts | 13 -- types/index.d.ts.map | 1 - types/types/actions.d.ts | 56 -------- types/types/actions.d.ts.map | 1 - types/types/middleware.d.ts | 25 ---- types/types/middleware.d.ts.map | 1 - types/types/reducers.d.ts | 63 --------- types/types/reducers.d.ts.map | 1 - types/types/store.d.ts | 218 ----------------------------- types/types/store.d.ts.map | 1 - types/utils/actionTypes.d.ts | 13 -- types/utils/actionTypes.d.ts.map | 1 - types/utils/isPlainObject.d.ts | 6 - types/utils/isPlainObject.d.ts.map | 1 - types/utils/warning.d.ts | 8 -- types/utils/warning.d.ts.map | 1 - 26 files changed, 570 deletions(-) delete mode 100644 types/applyMiddleware.d.ts delete mode 100644 types/applyMiddleware.d.ts.map delete mode 100644 types/bindActionCreators.d.ts delete mode 100644 types/bindActionCreators.d.ts.map delete mode 100644 types/combineReducers.d.ts delete mode 100644 types/combineReducers.d.ts.map delete mode 100644 types/compose.d.ts delete mode 100644 types/compose.d.ts.map delete mode 100644 types/createStore.d.ts delete mode 100644 types/createStore.d.ts.map delete mode 100644 types/index.d.ts delete mode 100644 types/index.d.ts.map delete mode 100644 types/types/actions.d.ts delete mode 100644 types/types/actions.d.ts.map delete mode 100644 types/types/middleware.d.ts delete mode 100644 types/types/middleware.d.ts.map delete mode 100644 types/types/reducers.d.ts delete mode 100644 types/types/reducers.d.ts.map delete mode 100644 types/types/store.d.ts delete mode 100644 types/types/store.d.ts.map delete mode 100644 types/utils/actionTypes.d.ts delete mode 100644 types/utils/actionTypes.d.ts.map delete mode 100644 types/utils/isPlainObject.d.ts delete mode 100644 types/utils/isPlainObject.d.ts.map delete mode 100644 types/utils/warning.d.ts delete mode 100644 types/utils/warning.d.ts.map diff --git a/types/applyMiddleware.d.ts b/types/applyMiddleware.d.ts deleted file mode 100644 index fd14124930..0000000000 --- a/types/applyMiddleware.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { Middleware } from './types/middleware'; -import { StoreEnhancer } from './types/store'; -/** - * Creates a store enhancer that applies middleware to the dispatch method - * of the Redux store. This is handy for a variety of tasks, such as expressing - * asynchronous actions in a concise manner, or logging every action payload. - * - * See `redux-thunk` package as an example of the Redux middleware. - * - * Because middleware is potentially asynchronous, this should be the first - * store enhancer in the composition chain. - * - * Note that each middleware will be given the `dispatch` and `getState` functions - * as named arguments. - * - * @param {...Function} middlewares The middleware chain to be applied. - * @returns {Function} A store enhancer applying the middleware. - */ -export default function applyMiddleware(): StoreEnhancer; -export default function applyMiddleware(middleware1: Middleware): StoreEnhancer<{ - dispatch: Ext1; -}>; -export default function applyMiddleware(middleware1: Middleware, middleware2: Middleware): StoreEnhancer<{ - dispatch: Ext1 & Ext2; -}>; -export default function applyMiddleware(middleware1: Middleware, middleware2: Middleware, middleware3: Middleware): StoreEnhancer<{ - dispatch: Ext1 & Ext2 & Ext3; -}>; -export default function applyMiddleware(middleware1: Middleware, middleware2: Middleware, middleware3: Middleware, middleware4: Middleware): StoreEnhancer<{ - dispatch: Ext1 & Ext2 & Ext3 & Ext4; -}>; -export default function applyMiddleware(middleware1: Middleware, middleware2: Middleware, middleware3: Middleware, middleware4: Middleware, middleware5: Middleware): StoreEnhancer<{ - dispatch: Ext1 & Ext2 & Ext3 & Ext4 & Ext5; -}>; -export default function applyMiddleware(...middlewares: Middleware[]): StoreEnhancer<{ - dispatch: Ext; -}>; -//# sourceMappingURL=applyMiddleware.d.ts.map \ No newline at end of file diff --git a/types/applyMiddleware.d.ts.map b/types/applyMiddleware.d.ts.map deleted file mode 100644 index 2982be2643..0000000000 --- a/types/applyMiddleware.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"applyMiddleware.d.ts","sourceRoot":"","sources":["../src/applyMiddleware.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAiB,MAAM,oBAAoB,CA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,EAAE,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,EACrC,WAAW,EAAE,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,GACpC,aAAa,CAAC;IAAE,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;CAAE,CAAC,CAAA;AACzD,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EACrE,WAAW,EAAE,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,EACrC,WAAW,EAAE,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,EACrC,WAAW,EAAE,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,EACrC,WAAW,EAAE,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,EACrC,WAAW,EAAE,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,GACpC,aAAa,CAAC;IAAE,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;CAAE,CAAC,CAAA;AAChE,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,GAAG,EAAE,CAAC,GAAG,GAAG,EAClD,GAAG,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,GACxC,aAAa,CAAC;IAAE,QAAQ,EAAE,GAAG,CAAA;CAAE,CAAC,CAAA"} \ No newline at end of file diff --git a/types/bindActionCreators.d.ts b/types/bindActionCreators.d.ts deleted file mode 100644 index eda24ca5ed..0000000000 --- a/types/bindActionCreators.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { Dispatch } from './types/store'; -import { ActionCreator, ActionCreatorsMapObject } from './types/actions'; -/** - * Turns an object whose values are action creators, into an object with the - * same keys, but with every function wrapped into a `dispatch` call so they - * may be invoked directly. This is just a convenience method, as you can call - * `store.dispatch(MyActionCreators.doSomething())` yourself just fine. - * - * For convenience, you can also pass an action creator as the first argument, - * and get a dispatch wrapped function in return. - * - * @param actionCreators An object whose values are action - * creator functions. One handy way to obtain it is to use ES6 `import * as` - * syntax. You may also pass a single function. - * - * @param dispatch The `dispatch` function available on your Redux - * store. - * - * @returns The object mimicking the original object, but with - * every action creator wrapped into the `dispatch` call. If you passed a - * function as `actionCreators`, the return value will also be a single - * function. - */ -export default function bindActionCreators>(actionCreator: C, dispatch: Dispatch): C; -export default function bindActionCreators, B extends ActionCreator>(actionCreator: A, dispatch: Dispatch): B; -export default function bindActionCreators>(actionCreators: M, dispatch: Dispatch): M; -export default function bindActionCreators, N extends ActionCreatorsMapObject>(actionCreators: M, dispatch: Dispatch): N; -//# sourceMappingURL=bindActionCreators.d.ts.map \ No newline at end of file diff --git a/types/bindActionCreators.d.ts.map b/types/bindActionCreators.d.ts.map deleted file mode 100644 index 36d9c8b67a..0000000000 --- a/types/bindActionCreators.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bindActionCreators.d.ts","sourceRoot":"","sources":["../src/bindActionCreators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAEL,aAAa,EACb,uBAAuB,EACxB,MAAM,iBAAiB,CAAA;AAWxB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,CAAC,EAAE,CAAC,SAAS,aAAa,CAAC,CAAC,CAAC,EACtE,aAAa,EAAE,CAAC,EAChB,QAAQ,EAAE,QAAQ,GACjB,CAAC,CAAA;AAEJ,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,CAAC,SAAS,aAAa,CAAC,GAAG,CAAC,EAC5B,CAAC,SAAS,aAAa,CAAC,GAAG,CAAC,EAC5B,aAAa,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,CAAC,CAAA;AAE1C,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,CAAC,EACD,CAAC,SAAS,uBAAuB,CAAC,CAAC,CAAC,EACpC,cAAc,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,CAAC,CAAA;AAC3C,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,CAAC,SAAS,uBAAuB,CAAC,GAAG,CAAC,EACtC,CAAC,SAAS,uBAAuB,CAAC,GAAG,CAAC,EACtC,cAAc,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,CAAC,CAAA"} \ No newline at end of file diff --git a/types/combineReducers.d.ts b/types/combineReducers.d.ts deleted file mode 100644 index 802749043b..0000000000 --- a/types/combineReducers.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Reducer } from './types/reducers'; -import { AnyAction, Action } from './types/actions'; -import { ReducersMapObject, StateFromReducersMapObject, ActionFromReducersMapObject } from './types/reducers'; -import { CombinedState } from './types/store'; -/** - * Turns an object whose values are different reducer functions, into a single - * reducer function. It will call every child reducer, and gather their results - * into a single state object, whose keys correspond to the keys of the passed - * reducer functions. - * - * @template S Combined state object type. - * - * @param reducers An object whose values correspond to different reducer - * functions that need to be combined into one. One handy way to obtain it - * is to use ES6 `import * as reducers` syntax. The reducers may never - * return undefined for any action. Instead, they should return their - * initial state if the state passed to them was undefined, and the current - * state for any unrecognized action. - * - * @returns A reducer function that invokes every reducer inside the passed - * object, and builds a state object with the same shape. - */ -export default function combineReducers(reducers: ReducersMapObject): Reducer>; -export default function combineReducers(reducers: ReducersMapObject): Reducer, A>; -export default function combineReducers>(reducers: M): Reducer>, ActionFromReducersMapObject>; -//# sourceMappingURL=combineReducers.d.ts.map \ No newline at end of file diff --git a/types/combineReducers.d.ts.map b/types/combineReducers.d.ts.map deleted file mode 100644 index da0bacfbcb..0000000000 --- a/types/combineReducers.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"combineReducers.d.ts","sourceRoot":"","sources":["../src/combineReducers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAInD,OAAO,EACL,iBAAiB,EACjB,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAkG7C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,CAAC,EACvC,QAAQ,EAAE,iBAAiB,CAAC,CAAC,EAAE,GAAG,CAAC,GAClC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;AAC5B,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,SAAS,EACrE,QAAQ,EAAE,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,GAChC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AAC/B,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,CAAC,SAAS,iBAAiB,CAAC,GAAG,EAAE,GAAG,CAAC,EAC3E,QAAQ,EAAE,CAAC,GACV,OAAO,CACR,aAAa,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC,EAC5C,2BAA2B,CAAC,CAAC,CAAC,CAC/B,CAAA"} \ No newline at end of file diff --git a/types/compose.d.ts b/types/compose.d.ts deleted file mode 100644 index e6284ee180..0000000000 --- a/types/compose.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -declare type Func0 = () => R; -declare type Func1 = (a1: T1) => R; -declare type Func2 = (a1: T1, a2: T2) => R; -declare type Func3 = (a1: T1, a2: T2, a3: T3, ...args: any[]) => R; -/** - * Composes single-argument functions from right to left. The rightmost - * function can take multiple arguments as it provides the signature for the - * resulting composite function. - * - * @param funcs The functions to compose. - * @returns R function obtained by composing the argument functions from right - * to left. For example, `compose(f, g, h)` is identical to doing - * `(...args) => f(g(h(...args)))`. - */ -export default function compose(): (a: R) => R; -export default function compose(f: F): F; -export default function compose(f1: (b: A) => R, f2: Func0): Func0; -export default function compose(f1: (b: A) => R, f2: Func1): Func1; -export default function compose(f1: (b: A) => R, f2: Func2): Func2; -export default function compose(f1: (b: A) => R, f2: Func3): Func3; -export default function compose(f1: (b: B) => R, f2: (a: A) => B, f3: Func0): Func0; -export default function compose(f1: (b: B) => R, f2: (a: A) => B, f3: Func1): Func1; -export default function compose(f1: (b: B) => R, f2: (a: A) => B, f3: Func2): Func2; -export default function compose(f1: (b: B) => R, f2: (a: A) => B, f3: Func3): Func3; -export default function compose(f1: (b: C) => R, f2: (a: B) => C, f3: (a: A) => B, f4: Func0): Func0; -export default function compose(f1: (b: C) => R, f2: (a: B) => C, f3: (a: A) => B, f4: Func1): Func1; -export default function compose(f1: (b: C) => R, f2: (a: B) => C, f3: (a: A) => B, f4: Func2): Func2; -export default function compose(f1: (b: C) => R, f2: (a: B) => C, f3: (a: A) => B, f4: Func3): Func3; -export default function compose(f1: (b: any) => R, ...funcs: Function[]): (...args: any[]) => R; -export default function compose(...funcs: Function[]): (...args: any[]) => R; -export {}; -//# sourceMappingURL=compose.d.ts.map \ No newline at end of file diff --git a/types/compose.d.ts.map b/types/compose.d.ts.map deleted file mode 100644 index b403dd0b26..0000000000 --- a/types/compose.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../src/compose.ts"],"names":[],"mappings":"AAAA,aAAK,KAAK,CAAC,CAAC,IAAI,MAAM,CAAC,CAAA;AACvB,aAAK,KAAK,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,CAAA;AACjC,aAAK,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE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E,CAAC,CAAC,GACnB,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA;AACnB,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EACpD,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,EACf,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,EACf,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,EACf,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,GACvB,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA;AAGvB,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,CAAC,EAC/B,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,EACjB,GAAG,KAAK,EAAE,QAAQ,EAAE,GACnB,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA;AAExB,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,QAAQ,EAAE,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA"} \ No newline at end of file diff --git a/types/createStore.d.ts b/types/createStore.d.ts deleted file mode 100644 index d17ddc9088..0000000000 --- a/types/createStore.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { Store, PreloadedState, StoreEnhancer } from './types/store'; -import { Action } from './types/actions'; -import { Reducer } from './types/reducers'; -/** - * Creates a Redux store that holds the state tree. - * The only way to change the data in the store is to call `dispatch()` on it. - * - * There should only be a single store in your app. To specify how different - * parts of the state tree respond to actions, you may combine several reducers - * into a single reducer function by using `combineReducers`. - * - * @param {Function} reducer A function that returns the next state tree, given - * the current state tree and the action to handle. - * - * @param {any} [preloadedState] The initial state. You may optionally specify it - * to hydrate the state from the server in universal apps, or to restore a - * previously serialized user session. - * If you use `combineReducers` to produce the root reducer function, this must be - * an object with the same shape as `combineReducers` keys. - * - * @param {Function} [enhancer] The store enhancer. You may optionally specify it - * to enhance the store with third-party capabilities such as middleware, - * time travel, persistence, etc. The only store enhancer that ships with Redux - * is `applyMiddleware()`. - * - * @returns {Store} A Redux store that lets you read the state, dispatch actions - * and subscribe to changes. - */ -export default function createStore(reducer: Reducer, enhancer?: StoreEnhancer): Store & Ext; -export default function createStore(reducer: Reducer, preloadedState?: PreloadedState, enhancer?: StoreEnhancer): Store & Ext; -//# sourceMappingURL=createStore.d.ts.map \ No newline at end of file diff --git a/types/createStore.d.ts.map b/types/createStore.d.ts.map deleted file mode 100644 index ba7716bce1..0000000000 --- a/types/createStore.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"createStore.d.ts","sourceRoot":"","sources":["../src/createStore.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,EACL,cAAc,EACd,aAAa,EAGd,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAI1C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,QAAQ,EACpE,OAAO,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EACtB,QAAQ,CAAC,EAAE,aAAa,CAAC,GAAG,EAAE,QAAQ,CAAC,GACtC,KAAK,CAAC,CAAC,GAAG,QAAQ,EAAE,CAAC,CAAC,GAAG,GAAG,CAAA;AAC/B,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,QAAQ,EACpE,OAAO,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EACtB,cAAc,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,EAClC,QAAQ,CAAC,EAAE,aAAa,CAAC,GAAG,CAAC,GAC5B,KAAK,CAAC,CAAC,GAAG,QAAQ,EAAE,CAAC,CAAC,GAAG,GAAG,CAAA"} \ No newline at end of file diff --git a/types/index.d.ts b/types/index.d.ts deleted file mode 100644 index d7db2172e7..0000000000 --- a/types/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import createStore from './createStore'; -import combineReducers from './combineReducers'; -import bindActionCreators from './bindActionCreators'; -import applyMiddleware from './applyMiddleware'; -import compose from './compose'; -import __DO_NOT_USE__ActionTypes from './utils/actionTypes'; -export { CombinedState, PreloadedState, Dispatch, Unsubscribe, Observable, Observer, Store, StoreCreator, StoreEnhancer, StoreEnhancerStoreCreator } from './types/store'; -export { Reducer, ReducerFromReducersMapObject, ReducersMapObject, StateFromReducersMapObject, ActionFromReducer, ActionFromReducersMapObject } from './types/reducers'; -export { ActionCreator, ActionCreatorsMapObject } from './types/actions'; -export { MiddlewareAPI, Middleware } from './types/middleware'; -export { Action, AnyAction } from './types/actions'; -export { createStore, combineReducers, bindActionCreators, applyMiddleware, compose, __DO_NOT_USE__ActionTypes }; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/index.d.ts.map b/types/index.d.ts.map deleted file mode 100644 index 60e1e4c8f1..0000000000 --- a/types/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,eAAe,CAAA;AACvC,OAAO,eAAe,MAAM,mBAAmB,CAAA;AAC/C,OAAO,kBAAkB,MAAM,sBAAsB,CAAA;AACrD,OAAO,eAAe,MAAM,mBAAmB,CAAA;AAC/C,OAAO,OAAO,MAAM,WAAW,CAAA;AAE/B,OAAO,yBAAyB,MAAM,qBAAqB,CAAA;AAI3D,OAAO,EACL,aAAa,EACb,cAAc,EACd,QAAQ,EACR,WAAW,EACX,UAAU,EACV,QAAQ,EACR,KAAK,EACL,YAAY,EACZ,aAAa,EACb,yBAAyB,EAC1B,MAAM,eAAe,CAAA;AAEtB,OAAO,EACL,OAAO,EACP,4BAA4B,EAC5B,iBAAiB,EACjB,0BAA0B,EAC1B,iBAAiB,EACjB,2BAA2B,EAC5B,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AAExE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAE9D,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAsBnD,OAAO,EACL,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,OAAO,EACP,yBAAyB,EAC1B,CAAA"} \ No newline at end of file diff --git a/types/types/actions.d.ts b/types/types/actions.d.ts deleted file mode 100644 index d15cf37772..0000000000 --- a/types/types/actions.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * An *action* is a plain object that represents an intention to change the - * state. Actions are the only way to get data into the store. Any data, - * whether from UI events, network callbacks, or other sources such as - * WebSockets needs to eventually be dispatched as actions. - * - * Actions must have a `type` field that indicates the type of action being - * performed. Types can be defined as constants and imported from another - * module. It's better to use strings for `type` than Symbols because strings - * are serializable. - * - * Other than `type`, the structure of an action object is really up to you. - * If you're interested, check out Flux Standard Action for recommendations on - * how actions should be constructed. - * - * @template T the type of the action's `type` tag. - */ -export interface Action { - type: T; -} -/** - * An Action type which accepts any other properties. - * This is mainly for the use of the `Reducer` type. - * This is not part of `Action` itself to prevent types that extend `Action` from - * having an index signature. - */ -export interface AnyAction extends Action { - [extraProps: string]: any; -} -/** - * An *action creator* is, quite simply, a function that creates an action. Do - * not confuse the two terms—again, an action is a payload of information, and - * an action creator is a factory that creates an action. - * - * Calling an action creator only produces an action, but does not dispatch - * it. You need to call the store's `dispatch` function to actually cause the - * mutation. Sometimes we say *bound action creators* to mean functions that - * call an action creator and immediately dispatch its result to a specific - * store instance. - * - * If an action creator needs to read the current state, perform an API call, - * or cause a side effect, like a routing transition, it should return an - * async action instead of an action. - * - * @template A Returned action type. - */ -export interface ActionCreator { - (...args: any[]): A; -} -/** - * Object whose values are action creator functions. - */ -export interface ActionCreatorsMapObject { - [key: string]: ActionCreator; -} -//# sourceMappingURL=actions.d.ts.map \ No newline at end of file diff --git a/types/types/actions.d.ts.map b/types/types/actions.d.ts.map deleted file mode 100644 index 83619702c3..0000000000 --- a/types/types/actions.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/types/actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,MAAM,CAAC,CAAC,GAAG,GAAG;IAC7B,IAAI,EAAE,CAAC,CAAA;CACR;AAED;;;;;GAKG;AACH,MAAM,WAAW,SAAU,SAAQ,MAAM;IAEvC,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG,CAAA;CAC1B;AAID;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC;IAC9B,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB,CAAC,CAAC,GAAG,GAAG;IAC9C,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,CAAA;CAChC"} \ No newline at end of file diff --git a/types/types/middleware.d.ts b/types/types/middleware.d.ts deleted file mode 100644 index ec11111496..0000000000 --- a/types/types/middleware.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Dispatch } from './store'; -import { AnyAction } from './actions'; -export interface MiddlewareAPI { - dispatch: D; - getState(): S; -} -/** - * A middleware is a higher-order function that composes a dispatch function - * to return a new dispatch function. It often turns async actions into - * actions. - * - * Middleware is composable using function composition. It is useful for - * logging actions, performing side effects like routing, or turning an - * asynchronous API call into a series of synchronous actions. - * - * @template DispatchExt Extra Dispatch signature added by this middleware. - * @template S The type of the state supported by this middleware. - * @template D The type of Dispatch of the store where this middleware is - * installed. - */ -export interface Middleware<_DispatchExt = {}, // TODO: remove unused component -S = any, D extends Dispatch = Dispatch> { - (api: MiddlewareAPI): (next: Dispatch) => (action: any) => any; -} -//# sourceMappingURL=middleware.d.ts.map \ No newline at end of file diff --git a/types/types/middleware.d.ts.map b/types/types/middleware.d.ts.map deleted file mode 100644 index 785b40d012..0000000000 --- a/types/types/middleware.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/types/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ,EAAE,CAAC,GAAG,GAAG;IACnE,QAAQ,EAAE,CAAC,CAAA;IACX,QAAQ,IAAI,CAAC,CAAA;CACd;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,UAAU,CACzB,YAAY,GAAG,EAAE,EAAE,gCAAgC;AACnD,CAAC,GAAG,GAAG,EACP,CAAC,SAAS,QAAQ,GAAG,QAAQ;IAE7B,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAC1B,IAAI,EAAE,QAAQ,CAAC,SAAS,CAAC,KACtB,CAAC,MAAM,EAAE,GAAG,KAAK,GAAG,CAAA;CAC1B"} \ No newline at end of file diff --git a/types/types/reducers.d.ts b/types/types/reducers.d.ts deleted file mode 100644 index 1230a81523..0000000000 --- a/types/types/reducers.d.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { Action, AnyAction } from './actions'; -/** - * A *reducer* (also called a *reducing function*) is a function that accepts - * an accumulation and a value and returns a new accumulation. They are used - * to reduce a collection of values down to a single value - * - * Reducers are not unique to Redux—they are a fundamental concept in - * functional programming. Even most non-functional languages, like - * JavaScript, have a built-in API for reducing. In JavaScript, it's - * `Array.prototype.reduce()`. - * - * In Redux, the accumulated value is the state object, and the values being - * accumulated are actions. Reducers calculate a new state given the previous - * state and an action. They must be *pure functions*—functions that return - * the exact same output for given inputs. They should also be free of - * side-effects. This is what enables exciting features like hot reloading and - * time travel. - * - * Reducers are the most important concept in Redux. - * - * *Do not put API calls into reducers.* - * - * @template S The type of state consumed and produced by this reducer. - * @template A The type of actions the reducer can potentially respond to. - */ -export declare type Reducer = (state: S | undefined, action: A) => S; -/** - * Object whose values correspond to different reducer functions. - * - * @template A The type of actions the reducers can potentially respond to. - */ -export declare type ReducersMapObject = { - [K in keyof S]: Reducer; -}; -/** - * Infer a combined state shape from a `ReducersMapObject`. - * - * @template M Object map of reducers as provided to `combineReducers(map: M)`. - */ -export declare type StateFromReducersMapObject = M extends ReducersMapObject ? { - [P in keyof M]: M[P] extends Reducer ? S : never; -} : never; -/** - * Infer reducer union type from a `ReducersMapObject`. - * - * @template M Object map of reducers as provided to `combineReducers(map: M)`. - */ -export declare type ReducerFromReducersMapObject = M extends { - [P in keyof M]: infer R; -} ? R extends Reducer ? R : never : never; -/** - * Infer action type from a reducer function. - * - * @template R Type of reducer. - */ -export declare type ActionFromReducer = R extends Reducer ? A : never; -/** - * Infer action union type from a `ReducersMapObject`. - * - * @template M Object map of reducers as provided to `combineReducers(map: M)`. - */ -export declare type ActionFromReducersMapObject = M extends ReducersMapObject ? ActionFromReducer> : never; -//# sourceMappingURL=reducers.d.ts.map \ No newline at end of file diff --git a/types/types/reducers.d.ts.map b/types/types/reducers.d.ts.map deleted file mode 100644 index 35f63c3973..0000000000 --- a/types/types/reducers.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"reducers.d.ts","sourceRoot":"","sources":["../../src/types/reducers.ts"],"names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AC,CAAC,CAAC,GAClD,KAAK,CAAA"} \ No newline at end of file diff --git a/types/types/store.d.ts b/types/types/store.d.ts deleted file mode 100644 index 1c3bffa5a8..0000000000 --- a/types/types/store.d.ts +++ /dev/null @@ -1,218 +0,0 @@ -import { Action, AnyAction } from './actions'; -import { Reducer } from './reducers'; -/** - * Internal "virtual" symbol used to make the `CombinedState` type unique. - */ -declare const $CombinedState: unique symbol; -/** - * State base type for reducers created with `combineReducers()`. - * - * This type allows the `createStore()` method to infer which levels of the - * preloaded state can be partial. - * - * Because Typescript is really duck-typed, a type needs to have some - * identifying property to differentiate it from other types with matching - * prototypes for type checking purposes. That's why this type has the - * `$CombinedState` symbol property. Without the property, this type would - * match any object. The symbol doesn't really exist because it's an internal - * (i.e. not exported), and internally we never check its value. Since it's a - * symbol property, it's not expected to be unumerable, and the value is - * typed as always undefined, so its never expected to have a meaningful - * value anyway. It just makes this type distinquishable from plain `{}`. - */ -export declare type CombinedState = { - readonly [$CombinedState]?: undefined; -} & S; -/** - * Recursively makes combined state objects partial. Only combined state _root - * objects_ (i.e. the generated higher level object with keys mapping to - * individual reducers) are partial. - */ -export declare type PreloadedState = Required extends { - [$CombinedState]: undefined; -} ? S extends CombinedState ? { - [K in keyof S1]?: S1[K] extends object ? PreloadedState : S1[K]; -} : never : { - [K in keyof S]: S[K] extends object ? PreloadedState : S[K]; -}; -/** - * A *dispatching function* (or simply *dispatch function*) is a function that - * accepts an action or an async action; it then may or may not dispatch one - * or more actions to the store. - * - * We must distinguish between dispatching functions in general and the base - * `dispatch` function provided by the store instance without any middleware. - * - * The base dispatch function *always* synchronously sends an action to the - * store's reducer, along with the previous state returned by the store, to - * calculate a new state. It expects actions to be plain objects ready to be - * consumed by the reducer. - * - * Middleware wraps the base dispatch function. It allows the dispatch - * function to handle async actions in addition to actions. Middleware may - * transform, delay, ignore, or otherwise interpret actions or async actions - * before passing them to the next middleware. - * - * @template A The type of things (actions or otherwise) which may be - * dispatched. - */ -export interface Dispatch { - (action: T, ...extraArgs: any[]): T; -} -/** - * Function to remove listener added by `Store.subscribe()`. - */ -export interface Unsubscribe { - (): void; -} -/** - * A minimal observable of state changes. - * For more information, see the observable proposal: - * https://github.com/tc39/proposal-observable - */ -export declare type Observable = { - /** - * The minimal observable subscription method. - * @param {Object} observer Any object that can be used as an observer. - * The observer object should have a `next` method. - * @returns {subscription} An object with an `unsubscribe` method that can - * be used to unsubscribe the observable from the store, and prevent further - * emission of values from the observable. - */ - subscribe: (observer: Observer) => { - unsubscribe: Unsubscribe; - }; - [Symbol.observable](): Observable; -}; -/** - * An Observer is used to receive data from an Observable, and is supplied as - * an argument to subscribe. - */ -export declare type Observer = { - next?(value: T): void; -}; -/** - * A store is an object that holds the application's state tree. - * There should only be a single store in a Redux app, as the composition - * happens on the reducer level. - * - * @template S The type of state held by this store. - * @template A the type of actions which may be dispatched by this store. - */ -export interface Store { - /** - * Dispatches an action. It is the only way to trigger a state change. - * - * The `reducer` function, used to create the store, will be called with the - * current state tree and the given `action`. Its return value will be - * considered the **next** state of the tree, and the change listeners will - * be notified. - * - * The base implementation only supports plain object actions. If you want - * to dispatch a Promise, an Observable, a thunk, or something else, you - * need to wrap your store creating function into the corresponding - * middleware. For example, see the documentation for the `redux-thunk` - * package. Even the middleware will eventually dispatch plain object - * actions using this method. - * - * @param action A plain object representing “what changed”. It is a good - * idea to keep actions serializable so you can record and replay user - * sessions, or use the time travelling `redux-devtools`. An action must - * have a `type` property which may not be `undefined`. It is a good idea - * to use string constants for action types. - * - * @returns For convenience, the same action object you dispatched. - * - * Note that, if you use a custom middleware, it may wrap `dispatch()` to - * return something else (for example, a Promise you can await). - */ - dispatch: Dispatch; - /** - * Reads the state tree managed by the store. - * - * @returns The current state tree of your application. - */ - getState(): S; - /** - * Adds a change listener. It will be called any time an action is - * dispatched, and some part of the state tree may potentially have changed. - * You may then call `getState()` to read the current state tree inside the - * callback. - * - * You may call `dispatch()` from a change listener, with the following - * caveats: - * - * 1. The subscriptions are snapshotted just before every `dispatch()` call. - * If you subscribe or unsubscribe while the listeners are being invoked, - * this will not have any effect on the `dispatch()` that is currently in - * progress. However, the next `dispatch()` call, whether nested or not, - * will use a more recent snapshot of the subscription list. - * - * 2. The listener should not expect to see all states changes, as the state - * might have been updated multiple times during a nested `dispatch()` before - * the listener is called. It is, however, guaranteed that all subscribers - * registered before the `dispatch()` started will be called with the latest - * state by the time it exits. - * - * @param listener A callback to be invoked on every dispatch. - * @returns A function to remove this change listener. - */ - subscribe(listener: () => void): Unsubscribe; - /** - * Replaces the reducer currently used by the store to calculate the state. - * - * You might need this if your app implements code splitting and you want to - * load some of the reducers dynamically. You might also need this if you - * implement a hot reloading mechanism for Redux. - * - * @param nextReducer The reducer for the store to use instead. - */ - replaceReducer(nextReducer: Reducer): Store; - /** - * Interoperability point for observable/reactive libraries. - * @returns {observable} A minimal observable of state changes. - * For more information, see the observable proposal: - * https://github.com/tc39/proposal-observable - */ - [Symbol.observable](): Observable; -} -/** - * A store creator is a function that creates a Redux store. Like with - * dispatching function, we must distinguish the base store creator, - * `createStore(reducer, preloadedState)` exported from the Redux package, from - * store creators that are returned from the store enhancers. - * - * @template S The type of state to be held by the store. - * @template A The type of actions which may be dispatched. - * @template Ext Store extension that is mixed in to the Store type. - * @template StateExt State extension that is mixed into the state type. - */ -export interface StoreCreator { - (reducer: Reducer, enhancer?: StoreEnhancer): Store & Ext; - (reducer: Reducer, preloadedState?: PreloadedState, enhancer?: StoreEnhancer): Store & Ext; -} -/** - * A store enhancer is a higher-order function that composes a store creator - * to return a new, enhanced store creator. This is similar to middleware in - * that it allows you to alter the store interface in a composable way. - * - * Store enhancers are much the same concept as higher-order components in - * React, which are also occasionally called “component enhancers”. - * - * Because a store is not an instance, but rather a plain-object collection of - * functions, copies can be easily created and modified without mutating the - * original store. There is an example in `compose` documentation - * demonstrating that. - * - * Most likely you'll never write a store enhancer, but you may use the one - * provided by the developer tools. It is what makes time travel possible - * without the app being aware it is happening. Amusingly, the Redux - * middleware implementation is itself a store enhancer. - * - * @template Ext Store extension that is mixed into the Store type. - * @template StateExt State extension that is mixed into the state type. - */ -export declare type StoreEnhancer = (next: StoreEnhancerStoreCreator) => StoreEnhancerStoreCreator; -export declare type StoreEnhancerStoreCreator = (reducer: Reducer, preloadedState?: PreloadedState) => Store & Ext; -export {}; -//# sourceMappingURL=store.d.ts.map \ No newline at end of file diff --git a/types/types/store.d.ts.map b/types/types/store.d.ts.map deleted file mode 100644 index 6d7cb364a9..0000000000 --- a/types/types/store.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/types/store.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEpC;;GAEG;AACH,OAAO,CAAC,MAAM,cAAc,EAAE,OAAO,MAAM,CAAA;AAE3C;;;;;;;;;;;;;;;GAeG;AACH,oBAAY,aAAa,CAAC,CAAC,IAAI;IAAE,QAAQ,CAAC,CAAC,cAAc,CAAC,CAAC,EAAE,SAAS,CAAA;CAAE,GAAG,CAAC,CAAA;AAE5E;;;;GAIG;AACH,oBAAY,cAAc,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,SAAS;IAClD,CAAC,cAAc,CAAC,EAAE,SAAS,CAAA;CAC5B,GACG,CAAC,SAAS,aAAa,CAAC,MAAM,EAAE,CAAC,GAC/B;KACG,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;CACvE,GACD,KAAK,GACP;KACG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,C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actionTypes.d.ts b/types/utils/actionTypes.d.ts deleted file mode 100644 index 014652ec57..0000000000 --- a/types/utils/actionTypes.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * These are private action types reserved by Redux. - * For any unknown actions, you must return the current state. - * If the current state is undefined, you must return the initial state. - * Do not reference these action types directly in your code. - */ -declare const ActionTypes: { - INIT: string; - REPLACE: string; - PROBE_UNKNOWN_ACTION: () => string; -}; -export default ActionTypes; -//# sourceMappingURL=actionTypes.d.ts.map \ No newline at end of file diff --git a/types/utils/actionTypes.d.ts.map b/types/utils/actionTypes.d.ts.map deleted file mode 100644 index 3810b928b2..0000000000 --- a/types/utils/actionTypes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"actionTypes.d.ts","sourceRoot":"","sources":["../../src/utils/actionTypes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,QAAA,MAAM,WAAW;;;;CAIhB,CAAA;AAED,eAAe,WAAW,CAAA"} \ No newline at end of file diff --git a/types/utils/isPlainObject.d.ts b/types/utils/isPlainObject.d.ts deleted file mode 100644 index 6e205895bd..0000000000 --- a/types/utils/isPlainObject.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * @param {any} obj The object to inspect. - * @returns {boolean} True if the argument appears to be a plain object. - */ -export default function isPlainObject(obj: unknown): boolean; -//# sourceMappingURL=isPlainObject.d.ts.map \ No newline at end of file diff --git a/types/utils/isPlainObject.d.ts.map b/types/utils/isPlainObject.d.ts.map deleted file mode 100644 index 0d4bef53e4..0000000000 --- a/types/utils/isPlainObject.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"isPlainObject.d.ts","sourceRoot":"","sources":["../../src/utils/isPlainObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,GAAG,EAAE,OAAO,WASjD"} \ No newline at end of file diff --git a/types/utils/warning.d.ts b/types/utils/warning.d.ts deleted file mode 100644 index 821e3b191a..0000000000 --- a/types/utils/warning.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Prints a warning in the console if it exists. - * - * @param {String} message The warning message. - * @returns {void} - */ -export default function warning(message: string): void; -//# sourceMappingURL=warning.d.ts.map \ No newline at end of file diff --git a/types/utils/warning.d.ts.map b/types/utils/warning.d.ts.map deleted file mode 100644 index 1dd18b1a3d..0000000000 --- a/types/utils/warning.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"warning.d.ts","sourceRoot":"","sources":["../../src/utils/warning.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,OAAO,EAAE,MAAM,QAY9C"} \ No newline at end of file From e297fda8ec98913c05b5ab8a68e73eb29f486048 Mon Sep 17 00:00:00 2001 From: Gregory Beaver Date: Tue, 3 Sep 2019 10:44:58 -0400 Subject: [PATCH 4/7] ignore auto-generated types --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index cc152e1c4f..bf6c14bd88 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ dist lib es coverage +types website/translated_docs website/build/ From 8b574b32c1c8e421463cbbb41629875c9171580c Mon Sep 17 00:00:00 2001 From: Gregory Beaver Date: Tue, 3 Sep 2019 12:39:19 -0400 Subject: [PATCH 5/7] better type building, also clean old definitions --- package.json | 7 ++++--- tsconfig.json | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 9fdfa93c93..1e430649ce 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "types" ], "scripts": { - "clean": "rimraf lib dist es coverage", + "clean": "rimraf lib dist es coverage types", "format": "prettier --write \"{src,test}/**/*.{js,ts}\" index.d.ts \"**/*.md\"", "format:check": "prettier --list-different \"{src,test}/**/*.{js,ts}\" index.d.ts \"**/*.md\"", "lint": "eslint --ext js,ts src test", @@ -44,8 +44,9 @@ "test:watch": "npm test -- --watch", "test:cov": "npm test -- --coverage", "build": "npm run build-types && rollup -c", - "prepare": "npm run clean && npm run format:check && npm run lint && npm test", - "build-types": "tsc", + "prepare": "npm run clean && npm run check-types && npm run format:check && npm run lint && npm test", + "build-types": "tsc --emitDeclarationOnly", + "check-types": "tsc --noEmit", "examples:lint": "eslint --ext js,ts examples", "examples:test": "cross-env CI=true babel-node examples/testAll.js" }, diff --git a/tsconfig.json b/tsconfig.json index 74bb33b2ce..0567a9d599 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,13 +13,14 @@ "declaration": true /* Generates corresponding '.d.ts' file. */, "declarationMap": true /* Generates a sourcemap for each corresponding '.d.ts' file. */, "declarationDir": "./types" /* Output directory for generated declaration files. */, + // "emitDeclarationOnly": true /* Only emit ‘.d.ts’ declaration files. */, "sourceMap": true /* Generates corresponding '.map' file. */, // "outFile": "./", /* Concatenate and emit output to single file. */ // "outDir": "./types" /* Redirect output structure to the directory. */, // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ // "composite": true, /* Enable project compilation */ "removeComments": false /* Do not emit comments to output. */, - "noEmit": true /* Do not emit outputs. */, + // "noEmit": true /* Do not emit outputs. */, // "importHelpers": true, /* Import emit helpers from 'tslib'. */ // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ // "isolatedModules": true /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */, From 291c2638d327a16edcbfc938609bb35d2c6718cd Mon Sep 17 00:00:00 2001 From: Gregory Beaver Date: Tue, 3 Sep 2019 14:45:24 -0400 Subject: [PATCH 6/7] use types instead of typings Co-Authored-By: Jed Mao --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1e430649ce..af8b30bf27 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "main": "lib/redux.js", "unpkg": "dist/redux.js", "module": "es/redux.js", - "typings": "types/index.d.ts", + "types": "types/index.d.ts", "files": [ "dist", "lib", From d175a499a431e2d7221556d69b9c405c872ed0dd Mon Sep 17 00:00:00 2001 From: Tim Dorr Date: Thu, 5 Sep 2019 12:31:22 -0400 Subject: [PATCH 7/7] Don't build declaration maps --- tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 0567a9d599..1ef2e9f083 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,7 +11,7 @@ // "checkJs": true, /* Report errors in .js files. */ "jsx": "react" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */, "declaration": true /* Generates corresponding '.d.ts' file. */, - "declarationMap": true /* Generates a sourcemap for each corresponding '.d.ts' file. */, + // "declarationMap": true /* Generates a sourcemap for each corresponding '.d.ts' file. */, "declarationDir": "./types" /* Output directory for generated declaration files. */, // "emitDeclarationOnly": true /* Only emit ‘.d.ts’ declaration files. */, "sourceMap": true /* Generates corresponding '.map' file. */,