Documentation
¶
Overview ¶
Package clipboard provides a native clipboard for local Kite applications that need MIME formats beyond plain text. Install the provider through engine.Options{Clipboard: clipboard.New()}. Available formats depend on the host operating system and its clipboard utilities.
Index ¶
- Variables
- type SystemClipboard
- func (c *SystemClipboard) ListFormats() *promise.Promise[[]string]
- func (c *SystemClipboard) Read(mime string) *promise.Promise[[]byte]
- func (c *SystemClipboard) ReadText() *promise.Promise[string]
- func (c *SystemClipboard) Write(mime string, data []byte) *promise.Promise[struct{}]
- func (c *SystemClipboard) WriteText(text string) *promise.Promise[struct{}]
Constants ¶
This section is empty.
Variables ¶
var ErrUnsupported = errors.New("clipboard: unsupported platform or format")
ErrUnsupported is returned when the current platform or clipboard tool does not support the requested operation or MIME type.
Functions ¶
This section is empty.
Types ¶
type SystemClipboard ¶
type SystemClipboard struct {
// contains filtered or unexported fields
}
SystemClipboard implements terminal.Clipboard using the host OS clipboard, supporting multiple MIME types (e.g. "text/plain", "text/html", "image/png", "text/uri-list").
func New ¶
func New() *SystemClipboard
New creates a new SystemClipboard backed by the current operating system's native clipboard utilities.
func (*SystemClipboard) ListFormats ¶
func (c *SystemClipboard) ListFormats() *promise.Promise[[]string]
ListFormats returns the deduplicated list of MIME types currently available on the OS clipboard.
func (*SystemClipboard) Read ¶
func (c *SystemClipboard) Read(mime string) *promise.Promise[[]byte]
Read retrieves the payload for the given MIME type from the OS clipboard.
func (*SystemClipboard) ReadText ¶
func (c *SystemClipboard) ReadText() *promise.Promise[string]
ReadText returns the current "text/plain" content from the OS clipboard.