blob: 554fa2350ef737a2f38a0beea112ce69aa1db375 [file] [log] [blame]
* @license
* Copyright 2020 Google LLC
* SPDX-License-Identifier: Apache-2.0
import {ParsedJSON} from './common';
import {HighlightJS} from './types';
export {};
declare global {
interface Window {
INITIAL_DATA?: {[key: string]: ParsedJSON};
HTMLImports?: {whenReady: (cb: () => void) => void};
text: string,
options: {callback: (text: string, href?: string) => void}
): void;
ASSETS_PATH?: string;
// TODO(TS): remove page when better workaround is found
// page shouldn't be exposed in window and it shouldn't be used
// it's defined because of limitations from typescript, which don't import .mjs
page?: unknown;
hljs?: HighlightJS;
diffPage?: string;
changePage?: string;
dashboardPage?: string;
dashboardQuery?: string[];
/** Enhancements on Gr elements or utils */
// TODO(TS): should clean up those and removing them may break certain plugin behaviors
// TODO(TS): as @brohlfs suggested, to avoid importing anything from elements/ to types/
// use any for them for now
GrAnnotation: unknown;
// Heads up! There is a known plugin dependency on GrPluginActionContext.
GrPluginActionContext: unknown;
interface Performance {
// typescript doesn't know about the memory property.
// Define it here, so it can be used everywhere
memory?: {
jsHeapSizeLimit: number;
totalJSHeapSize: number;
usedJSHeapSize: number;
interface Error {
lineNumber?: number; // non-standard property
columnNumber?: number; // non-standard property
interface ShadowRoot {
getSelection?: () => Selection | null;