feat.airapp sdk

This commit is contained in:
lincube
2026-06-08 02:39:44 +08:00
parent 1a6f129e78
commit 7db72fbcd0
36 changed files with 2617 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
namespace LanMountainDesktop.AirAppSdk;
/// <summary>
/// Message bus for inter-AirApp communication.
/// </summary>
public interface IAirAppMessageBus
{
/// <summary>
/// Publish a message to a topic.
/// </summary>
/// <param name="topic">Message topic</param>
/// <param name="payload">Message payload</param>
void Publish(string topic, object? payload = null);
/// <summary>
/// Subscribe to a topic.
/// </summary>
/// <param name="topic">Message topic</param>
/// <param name="handler">Message handler</param>
/// <returns>Subscription token</returns>
IDisposable Subscribe(string topic, Action<object?> handler);
/// <summary>
/// Subscribe to a topic with typed payload.
/// </summary>
/// <typeparam name="T">Payload type</typeparam>
/// <param name="topic">Message topic</param>
/// <param name="handler">Typed message handler</param>
/// <returns>Subscription token</returns>
IDisposable Subscribe<T>(string topic, Action<T?> handler);
}