-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
65 lines (61 loc) · 3.03 KB
/
index.d.ts
File metadata and controls
65 lines (61 loc) · 3.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/**
* `Emoji Mix URL Generator` TypeScript Definitions
* Version 1.2.2
*
* Created by MattFor (Discord: MattFor#9884 (currently: mattfor)) on May 30, 2023.
* Contact: mattfor@relaxy.xyz
*
* Licensed under the MIT Licence.
*
* This TypeScript module declaration for the 'emoji-mixer' JavaScript module provides
* strong type checking for its functions and exported variables.
*
* Types:
*
* `emojiCompatibilityData` - Represents a combination of emojis. It has properties for leftEmoji,
* rightEmoji, and the date when the combination was added.
*
* `emojiCompatibilityDataMap` - A map where each key is a string of emoji Unicode points and each value
* is an array of `emojiCompatibilityData`.
*
* Exported variables:
*
* `emojiCompatibilityData` - A map of Unicode code points to arrays of emoji combinations.
*
* `supportedEmojis` - An array of strings, each representing an emoji supported by the application.
*
* `baseUrl` - The base URL for fetching emoji images from Google's Android Emoji Kitchen.
*
* Exported functions:
*
* `googleRequestUrlEmojiPart(emoji: string): string` - Transforms an emoji Unicode representation for inclusion in a URL.
*
* `toUnicode(input: string, oldToNew?: boolean | false): string | undefined | Error` - Validates and transforms an input into a Unicode representation.
*
* `checkSupported(emoji: string, oldToNew?: boolean | false): emojiCompatibilityData[] | null` - Checks if an emoji is supported by looking it up in the `emojiCompatibilityData` object.
*
* `googleRequestUrl(emojiMixData: emojiCompatibilityData): string` - Generates a URL for fetching an emoji combination image from Google's Android Emoji Kitchen.
*
* `getEmojiCombo(leftEmoji: string, rightEmoji: string): emojiCompatibilityData | undefined` - Finds a matching emoji combination from the `emojiCompatibilityData` object.
*
* `getEmojiMixUrl(leftEmoji: string, rightEmoji: string, detailedErrors?: boolean, oldToNew?: boolean | false): string | null | undefined` - Generates a URL for an emoji mix image.
*/
declare module "emoji-mixer" {
type emojiCompatibilityData = {
leftEmoji: string;
rightEmoji: string;
date: string;
};
type emojiCompatibilityDataMap = {
[key: string]: emojiCompatibilityData;
};
export const baseUrl: string;
export const supportedEmojis: string[];
export const emojiCompatibilityData: emojiCompatibilityDataMap;
export function googleRequestUrlEmojiPart(emoji: string): string;
export function googleRequestUrl(emojiMixData: emojiCompatibilityData): string;
export function toUnicode(input: string, oldToNew?: boolean | false): string | undefined | Error;
export function getEmojiCombo(leftEmoji: string, rightEmoji: string): emojiCompatibilityData | undefined;
export function checkSupported(emoji: string, oldToNew?: boolean | false): emojiCompatibilityData[] | null;
export default function getEmojiMixUrl(leftEmoji: string, rightEmoji: string, detailedErrors?: boolean, oldToNew?: boolean | false): string | undefined | null;
}