Pull out explicit NodeType and EdgeType (#608)
Will be useful for #502. Test plan: `yarn flow`
This commit is contained in:
parent
d7cb4c65fa
commit
943dea94f9
|
@ -3,20 +3,24 @@
|
|||
import type {Graph, NodeAddressT, EdgeAddressT} from "../core/graph";
|
||||
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 {
|
||||
name(): string;
|
||||
nodePrefix(): NodeAddressT;
|
||||
edgePrefix(): EdgeAddressT;
|
||||
nodeTypes(): Array<{|
|
||||
+name: string,
|
||||
+prefix: NodeAddressT,
|
||||
+defaultWeight: number,
|
||||
|}>;
|
||||
edgeTypes(): Array<{|
|
||||
+forwardName: string,
|
||||
+backwardName: string,
|
||||
+prefix: EdgeAddressT,
|
||||
|}>;
|
||||
nodeTypes(): NodeType[];
|
||||
edgeTypes(): EdgeType[];
|
||||
load(repo: Repo): Promise<DynamicPluginAdapter>;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue