AppleIntents.Router (apple_intents v0.1.0)

Copy Markdown View Source

Intent-to-handler registry and dispatch.

Summary

Types

handler()

@type handler() :: module()

Functions

dispatch(intent_id, params, context, router, opts \\ [])

@spec dispatch(String.t(), map(), AppleIntents.Context.t(), term(), keyword()) ::
  {:ok, map()} | {:error, AppleIntents.Error.t() | term()}

lookup(router, intent_id)

@spec lookup(term(), String.t()) ::
  {:ok, handler()} | {:error, AppleIntents.Error.t()}

new(handlers)

@spec new([handler()]) :: %{required(String.t()) => handler()}