Skip to content
This repository was archived by the owner on Sep 21, 2021. It is now read-only.

Commit 02b5fbc

Browse files
committed
Update flow types to match changed path property
1 parent c4f3be0 commit 02b5fbc

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

packages/devtools-reps/src/object-inspector/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const {
1313
shouldRenderRootsInReps
1414
} = Utils;
1515

16-
import type { Props, State } from "./types";
16+
import type { Props, Store } from "./types";
1717

1818
class OI extends PureComponent {
1919

@@ -22,7 +22,7 @@ class OI extends PureComponent {
2222
this.store = createStore(props);
2323
}
2424

25-
store: {dispatch: (any) => any, getState: () => State};
25+
store: Store;
2626

2727
getStore() {
2828
return this.store;

packages/devtools-reps/src/object-inspector/types.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ export type NodeMeta = {
1818
endIndex: number,
1919
};
2020

21+
export type Path = Symbol;
2122
export type Node = {
2223
contents: Array<Node> | NodeContents,
2324
name: string,
24-
path: string,
25+
path: Path,
2526
type: ?Symbol,
2627
meta: ?NodeMeta,
2728
};
@@ -50,9 +51,9 @@ export type ObjectClient = {
5051
getPrototype: () => Promise<{prototype: Object}>,
5152
};
5253

53-
export type CachedNodes = Map<string, Array<Node>>;
54+
export type CachedNodes = Map<Path, Array<Node>>;
5455

55-
export type LoadedProperties = Map<string, GripProperties>;
56+
export type LoadedProperties = Map<Path, GripProperties>;
5657

5758
export type Mode = MODE.TINY | MODE.SHORT | MODE.LONG;
5859

@@ -91,10 +92,10 @@ export type Props = {
9192
}
9293
) => any,
9394
actors: Set<string>,
94-
expandedPaths: Set<string>,
95+
expandedPaths: Set<Path>,
9596
focusedItem: ?Node,
9697
loadedProperties: LoadedProperties,
97-
loading: Map<string, Array<Promise<GripProperties>>>,
98+
loading: Map<Path, Array<Promise<GripProperties>>>,
9899
};
99100

100101
export type ReduxAction = {
@@ -104,11 +105,16 @@ export type ReduxAction = {
104105

105106
export type State = {
106107
actors: Set<string>,
107-
expandedPaths: Set<string>,
108+
expandedPaths: Set<Path>,
108109
focusedItem: ?Node,
109110
loadedProperties: LoadedProperties,
110111
};
111112

113+
export type Store = {
114+
dispatch: (any) => any,
115+
getState: () => State
116+
};
117+
112118
export type ObjectInspectorId = string | number;
113119

114120
export type PersistedStates = Map<ObjectInspectorId, State>;

0 commit comments

Comments
 (0)