Add explicit CRDT edit contracts and structured query values
This commit is contained in:
@@ -28,6 +28,8 @@ export const generateClientContracts = (
|
||||
return qualified
|
||||
? `CapabilityReference<${JSON.stringify(value.expectation.kind === "atom" ? `atom:${value.expectation.atomId}` : `interface:${value.expectation.interfaceRevisionId}`)}>`
|
||||
: `{readonly $quixosRef: string}`;
|
||||
case "change":
|
||||
throw new Error("CRDT change values require the prepared-change codec and runtime (LF-19)");
|
||||
case "optional":
|
||||
return `(${type(value.value)} | null)`;
|
||||
case "list":
|
||||
|
||||
@@ -60,6 +60,8 @@ export const genericImplementationType = (
|
||||
return `QxObjectRef<${target(type.expectation, scope)}>`;
|
||||
case "record":
|
||||
return object(Object.entries(type.fields).map(([name, field]) => [name, value(field, scope, depth + 1)]));
|
||||
case "change":
|
||||
throw new Error("CRDT change values require the prepared-change codec and runtime (LF-19)");
|
||||
case "optional":
|
||||
return `(${value(type.value, scope, depth + 1)} | null)`;
|
||||
case "list":
|
||||
|
||||
@@ -122,6 +122,8 @@ export const generateTypeScriptBindings = (
|
||||
}[value.name];
|
||||
case "object-ref":
|
||||
return `QxObjectRef<${q(value.expectation.kind === "atom" ? `atom:${value.expectation.atomId}` : `interface:${value.expectation.interfaceRevisionId}`)}>`;
|
||||
case "change":
|
||||
throw new Error("CRDT change values require the prepared-change codec and runtime (LF-19)");
|
||||
case "optional":
|
||||
return `(${type(value.value)} | null)`;
|
||||
case "list":
|
||||
|
||||
@@ -30,6 +30,8 @@ export function generateReactBindings(
|
||||
uint32: "number",
|
||||
double: "number",
|
||||
}[value.name];
|
||||
case "change":
|
||||
throw new Error("CRDT change values require the prepared-change codec and runtime (LF-19)");
|
||||
case "optional":
|
||||
return `(${type(value.value)} | null)`;
|
||||
case "list":
|
||||
|
||||
Reference in New Issue
Block a user