Open
Description
Currently, we only support UTF-8 text and PNG-encoded image data. However, there are much more formats than that.
Let's support registering custom format and handlers so that this package can help any other unregistered format. API design could be:
package clipboard
type Format int
// Add this.
func Register[T any](format clipboard.Format, read func([]byte) (T, error), write func() []byte) error { ... }
func Read(format clipboard.Format) []byte
func Write(format clipboard.Format, data []byte)
func Watch(format clipboard.Format) <-chan struct{}