Skip to content

Commit

Permalink
🏷️ Add TypeScript type declarations to gitmojis package (#1247)
Browse files Browse the repository at this point in the history
* 🏷️ Add `gitmojis.d.ts` TypeScript module declaration
* πŸ”§ Add `types` field to `package.json`
  • Loading branch information
carloscuesta authored Jan 2, 2023
1 parent ed487e0 commit 615ced3
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
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[];
}

1 comment on commit 615ced3

@vercel
Copy link

@vercel vercel bot commented on 615ced3 Jan 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

gitmoji – ./

gitmoji-carloscuesta.vercel.app
gitmoji-git-master-carloscuesta.vercel.app
gitmoji.dev

Please sign in to comment.