Skip to content

Commit

Permalink
fix(typings): fix type for angular 5
Browse files Browse the repository at this point in the history
in issue BrasilAPI#112, we saw the problem with angular 5.

in my tests, i install angular 5 and rollback the definition without workarround
solved for default function microsoft/TypeScript#5073

and this back work, i think this worked because typescript can have a fix in recent version.
  • Loading branch information
claytonsilva committed Mar 8, 2018
1 parent 01c8055 commit 8452f1f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,10 @@ require('/dist/cep-promise-browser.min.js')
}
```

#### Angular 2
#### Angular 2/4/5

``` ts
import * as cep from 'cep-promise'
import cep from 'cep-promise'

cep('05010000')
.then(console.log)
Expand Down
9 changes: 1 addition & 8 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,5 @@ declare module 'cep-promise' {
neighborhood: string
}

// this workarround is because this : https://github.com/Microsoft/TypeScript/issues/5073
namespace cep {}

function cep( cep: string | number ): Promise<CEP>

export = cep
export default function cep(cep: string | number): Promise<CEP>
}


0 comments on commit 8452f1f

Please sign in to comment.