2019-10-04 23:37:28 +02:00
|
|
|
/**
|
|
|
|
* @flow strict
|
|
|
|
*/
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
2020-12-29 23:40:25 +01:00
|
|
|
type RecipientUserIds<UserId: number> = $ReadOnlyArray<UserId>;
|
2019-10-04 23:37:28 +02:00
|
|
|
|
2020-12-29 23:40:25 +01:00
|
|
|
type Worker<UserId> = {|
|
2021-02-14 05:01:20 +01:00
|
|
|
get_current_time: () => number, // as ms since epoch
|
|
|
|
notify_server_start: (RecipientUserIds<UserId>) => void,
|
|
|
|
notify_server_stop: (RecipientUserIds<UserId>) => void,
|
2019-10-04 23:37:28 +02:00
|
|
|
|};
|
|
|
|
|
2020-12-29 23:40:25 +01:00
|
|
|
declare export function update<UserId>(
|
2021-02-14 05:01:20 +01:00
|
|
|
worker: Worker<UserId>,
|
|
|
|
new_recipient: RecipientUserIds<UserId> | null,
|
2019-10-21 23:03:19 +02:00
|
|
|
): void;
|