Files

27 lines
2.4 KiB
Plaintext

import interface PresentationMount;
import interface WebStudioDisplayTarget;
import interface WebStudioDisplayDirectory;
import interface WebStudioPresentable;
external atom DisplayTarget id "atom:org.quixos.web-studio:display-target";
type Assignment = record {subject:interface-ref<WebStudioPresentable>;presentation:string;presentationMount:optional<interface-ref<PresentationMount>>;};
type Observed = record {generation:uint32;sequence:uint32;status:string;error:string;};
type DisplayState = record {label:string;generation:uint32;presentation:optional<string>;observed:optional<Observed>;};
package WebStudioDisplayRuntime id "package:org.quixos.web-studio:display-runtime" revision "package:org.quixos.web-studio:display-runtime@1" {
operation enroll id "displays:enroll" : record {nonce:string;label:string;} -> interface-ref<WebStudioDisplayTarget> mode call execution transaction targets [server] receiver any requires {
edge enrolled id "enrolled" : many-unique interface WebStudioDisplayTarget [resolve,connect];
interface existing id "existing" : WebStudioDisplayTarget using [nonce.get] from input;
creation target id "target" : DisplayTarget input record {nonce:string;initial:DisplayState;};
};
operation assign id "displays:assign" : optional<Assignment> -> uint32 mode call execution transaction targets [server] receiver any requires {
state data id "data" : DisplayState [read,write];
edge mount id "mount" : optional-one interface PresentationMount [resolve,connect,disconnect];
edge selected id "selected" : optional-one interface WebStudioPresentable [resolve,connect,disconnect];
interface subject id "subject" : WebStudioPresentable using [canPresent.call] from input;
};
operation acknowledge id "displays:acknowledge" : Observed -> bool mode call execution transaction targets [server] receiver any requires {state data id "data" : DisplayState [read,write];};
query Inputs id "displays:inputs" root WebStudioDisplayTarget document "queries/inputs.graphql" operation "Inputs" {replica;}
query View id "displays:view" root WebStudioDisplayTarget document "queries/view.graphql" operation "View" {local from Inputs;watch;}
query ListInputs id "displays:list-inputs" root workspace WebStudioDisplayTarget document "queries/list-inputs.graphql" operation "ListInputs" {replica;}
query List id "displays:list" root workspace WebStudioDisplayTarget document "queries/list.graphql" operation "List" {local from ListInputs;watch;}
}