2026-04-22 10:25:46 +08:00
|
|
|
using System.Text.Json;
|
|
|
|
|
|
2026-08-11 23:03:55 +08:00
|
|
|
namespace LanMountainDesktop.AirAppIsolation.Contracts;
|
2026-04-22 10:25:46 +08:00
|
|
|
|
2026-08-11 23:03:55 +08:00
|
|
|
public sealed record AirAppUiSurfaceDescriptor(
|
2026-04-22 10:25:46 +08:00
|
|
|
string SurfaceId,
|
|
|
|
|
string SurfaceKind,
|
|
|
|
|
string Title,
|
|
|
|
|
string? ComponentId = null);
|
|
|
|
|
|
2026-08-11 23:03:55 +08:00
|
|
|
public static class AirAppUiSurfaceKinds
|
2026-04-22 10:25:46 +08:00
|
|
|
{
|
|
|
|
|
public const string DesktopComponent = "desktop-component";
|
|
|
|
|
public const string ComponentEditor = "component-editor";
|
|
|
|
|
public const string SettingsPage = "settings-page";
|
|
|
|
|
public const string Window = "window";
|
|
|
|
|
}
|
|
|
|
|
|
2026-08-11 23:03:55 +08:00
|
|
|
public sealed record AirAppUiAttachRequest(
|
2026-04-22 10:25:46 +08:00
|
|
|
string SurfaceId,
|
|
|
|
|
string SurfaceKind,
|
|
|
|
|
string? InstanceId = null,
|
|
|
|
|
JsonElement? InitialState = null);
|
|
|
|
|
|
2026-08-11 23:03:55 +08:00
|
|
|
public sealed record AirAppUiAttachResponse(
|
2026-04-22 10:25:46 +08:00
|
|
|
bool Accepted,
|
|
|
|
|
JsonElement? InitialState = null,
|
|
|
|
|
string? ErrorCode = null,
|
|
|
|
|
string? ErrorMessage = null);
|
|
|
|
|
|
2026-08-11 23:03:55 +08:00
|
|
|
public sealed record AirAppUiDetachNotification(
|
2026-04-22 10:25:46 +08:00
|
|
|
string SurfaceId,
|
|
|
|
|
string SurfaceKind,
|
|
|
|
|
string? InstanceId = null);
|
|
|
|
|
|
2026-08-11 23:03:55 +08:00
|
|
|
public sealed record AirAppUiCommandRequest(
|
2026-04-22 10:25:46 +08:00
|
|
|
string SurfaceId,
|
|
|
|
|
string CommandName,
|
|
|
|
|
string? InstanceId = null,
|
|
|
|
|
JsonElement? Payload = null);
|
|
|
|
|
|
2026-08-11 23:03:55 +08:00
|
|
|
public sealed record AirAppUiCommandResponse(
|
2026-04-22 10:25:46 +08:00
|
|
|
bool Accepted,
|
|
|
|
|
JsonElement? Payload = null,
|
|
|
|
|
string? ErrorCode = null,
|
|
|
|
|
string? ErrorMessage = null);
|
|
|
|
|
|
2026-08-11 23:03:55 +08:00
|
|
|
public sealed record AirAppUiStateChangedNotification(
|
2026-04-22 10:25:46 +08:00
|
|
|
string SurfaceId,
|
|
|
|
|
string SurfaceKind,
|
|
|
|
|
string? InstanceId = null,
|
|
|
|
|
JsonElement? State = null);
|