| 1 | /** |
| 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. |
| 3 | * |
| 4 | * This source code is licensed under the MIT license found in the |
| 5 | * LICENSE file in the root directory of this source tree. |
| 6 | */ |
| 7 | |
| 8 | import type {Tracker} from 'isl-server/src/analytics/tracker'; |
| 9 | |
| 10 | declare global { |
| 11 | interface Window { |
| 12 | globalIslClientTracker: Tracker<Record<string, never>>; |
| 13 | } |
| 14 | } |
| 15 | /** |
| 16 | * Globally access analytics tracker, to prevent cyclical imports. |
| 17 | * Should technically only be nullable if used at the top level. |
| 18 | */ |
| 19 | export function getTracker(): Tracker<Record<string, never>> | undefined { |
| 20 | return window.globalIslClientTracker; |
| 21 | } |
| 22 | |