|
| 1 | +/* |
| 2 | + * MIT License |
| 3 | + * |
| 4 | + * Copyright (c) Microsoft Corporation. |
| 5 | + * |
| 6 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | + * of this software and associated documentation files (the "Software"), to deal |
| 8 | + * in the Software without restriction, including without limitation the rights |
| 9 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 10 | + * copies of the Software, and to permit persons to whom the Software is |
| 11 | + * furnished to do so, subject to the following conditions: |
| 12 | + * |
| 13 | + * The above copyright notice and this permission notice shall be included in all |
| 14 | + * copies or substantial portions of the Software. |
| 15 | + * |
| 16 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 22 | + * SOFTWARE. |
| 23 | + */ |
| 24 | + |
| 25 | +using System; |
| 26 | +using System.Threading.Tasks; |
| 27 | + |
| 28 | +namespace Microsoft.Playwright; |
| 29 | + |
| 30 | +/// <summary> |
| 31 | +/// <para> |
| 32 | +/// Interface for managing page overlays that display persistent visual indicators on |
| 33 | +/// top of the page. |
| 34 | +/// </para> |
| 35 | +/// </summary> |
| 36 | +public partial interface IOverlay |
| 37 | +{ |
| 38 | + /// <summary> |
| 39 | + /// <para> |
| 40 | + /// Adds an overlay with the given HTML content. The overlay is displayed on top of |
| 41 | + /// the page until removed. Returns a disposable that removes the overlay when disposed. |
| 42 | + /// </para> |
| 43 | + /// </summary> |
| 44 | + /// <param name="html">HTML content for the overlay.</param> |
| 45 | + /// <param name="options">Call options</param> |
| 46 | + Task<IAsyncDisposable> ShowAsync(string html, OverlayShowOptions? options = default); |
| 47 | + |
| 48 | + /// <summary> |
| 49 | + /// <para> |
| 50 | + /// Shows a chapter overlay with a title and optional description, centered on the page |
| 51 | + /// with a blurred backdrop. Useful for narrating video recordings. The overlay is removed |
| 52 | + /// after the specified duration, or 2000ms. |
| 53 | + /// </para> |
| 54 | + /// </summary> |
| 55 | + /// <param name="title">Title text displayed prominently in the overlay.</param> |
| 56 | + /// <param name="options">Call options</param> |
| 57 | + Task ChapterAsync(string title, OverlayChapterOptions? options = default); |
| 58 | + |
| 59 | + /// <summary><para>Sets visibility of all overlays without removing them.</para></summary> |
| 60 | + /// <param name="visible">Whether overlays should be visible.</param> |
| 61 | + Task SetVisibleAsync(bool visible); |
| 62 | +} |
0 commit comments