1// Copyright (C) 2023 The Android Open Source Project 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15import {produce} from 'immer'; 16import m from 'mithril'; 17import {raf} from '../core/raf_scheduler'; 18import {globals} from './globals'; 19import {App} from '../public/app'; 20import {AppImpl} from '../core/app_impl'; 21 22declare global { 23 interface Window { 24 m: typeof m; 25 app: App; 26 globals: typeof globals; 27 produce: typeof produce; 28 raf: typeof raf; 29 } 30} 31 32export function registerDebugGlobals() { 33 window.m = m; 34 window.app = AppImpl.instance; 35 window.globals = globals; 36 window.produce = produce; 37 window.raf = raf; 38} 39