diff --git a/src/analysis/types.js b/src/analysis/types.js new file mode 100644 index 0000000..955cfcd --- /dev/null +++ b/src/analysis/types.js @@ -0,0 +1,18 @@ +// @flow + +import {type NodeAddressT, type EdgeAddressT} from "../core/graph"; + +export type EdgeType = {| + +forwardName: string, + +backwardName: string, + +defaultForwardWeight: number, + +defaultBackwardWeight: number, + +prefix: EdgeAddressT, +|}; + +export type NodeType = {| + +name: string, + +pluralName: string, + +prefix: NodeAddressT, + +defaultWeight: number, +|}; diff --git a/src/app/adapters/adapterSet.js b/src/app/adapters/adapterSet.js index 0d66455..97bc00c 100644 --- a/src/app/adapters/adapterSet.js +++ b/src/app/adapters/adapterSet.js @@ -5,12 +5,8 @@ import {NodeTrie, EdgeTrie} from "../../core/trie"; import type {Assets} from "../assets"; import type {RepoId} from "../../core/repoId"; -import type { - StaticPluginAdapter, - DynamicPluginAdapter, - NodeType, - EdgeType, -} from "./pluginAdapter"; +import type {StaticPluginAdapter, DynamicPluginAdapter} from "./pluginAdapter"; +import type {EdgeType, NodeType} from "../../analysis/types"; import {FallbackStaticAdapter} from "./fallbackAdapter"; diff --git a/src/app/adapters/demoAdapters.js b/src/app/adapters/demoAdapters.js index 0d35eb3..d138955 100644 --- a/src/app/adapters/demoAdapters.js +++ b/src/app/adapters/demoAdapters.js @@ -7,12 +7,8 @@ import { type NodeAddressT, EdgeAddress, } from "../../core/graph"; -import type { - StaticPluginAdapter, - DynamicPluginAdapter, - EdgeType, - NodeType, -} from "./pluginAdapter"; +import type {StaticPluginAdapter, DynamicPluginAdapter} from "./pluginAdapter"; +import type {EdgeType, NodeType} from "../../analysis/types"; import {StaticAdapterSet} from "./adapterSet"; import {makeRepoId, type RepoId} from "../../core/repoId"; diff --git a/src/app/adapters/pluginAdapter.js b/src/app/adapters/pluginAdapter.js index 2a5851b..1bf601f 100644 --- a/src/app/adapters/pluginAdapter.js +++ b/src/app/adapters/pluginAdapter.js @@ -4,21 +4,7 @@ import {type Node as ReactNode} from "react"; import {Graph, type NodeAddressT, type EdgeAddressT} from "../../core/graph"; import type {Assets} from "../assets"; import type {RepoId} from "../../core/repoId"; - -export type EdgeType = {| - +forwardName: string, - +backwardName: string, - +defaultForwardWeight: number, - +defaultBackwardWeight: number, - +prefix: EdgeAddressT, -|}; - -export type NodeType = {| - +name: string, - +pluralName: string, - +prefix: NodeAddressT, - +defaultWeight: number, -|}; +import type {EdgeType, NodeType} from "../../analysis/types"; export interface StaticPluginAdapter { name(): string; diff --git a/src/app/credExplorer/pagerankTable/Aggregation.test.js b/src/app/credExplorer/pagerankTable/Aggregation.test.js index 9303eb1..a7c8cf3 100644 --- a/src/app/credExplorer/pagerankTable/Aggregation.test.js +++ b/src/app/credExplorer/pagerankTable/Aggregation.test.js @@ -5,7 +5,7 @@ import {shallow} from "enzyme"; import * as NullUtil from "../../../util/null"; import {NodeAddress, EdgeAddress} from "../../../core/graph"; -import type {NodeType, EdgeType} from "../../adapters/pluginAdapter"; +import type {EdgeType, NodeType} from "../../../analysis/types"; import { AggregationRowList, AggregationRow, diff --git a/src/app/credExplorer/pagerankTable/aggregate.js b/src/app/credExplorer/pagerankTable/aggregate.js index 47b5796..1305e8c 100644 --- a/src/app/credExplorer/pagerankTable/aggregate.js +++ b/src/app/credExplorer/pagerankTable/aggregate.js @@ -4,7 +4,7 @@ import sortBy from "lodash.sortby"; import stringify from "json-stable-stringify"; import * as MapUtil from "../../../util/map"; import {NodeTrie, EdgeTrie} from "../../../core/trie"; -import type {NodeType, EdgeType} from "../../adapters/pluginAdapter"; +import type {EdgeType, NodeType} from "../../../analysis/types"; import type {ScoredConnection} from "../../../analysis/pagerankNodeDecomposition"; // Sorted by descending `summary.score` diff --git a/src/app/credExplorer/weights/weights.js b/src/app/credExplorer/weights/weights.js index 4fbdb52..c689f44 100644 --- a/src/app/credExplorer/weights/weights.js +++ b/src/app/credExplorer/weights/weights.js @@ -2,7 +2,7 @@ import * as MapUtil from "../../../util/map"; import {type NodeAddressT, type EdgeAddressT} from "../../../core/graph"; -import type {NodeType, EdgeType} from "../../adapters/pluginAdapter"; +import type {EdgeType, NodeType} from "../../../analysis/types"; import type {StaticPluginAdapter} from "../../adapters/pluginAdapter"; import type {StaticAdapterSet} from "../../adapters/adapterSet";