Skip to content

Commit

Permalink
Added TypeScript definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyVerbruggen committed Feb 27, 2016
1 parent dc1ec42 commit d49e3de
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ If you want a quickstart, [clone our demo app](https://github.com/EddyVerbruggen

```js
touchid.verifyFingerprint({
message: 'Scan yer finger', // optional
fallbackTitle: 'Enter PIN' // optional
message: 'Scan yer finger', // optional, shown in the fingerprint dialog (default: 'Scan your finger').
fallbackMessage: 'Enter PIN' // optional, the button label when scanning fails (default: 'Enter password').
}).then(
function() {
console.log("Fingerprint was OK");
Expand All @@ -46,4 +46,5 @@ If you want a quickstart, [clone our demo app](https://github.com/EddyVerbruggen
```

## Changelog
1.1.1 Added TypeScript definitions.
1.1.0 Added Android platform which will always return false for `touchid.available`.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nativescript-touchid",
"version": "1.1.0",
"version": "1.1.1",
"description": "A TouchID (fingerprint scanner) module for use in NativeScript apps",
"main": "touchid.js",
"nativescript": {
Expand Down
26 changes: 26 additions & 0 deletions touchid.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
declare module "nativescript-touchid" {

export interface VerifyFingerprintOptions {
/**
* The optional message in the fingerprint dialog.
* Default: 'Scan your finger'.
*/
message?: string;

/**
* The optional button label when scanning the fingerprint fails.
* Default: 'Enter password'.
*/
fallbackMessage?: string;
}

/**
* Sets text on the clipboard, replacing anything currently on there.
*/
export function available(): Promise<boolean>;

/**
* Gets any currently present text from the clipboard.
*/
export function verifyFingerprint(options: VerifyFingerprintOptions): Promise<string>;
}
2 changes: 1 addition & 1 deletion touchid.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var verifyFingerprint = function (arg) {
reject("Not available");
}
} catch (ex) {
console.log("Error in touchid.verifyFingerprintWithCustomPasswordFallback: " + ex);
console.log("Error in touchid.verifyFingerprint: " + ex);
reject(ex);
}
});
Expand Down

0 comments on commit d49e3de

Please sign in to comment.