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 {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>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue