Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Where I should find the declaration files for typescript? #154

Closed
elranu opened this issue Jul 13, 2016 · 5 comments
Closed

Where I should find the declaration files for typescript? #154

elranu opened this issue Jul 13, 2016 · 5 comments
Assignees

Comments

@elranu
Copy link

elranu commented Jul 13, 2016

Hi
Where I should find the declaration files for typescript?
Is there a small example how to import/use codepush in typescript?

are this the typings: https://github.com/Microsoft/cordova-plugin-code-push/tree/master/typings

why are not automatically installed when I do cordova plugin add cordova-plugin-code-push@latest ?

Regards

@richardhuaaa
Copy link
Contributor

Hi @elranu, yes, those are the typings, although they are not automatically imported. They should work if you do something like the following:

/// <reference path="path/to/typing.d.ts" />

import * as codePush from "code-push";

...

onDeviceReady(): void {
    codePush.sync();
}

When you mention 'automatic install', do you mean intellisense in your editor, or something else? And if so, which editor are you using?

@elranu
Copy link
Author

elranu commented Jul 18, 2016

@Silhouettes thanks for your reply. when I say automatically is that when I do cordova plugin add cordova-plugin-code-push@latest the typings.d.ts is not downloaded on the plugins folder.

@sergey-akhalkov
Copy link
Contributor

Hi @elranu, I've merged PR in master that should fix it #252, could you please have a chance to look at this and verify if it works as expected.
I'm closing this for now, please feel free to reopen if needed.

@mredbishop
Copy link

This still seems like it's wrong to me as in most recent packages that have typings, npm installing the package makes the typings available to an import command. I would expect to be able to do something similar to the following:

import 'cordova-plugin-code-push';

codePush.sync();

and have it recognise the codePush types?

@ruslan-bikkinin
Copy link
Contributor

@mredbishop thanks for the question, does it relates to #23 (comment)?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants