using AngleSharp.Dom;
namespace XFESystem.Browser;
/// <summary>Page-owned services. These delegates are never projected as CLR objects to JavaScript.</summary>
public sealed class BrowserDomHost
{
public Action? Mutated { get; init; }
public Action<IElement>? ResourceRequested { get; init; }
public Func<INode, BrowserRect>? Measure { get; init; }
public Func<INode, int, INode, int, IReadOnlyList<BrowserRect>>? MeasureRange { get; init; }
public Func<double, double, INode?>? HitTest { get; init; }
public Func<INode, string, string?>? ComputedStyle { get; init; }
public Func<BrowserViewport>? Viewport { get; init; }
public Action<INode?>? FocusChanged { get; init; }
public Func<string, BrowserFont, double>? MeasureText { get; init; }
public Func<string, BrowserFont, (int Width, int Height, byte[] Alpha)>? RasterizeText { get; init; }
public Action<IElement, BrowserCanvasSurface>? CanvasChanged { 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;
}
using AngleSharp.Dom;
namespace XFESystem.Browser;
/// <summary>Page-owned services. These delegates are never projected as CLR objects to JavaScript.</summary>
public sealed class BrowserDomHost
{
public Action? Mutated { get; init; }
public Action<IElement>? ResourceRequested { get; init; }
public Func<INode, BrowserRect>? Measure { get; init; }
public Func<INode, int, INode, int, IReadOnlyList<BrowserRect>>? MeasureRange { get; init; }
public Func<double, double, INode?>? HitTest { get; init; }
public Func<INode, string, string?>? ComputedStyle { get; init; }
public Func<BrowserViewport>? Viewport { get; init; }
public Action<INode?>? FocusChanged { get; init; }
public Func<string, BrowserFont, double>? MeasureText { get; init; }
public Func<string, BrowserFont, (int Width, int Height, byte[] Alpha)>? RasterizeText { get; init; }
public Action<IElement, BrowserCanvasSurface>? CanvasChanged { 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;
}