diff --git a/packages/gitmojis/package.json b/packages/gitmojis/package.json index ba5afa1..0f0f896 100644 --- a/packages/gitmojis/package.json +++ b/packages/gitmojis/package.json @@ -6,6 +6,7 @@ "files": [ "src/gitmojis.json" ], + "types": "src/gitmojis.d.ts", "scripts": { "lint": "jsonlint ./src/gitmojis.json -V ./src/schema.json", "publishPackage": "npm publish" diff --git a/packages/gitmojis/src/gitmojis.d.ts b/packages/gitmojis/src/gitmojis.d.ts new file mode 100644 index 0000000..f3b7b58 --- /dev/null +++ b/packages/gitmojis/src/gitmojis.d.ts @@ -0,0 +1,34 @@ +declare module 'gitmojis' { + type Gitmoji = { + /** + * Gitmoji unicode character + * @example '🎨', '⚡️', '🔥', '🐛' + */ + readonly emoji: string; + /** + * Gitmoji hexadecimal entity. + * @example '🎨', '⚡', '🔥', '🐛' + */ + readonly entity: `&#${string};`; + /** + * Gitmoji use-case description. + */ + readonly description: string; + /** + * Gitmoji name. + * @example 'art', 'zap', 'fire', 'bug' + */ + readonly name: string; + /** + * Gitmoji semver range. Can be `null` if not specified. + */ + readonly semver: 'patch' | 'minor' | 'major' | null; + /** + * Gitmoji character formatted as a shortcode. + * @example ':art:', ':zap:', ':fire:', ':bug:' + */ + readonly code: `:${string}:`; + } + + export const gitmojis: readonly Gitmoji[]; +}