Skip to content

Type definitions when dropping .d.ts file into the working directory#879

Open
cosminalco wants to merge 1 commit intolocalForage:masterfrom
cosminalco:master
Open

Type definitions when dropping .d.ts file into the working directory#879
cosminalco wants to merge 1 commit intolocalForage:masterfrom
cosminalco:master

Conversation

@cosminalco
Copy link

It can save a lot of headache a simple new line of code in localforage.d.ts for newcomers who want to test/use localForage with typescript.

Drop typings/localforage.d.ts file into the working directory or point to it with triple slash reference.

/// <reference path="./path/to/your/your/localforage.d.ts" />
localforage.setItem('key', 'value').then(function () {
  return localforage.getItem('key');
}).then(function (value) {
  // we got our value
}).catch(function (err) {
  // we got an error
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant