-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
66 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Pagar.me JavaScript Types | ||
[![npm (scoped)](https://img.shields.io/npm/v/pagarme-js-type.svg)](https://www.npmjs.com/package/pagarme-js-type) | ||
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) | ||
|
||
A unofficial repository for adding typing / typescript compatibility for Pagar.me. | ||
|
||
It's a **work in progress**. All type definition are take from the **[official documentation API Pagar.me V4](https://docs.pagar.me/reference)** and **[official pagarme-js documentation](https://pagarme.github.io/pagarme-js/)** | ||
|
||
## What are declaration files? | ||
|
||
See the [TypeScript handbook](http://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html). | ||
|
||
## How do I get them? | ||
|
||
### npm | ||
|
||
This is the preferred method. For example: | ||
|
||
```sh | ||
npm install --save-dev pagarme-js-types | ||
``` | ||
|
||
The types should then be automatically included by the compiler. | ||
You may need to add a `types` reference if you're not using modules: | ||
|
||
```ts | ||
/// <reference types="pagarme-js-types" /> | ||
``` | ||
|
||
See more in the [handbook](http://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html). | ||
|
||
## To do | ||
You can create a PR to contribute for now these functions are typed: | ||
### Transactions | ||
- [x] all | ||
- [x] capture | ||
- [x] create | ||
- [x] find | ||
- [x] refund | ||
|
||
### Postback | ||
- [x] calculateSignature | ||
- [x] verifySignature | ||
|
||
### Refunds | ||
- [x] find |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"noLib": false, | ||
"skipLibCheck": true, | ||
"lib": [ | ||
"es2015" | ||
], | ||
"allowSyntheticDefaultImports": true, | ||
"esModuleInterop": true, | ||
"emitDecoratorMetadata": true, | ||
"experimentalDecorators": true, | ||
"target": "es2017", | ||
"strict": true, | ||
"strictPropertyInitialization": false, | ||
"newLine": "LF", | ||
"outDir": "./lib" | ||
}, | ||
"file": "index.ts" | ||
} | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"noLib": false, | ||
"skipLibCheck": true, | ||
"lib": [ | ||
"es2015" | ||
], | ||
"allowSyntheticDefaultImports": true, | ||
"esModuleInterop": true, | ||
"emitDecoratorMetadata": true, | ||
"experimentalDecorators": true, | ||
"target": "es2017", | ||
"strict": true, | ||
"strictPropertyInitialization": false, | ||
"newLine": "LF", | ||
"outDir": "./lib" | ||
}, | ||
"file": "index.d.ts" | ||
} |