2016-11-02 22:18:16 +03:00
|
|
|
/**
|
2021-12-31 02:08:43 +03:00
|
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
2016-11-02 22:18:16 +03:00
|
|
|
*
|
2018-02-17 05:24:55 +03:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2016-11-02 22:18:16 +03:00
|
|
|
*
|
2018-05-11 05:06:46 +03:00
|
|
|
* @format
|
2020-07-22 19:43:45 +03:00
|
|
|
* @flow strict
|
2016-11-02 22:18:16 +03:00
|
|
|
*/
|
2018-05-11 05:06:46 +03:00
|
|
|
|
2016-11-02 22:18:16 +03:00
|
|
|
'use strict';
|
|
|
|
|
2019-05-08 18:44:25 +03:00
|
|
|
import type {EventSender} from './InspectorAgent';
|
2016-11-02 22:18:16 +03:00
|
|
|
|
|
|
|
interface Agent {
|
2018-05-11 05:06:46 +03:00
|
|
|
constructor(eventSender: EventSender): void;
|
2016-11-02 22:18:16 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// Flow doesn't support static declarations in interface
|
2019-11-21 20:38:13 +03:00
|
|
|
type AgentClass = Class<Agent> & {DOMAIN: string, ...};
|
2016-11-02 22:18:16 +03:00
|
|
|
|
|
|
|
declare function __registerInspectorAgent(type: AgentClass): void;
|
|
|
|
declare function __inspectorTimestamp(): number;
|
|
|
|
|
|
|
|
const JSInspector = {
|
|
|
|
registerAgent(type: AgentClass) {
|
|
|
|
if (global.__registerInspectorAgent) {
|
|
|
|
global.__registerInspectorAgent(type);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
getTimestamp(): number {
|
|
|
|
return global.__inspectorTimestamp();
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = JSInspector;
|