feat(sdk,plugins): API publique d'accès fichiers/workspace + analyse structure (#124,#129)
This commit is contained in:
27
frontend/src/adapters/pluginEvents.ts
Normal file
27
frontend/src/adapters/pluginEvents.ts
Normal file
@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Tauri adapter for stable public plugin events (#127).
|
||||
*/
|
||||
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
|
||||
import type { PluginEventBatch, PluginEventSubscription } from "@/domain";
|
||||
import type {
|
||||
PluginEventGateway,
|
||||
PluginEventPollInput,
|
||||
PluginEventSubscribeInput,
|
||||
PluginEventUnsubscribeInput,
|
||||
} from "@/ports";
|
||||
|
||||
export class TauriPluginEventGateway implements PluginEventGateway {
|
||||
subscribe(input: PluginEventSubscribeInput): Promise<PluginEventSubscription> {
|
||||
return invoke<PluginEventSubscription>("plugin_events_subscribe", { input });
|
||||
}
|
||||
|
||||
poll(input: PluginEventPollInput): Promise<PluginEventBatch> {
|
||||
return invoke<PluginEventBatch>("plugin_events_poll", { input });
|
||||
}
|
||||
|
||||
unsubscribe(input: PluginEventUnsubscribeInput): Promise<PluginEventSubscription> {
|
||||
return invoke<PluginEventSubscription>("plugin_events_unsubscribe", { input });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user