Move `{Node,Edge}Type` to src/analysis/types.js (#946)

Test plan: `yarn test`

Part of ongoing work on #704
This commit is contained in:
Dandelion Mané 2018-10-29 23:49:53 +00:00 committed by GitHub
parent 917b793aca
commit 5f2cc56172
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 26 additions and 30 deletions

18
src/analysis/types.js Normal file
View File

@ -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,
|};

View File

@ -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";

View File

@ -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";

View File

@ -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;

View File

@ -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,

View File

@ -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`

View File

@ -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";