Update API.md

Generic improvements and fixes to API Document
This commit is contained in:
Alexander Cerutti
2019-07-07 16:15:39 +02:00
committed by GitHub
parent d2c97a0d6d
commit d4f67d9b12

25
API.md
View File

@@ -42,7 +42,7 @@ ___
* Setting relevance * Setting relevance
* [.beacons()](#method_beacons) * [.beacons()](#method_beacons)
* [.locations()](#method_locations) * [.locations()](#method_locations)
* [.relevantDate()][#method_revdate] * [.relevantDate()](#method_revdate)
* Setting NFC * Setting NFC
* [.nfc()](#method_nfc) * [.nfc()](#method_nfc)
* Getting the current information * Getting the current information
@@ -204,7 +204,7 @@ pass.barcodes({
#### .barcode() #### .barcode()
```javascript ```javascript
pass.barcode(data: string); pass.barcode(chosenFormat: string): this;
``` ```
**Returns**: **Returns**:
@@ -498,7 +498,7 @@ pass.primaryFields.pop();
#### .transitType #### .transitType
```javascript ```typescript
pass.transitType = "PKTransitTypeAir"; pass.transitType = "PKTransitTypeAir";
``` ```
@@ -522,26 +522,21 @@ As you can see in [examples folder](/examples), to send a .pkpass file, a basic
#### .generate() #### .generate()
```javascript ```typescript
pass.generate(); pass.generate(): Stream;
``` ```
**Returns**: `Promise` **Returns**: `Stream`
**Description**: **Description**:
The returned Promise will contain a stream or an error. Creates a pass zip as Stream.
**Examples**: **Examples**:
```javascript ```typescript
pass.generate() const passStream = pass.generate();
.then(stream => { doSomethingWithPassStream(stream);
doSomethingWithPassStream();
})
.catch(error => {
doSomethingWithThrownError();
});
``` ```
___ ___