Raxol.Core.Plugins.Core.ClipboardPluginBehaviour behaviour (Raxol v2.0.1)

View Source

Defines the behaviour for clipboard plugin operations.

Summary

Callbacks

Returns the list of commands supported by the clipboard plugin. Each command is a tuple of {command_name, handler_function, arity}.

Handles a clipboard command with the given arguments and state.

Initializes the clipboard plugin with the given options.

Callbacks

get_commands()

@callback get_commands() :: [{atom(), atom(), non_neg_integer()}]

Returns the list of commands supported by the clipboard plugin. Each command is a tuple of {command_name, handler_function, arity}.

handle_command(command, args, state)

@callback handle_command(command :: atom(), args :: list(), state :: map()) ::
  {:ok, String.t()} | {:error, String.t()}

Handles a clipboard command with the given arguments and state.

init(opts)

@callback init(opts :: Keyword.t()) :: {:ok, map()} | {:error, term()}

Initializes the clipboard plugin with the given options.