Generate typed QX bindings and add source editing tools
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import http from "node:http";
|
||||
export * from "./bindings.js";
|
||||
import { AsyncLocalStorage } from "node:async_hooks";
|
||||
import { randomUUID } from "node:crypto";
|
||||
import { create, equals } from "@bufbuild/protobuf";
|
||||
@@ -137,6 +138,7 @@ export type EdgePort = {
|
||||
projectionId: string;
|
||||
resolve(): Promise<string[]>;
|
||||
connect(targetObjectId: string): Promise<void>;
|
||||
disconnect(targetObjectId: string): Promise<void>;
|
||||
};
|
||||
export type InterfacePort = {
|
||||
objectId: string;
|
||||
@@ -210,6 +212,12 @@ export const createRuntimeContext = (
|
||||
async connect(targetObjectId) {
|
||||
await camino.connectEdge({ objectId: dependencyObjectId, edgeTypeId, projectionId, targetObjectId });
|
||||
},
|
||||
async disconnect(targetObjectId) {
|
||||
const result = await camino.resolveEdge({ objectId: dependencyObjectId, edgeTypeId, projectionId });
|
||||
for (const entry of result.edges) {
|
||||
if (targetForEdge(entry, projectionId) === targetObjectId) await camino.disconnectEdge({ edgeId: entry.id });
|
||||
}
|
||||
},
|
||||
};
|
||||
ports.set(dependency.portId, edge);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user