/** * @license * Copyright 2016 Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * `BlockingElements` manages a stack of elements that inert the interaction * outside them. The top element is the interactive part of the document. * The stack can be updated with the methods `push, remove, pop`. */ export interface BlockingElements { /** * Call this whenever this object is about to become obsolete. This empties * the blocking elements */ destructor(): void; /** * The top blocking element. */ top: HTMLElement | null; /** * Adds the element to the blocking elements. */ push(element: HTMLElement): void; /** * Removes the element from the blocking elements. Returns true if the * element was removed. */ remove(element: HTMLElement): boolean; /** * Remove the top blocking element and returns it. */ pop(): HTMLElement | null; /** * Returns if the element is a blocking element. */ has(element: HTMLElement): boolean; } export interface DocumentWithBlockingElements extends Document { $blockingElements: BlockingElements; }