docs: update docs

This commit is contained in:
Nolan Lawson 2020-06-16 20:21:40 -07:00
parent fa16515fd0
commit 072a274ccb
2 changed files with 19 additions and 7 deletions

View File

@ -546,20 +546,31 @@ Custom emoji should follow the format:
```js
[
{
name: 'foo',
shortcodes: ['foo'],
url: 'http://example.com/foo.png'
name: 'Garfield',
shortcodes: ['garfield'],
url: 'http://example.com/garfield.png',
category: 'Cats'
},
{
name: 'bar',
shortcodes: ['bar'],
url: 'http://example.com/bar.png'
name: 'Heathcliff',
shortcodes: ['heathcliff'],
url: 'http://example.com/heathcliff.png',
category: 'Cats'
},
{
name: 'Scooby-Doo',
shortcodes: ['scooby'],
url: 'http://example.com/scooby.png',
category: 'Dogs'
}
]
```
Note that names are assumed to be unique (case-insensitive), and it's assumed that the `shortcodes` have at least one entry.
The `category` is optional. If you don't provide it, then the custom emoji will appear in a
single category called "Custom".
To pass custom emoji into the `Picker`:
```js
@ -576,7 +587,7 @@ const database = new Database({
})
```
It can also be set at runtime:
Custom emoji can also be set at runtime:
```js
picker.customEmoji = [/* ... */ ]

View File

@ -100,6 +100,7 @@ export interface CustomEmoji {
name: string
shortcodes: string[]
url: string
category?: string
}
export type Emoji = NativeEmoji | CustomEmoji