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> = {|
|
2019-10-04 23:37:28 +02:00
|
|
|
get_current_time: () => number, // as ms since epoch
|
2020-12-29 23:40:25 +01:00
|
|
|
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>(
|
|
|
|
worker: Worker<UserId>,
|
|
|
|
new_recipient: RecipientUserIds<UserId> | null
|
2019-10-21 23:03:19 +02:00
|
|
|
): void;
|