package definition

import "github.com/yuin/goldmark-emoji/definition"

Index

Types

type Emoji

type Emoji struct {
	// Name is a name of this emoji.
	Name string

	// ShortNames is a shorter representation of this emoji.
	ShortNames []string

	// Unicode is an unicode representation of this emoji.
	Unicode []rune
}

Emoji is a data structure that holds a single emoji.

func NewEmoji

func NewEmoji(name string, unicode []rune, shortNames ...string) Emoji

NewEmoji returns a new Emoji.

func (*Emoji) IsUnicode

func (em *Emoji) IsUnicode() bool

IsUnicode returns true if this emoji is defined in unicode, otherwise false.

type Emojis

type Emojis interface {
	// Get returns (*Emoji, true) if found mapping associated with given short name, otherwise (nil, false).
	Get(shortName string) (*Emoji, bool)

	// Add adds new emojis to this collection.
	Add(Emojis)

	// Clone clones this collection.
	Clone() Emojis
}

Emojis is a collection of emojis.

func Github

func Github(opts ...EmojisOption) Emojis

func NewEmojis

func NewEmojis(es ...Emoji) Emojis

NewEmojis returns a new Emojis.

type EmojisOption

type EmojisOption func(Emojis)

EmojisOption sets options for Emojis.

func WithEmojis

func WithEmojis(emojis ...Emoji) EmojisOption

WithEmojis is an EmojisOption that adds emojis to the Emojis.

Source Files

definition.go github.go

Version
v1.0.0
Published
Aug 22, 2020
Platform
windows/amd64
Imports
1 packages
Last checked
4 hours ago

Tools for package owners.