Files

35 lines
3.7 KiB
Plaintext
Raw Permalink Normal View History

symbol JavaScript id "target:org.quixos.execution.javascript@1";
import interface PresentationStates;
import interface ReaderNavigation;
external atom ReaderNavigationRecord id "reader-navigation-record";
import interface PresentationState;
import interface PresentationMount;
import interface StateFactory;
external atom PresentationMountRecord id "presentation-mount-record";
package PresentationRuntime id "presentation-runtime" revision "presentation-runtime@1" {
function createReaderState id "presentation-runtime:create-reader-state" : record {occurrence:string;parent:optional<interface-ref<PresentationState>>;} -> interface-ref<ReaderNavigation> execution transaction targets [JavaScript,server] requires {
creation navigation id "navigation" : ReaderNavigationRecord input record {occurrence:string;parent:optional<interface-ref<PresentationState>>;};
};
function createPresentationMount id "presentation-runtime:create" : unit -> interface-ref<PresentationMount> execution transaction targets [JavaScript,server] requires {
creation presentationMount id "presentationMount" : PresentationMountRecord input unit;
};
operation attach id "presentation-runtime:attach" : interface-ref<PresentationState> -> unit mode call execution transaction targets [JavaScript,server] receiver any requires {
edge members id "members" : many-unique interface PresentationState [resolve,connect];
edge root id "root" : optional-one interface PresentationState [resolve,connect];
interface metadata id "state" : PresentationState using [presentationMount.resolve,parent.resolve] from input;
};
operation ensure<object Navigation implements PresentationState> id "presentation-runtime:ensure" : record {presentationMount:interface-ref<PresentationMount>;occurrence:string;parent:optional<interface-ref<PresentationState>>;} -> ref<Navigation> mode call execution transaction targets [JavaScript,server] receiver any requires {
edge states id "states" : many-unique object Navigation keyed "string" [resolve,connect];
interface metadata id "state" : PresentationState using [occurrence.get,presentationMount.resolve,parent.resolve] from input;
interface presentationMount id "presentationMount" : PresentationMount using [attach.call] from input;
interface factory id "factory" : StateFactory<Navigation> using [create.call];
};
function createState<object Navigation> id "presentation-runtime:create-state" : record {occurrence:string;parent:optional<interface-ref<PresentationState>>;} -> ref<Navigation> execution transaction targets [JavaScript,server] requires {
creation navigation id "navigation" : Navigation input record {occurrence:string;parent:optional<interface-ref<PresentationState>>;};
};
query ReaderStateInputs id "reader-state:inputs" root PresentationStates<atom ReaderNavigationRecord> document "queries/reader-inputs.graphql" operation "ReaderState" { replica; view ReaderNavigationRecord as ReaderNavigation; max rows 100; }
query ReaderStateView id "reader-state:view" root PresentationStates<atom ReaderNavigationRecord> document "queries/reader-state.graphql" operation "ReaderState" { local from ReaderStateInputs; watch; view ReaderNavigationRecord as ReaderNavigation; max rows 100; }
query ReaderWindowInputs id "reader-state:window-inputs" root PresentationStates<atom ReaderNavigationRecord> document "queries/reader-window.graphql" operation "ReaderState" { replica; view ReaderNavigationRecord as ReaderNavigation; max rows 100; }
query ReaderWindowView id "reader-state:window-view" root PresentationStates<atom ReaderNavigationRecord> document "queries/reader-window.graphql" operation "ReaderState" { local from ReaderWindowInputs; watch; view ReaderNavigationRecord as ReaderNavigation; max rows 100; }
}