mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Added type definitions for cnpj (#42101)
* Added type definitions for cnpj * removendo patch versioN * corrigindo github url
This commit is contained in:
parent
d05a9de5c6
commit
d9a1b4bc72
5
types/cnpj/cnpj-tests.ts
Normal file
5
types/cnpj/cnpj-tests.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import * as cnpj from 'cnpj';
|
||||
|
||||
const valid: boolean = cnpj.validate('38.981.218/0001-47');
|
||||
const formatted: string = cnpj.format(88415345000157);
|
||||
const generated: string = cnpj.generate();
|
||||
24
types/cnpj/index.d.ts
vendored
Normal file
24
types/cnpj/index.d.ts
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
// Type definitions for cnpj 3.0
|
||||
// Project: https://github.com/gabrielizaias/cnpj
|
||||
// Definitions by: Miguel A. Almeida <https://github.com/migueldevmt>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* Verifica validade do cnpj
|
||||
* @param cnpj o CNPJ a ser validado.
|
||||
* @returns Verdadeiro ou falso indicando a validade.
|
||||
*/
|
||||
export function validate(cnpj: string): boolean;
|
||||
|
||||
/**
|
||||
* Formata o cnpj com pontos e barra
|
||||
* @param cnpj o CNPJ a ser formatado.
|
||||
* @returns A string formatado.
|
||||
*/
|
||||
export function format(cnpj: number): string;
|
||||
|
||||
/**
|
||||
* Gera um cnpj aleatorio e valido
|
||||
* @returns CNPJ gerado
|
||||
*/
|
||||
export function generate(): string;
|
||||
23
types/cnpj/tsconfig.json
Normal file
23
types/cnpj/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"cnpj-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/cnpj/tslint.json
Normal file
1
types/cnpj/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user