using AngleSharp.Dom;
namespace XFESystem.Browser;
/// Page-owned services. These delegates are never projected as CLR objects to JavaScript.
public sealed class BrowserDomHost
{
public Action? Mutated { get; init; }
public Action? AttributeChanged { get; init; }
public Action? ResourceRequested { get; init; }
public Func? Measure { get; init; }
public Func>? MeasureRange { get; init; }
public Func? HitTest { get; init; }
public Func? ComputedStyle { get; init; }
public Func? Viewport { get; init; }
public Action? FocusChanged { get; init; }
public Func? MeasureText { get; init; }
public Func? RasterizeText { get; init; }
public Action? CanvasChanged { get; init; }
public Func? ImageInfo { get; init; }
public Func? ReadCookies { get; init; }
public Action? WriteCookie { get; init; }
public Func? GetResource { get; init; }
public Func, WebResponse>? GetResourceWithHeaders { get; init; }
public Action? Navigate { get; init; }
public Func? SubmitForm { get; init; }
public BrowserRandomFill? FillRandom { get; init; }
}
public sealed record BrowserDomEventInit
{
public bool Bubbles { get; init; } = true;
public bool Cancelable { get; init; } = true;
public double ClientX { get; init; }
public double ClientY { get; init; }
public double DeltaX { get; init; }
public double DeltaY { get; init; }
public int Button { get; init; }
public int Buttons { get; init; }
public string Key { get; init; } = string.Empty;
public string Code { get; init; } = string.Empty;
public bool CtrlKey { get; init; }
public bool ShiftKey { get; init; }
public bool AltKey { get; init; }
public bool MetaKey { get; init; }
public string Data { get; init; } = string.Empty;
public string InputType { get; init; } = string.Empty;
}