Commit ada2f6a4 authored by Lyza Danger Gardner's avatar Lyza Danger Gardner Committed by Lyza Gardner

Define RPC payload typing in `cross-origin-rpc`

Move the typing for the parameter passed to the `changeFocusModeUser`
RPC call into `cross-origin-rpc` and expand in preparation for
supporting group filtering.
parent 971d844a
import warnOnce from '../shared/warn-once';
import { normalizeGroupIds } from './helpers/groups';
/**
* @typedef FocusUserInfo
* @prop {string} [userid]
* @prop {string} [username]
* @prop {string} [displayName] - User's display name
* @prop {string[]} [groups] - A list of group IDs that correspond to the
* focused user's list of groups. This is assumed to represent a subset
* of the `groups` currently loaded in the store. Each entry in this array
* may be either an `id` (a.k.a. `pubid`) OR a `groupid`. These should be
* normalized to `id`s (`pubid`s) before use with the store.
*/
// Array to keep track of pre-start requests
let preStartQueue = [];
......
......@@ -22,16 +22,14 @@ import { createStoreModule } from '../create-store';
*/
/**
* Structure of focus-mode config, provided in settings (app config)
* @typedef FocusConfig
* @prop {FocusUserConfig} user
*
* @typedef { import('../../cross-origin-rpc').FocusUserInfo } FocusUserInfo
*/
/**
* @typedef FocusUserConfig
* @prop {string} [userid]
* @prop {string} [username]
* @prop {string} displayName - User's display name
* Structure of focus-mode config, provided in settings (app config)
* @typedef FocusConfig
* @prop {FocusUserInfo} user
*/
/**
......@@ -153,7 +151,7 @@ const actions = actionTypes(reducers);
/**
* Change the focused user filter and activate focus
*
* @param {FocusUserConfig} user - The user to focus on
* @param {FocusUserInfo} user - The user to focus on
*/
function changeFocusModeUser(user) {
return { type: actions.CHANGE_FOCUS_MODE_USER, user };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment