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

Adiciona tipagem à exportação default #36

Merged
merged 1 commit into from
Oct 6, 2020
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
21 changes: 21 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
declare module 'extenso' {
/**
* Convert number to a extenze format
* @param number the number to convert in extenze text
* @param options setup writing configuration
*/
export default function (
number: string | number,
options?: {
mode?: 'number' | 'currency'
locale?: 'pt' | 'br'
negative?: 'formal' | 'informal'
currency?: { type?: 'BRL' | 'EUR' | 'ECV' | 'MZN' | string }
number?: {
gender?: 'm' | 'f'
decimal?: 'formal' | 'informal'
decimalSeparator?: 'comma' | 'dot'
}
}
): string
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
"version": "2.0.1",
"description": "Escrever números por extenso.",
"main": "dist/extenso.min.js",
"types": "index.d.ts",
"files": [
"dist"
"dist",
"index.d.ts"
],
"scripts": {
"test": "ava --colors",
Expand Down
Loading