Pull out explicit NodeType and EdgeType (#608)

Will be useful for #502.

Test plan: `yarn flow`
This commit is contained in:
Dandelion Mané 2018-08-06 13:05:51 -07:00 committed by GitHub
parent d7cb4c65fa
commit 943dea94f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 10 deletions

View File

@ -3,20 +3,24 @@
import type {Graph, NodeAddressT, EdgeAddressT} from "../core/graph"; import type {Graph, NodeAddressT, EdgeAddressT} from "../core/graph";
import type {Repo} from "../core/repo"; import type {Repo} from "../core/repo";
export type EdgeType = {|
+forwardName: string,
+backwardName: string,
+prefix: EdgeAddressT,
|};
export type NodeType = {|
+name: string,
+prefix: NodeAddressT,
+defaultWeight: number,
|};
export interface StaticPluginAdapter { export interface StaticPluginAdapter {
name(): string; name(): string;
nodePrefix(): NodeAddressT; nodePrefix(): NodeAddressT;
edgePrefix(): EdgeAddressT; edgePrefix(): EdgeAddressT;
nodeTypes(): Array<{| nodeTypes(): NodeType[];
+name: string, edgeTypes(): EdgeType[];
+prefix: NodeAddressT,
+defaultWeight: number,
|}>;
edgeTypes(): Array<{|
+forwardName: string,
+backwardName: string,
+prefix: EdgeAddressT,
|}>;
load(repo: Repo): Promise<DynamicPluginAdapter>; load(repo: Repo): Promise<DynamicPluginAdapter>;
} }