From 91c135589035a0bcbc500a8b9987b19b4a03af7f Mon Sep 17 00:00:00 2001 From: Giedrius Grabauskas Date: Mon, 17 Jul 2017 12:25:42 +0300 Subject: [PATCH 1/2] Created StoresList type. --- types/flux/lib/FluxContainer.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/flux/lib/FluxContainer.d.ts b/types/flux/lib/FluxContainer.d.ts index 54b578cc1d..4d49293fa6 100644 --- a/types/flux/lib/FluxContainer.d.ts +++ b/types/flux/lib/FluxContainer.d.ts @@ -37,8 +37,10 @@ export interface RealOptions { export type ComponentConstructor = React.ComponentClass | React.StatelessComponent; +export type StoresList = Array>; + export interface ComponentStatic { - getStores(maybeProps?: TProps, maybeContext?: TContext): Array>; + getStores(maybeProps?: TProps, maybeContext?: TContext): StoresList; calculateState(prevState: TState, maybeProps?: TProps, maybeContext?: TContext): TState; } From 528ba240c9704e7f31f0eaadacd3ea77f285fc54 Mon Sep 17 00:00:00 2001 From: Giedrius Grabauskas Date: Mon, 17 Jul 2017 12:28:19 +0300 Subject: [PATCH 2/2] Implemented StoresList in tests. --- types/flux/test/FluxUtils.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/flux/test/FluxUtils.tsx b/types/flux/test/FluxUtils.tsx index 1cd3705fab..38e06e71e4 100644 --- a/types/flux/test/FluxUtils.tsx +++ b/types/flux/test/FluxUtils.tsx @@ -38,7 +38,7 @@ interface State { } class CounterContainer extends React.Component { - static getStores() { + static getStores(): Container.StoresList { return [Store]; }