-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Research app selection messaging #133
Changes from 2 commits
a25e9b0
f459177
7f9c486
d2b61eb
dab89ab
91c865b
1f20df4
fb28bf0
6b01f92
c8dd594
d27e990
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -180,3 +180,52 @@ export function isPingPongMessage(o: any): o is PingPongMessage { // eslint-dis | |
typeof o.threadId === "string" && | ||
(o.sessionId === undefined || typeof o.sessionId === "string"); | ||
} | ||
|
||
/** Information about the current state of source and catalog selection | ||
* inside the WWT application | ||
* | ||
* This message is broadcasted by the application whenever one of the user's selection | ||
* options inside of the application is adjusted. The Vue listeners for the selected | ||
* catalogs and sources are deep listeners, meaning that this message will be broadcasted | ||
* whenever a property of one of their items changes. | ||
* | ||
* Not all fields of this message will always be present, depending on the | ||
* nature of the event triggering the emission of this message. A message | ||
* missing a particular field should be treated as conveying no information | ||
* about the state described by that field. | ||
*/ | ||
|
||
export interface SelectionStateMessage { | ||
|
||
/** The tag identifying this message type. */ | ||
type: "wwt_selection_state"; | ||
|
||
/** An app/client session identifier. | ||
* | ||
* If a single client is communicating with multiple apps, it needs to be able | ||
* to tell which app is the source of any update messages. This session | ||
* identifier allows clients to do so. The default value is "default". But if | ||
* a client sends a [[PingPongMessage]] with a customized ``sessionId`` field, | ||
* that value will start appearing in these view state update messages. | ||
*/ | ||
sessionId: string; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The whitespace here has gotten wonky somehow. |
||
|
||
/** The most recent source that was added to the selection list. */ | ||
mostRecentSource?: string; | ||
|
||
/** The list of HiPS catalogs that are currently selected. */ | ||
selectedCatalogs?: string[]; | ||
|
||
/** The list of sources that are currently selected. */ | ||
selectedSources?: string[]; | ||
} | ||
|
||
/** Type guard function for [[SelectionStateMessage]] */ | ||
export function isSelectionStateMessage(o: any): o is SelectionStateMessage { // eslint-disable-line @typescript-eslint/no-explicit-any | ||
return typeof o.type === "string" && | ||
o.type == "wwt_selection_state" && | ||
typeof o.threadId === "string" && | ||
(o.sessionId === undefined || typeof o.sessionId === "string") && | ||
(o.mostRecentSource === undefined || typeof o.mostRecentSource === "string") && | ||
(o.selectedSources === undefined || typeof o.selectedSources === "string"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are some problems here — there's no There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, various issues aside, you're right - we don't need this. |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Er, I think this docstring needs to be relocated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep - this got left behind when I was moving things into
selections.ts
.