Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🏷️ Add TypeScript type declarations to gitmojis package #1247

Merged
merged 2 commits into from
Jan 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/gitmojis/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
34 changes: 34 additions & 0 deletions packages/gitmojis/src/gitmojis.d.ts
Original file line number Diff line number Diff line change
@@ -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[];
}