Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish Types to NPM #484

Open
willyboy opened this issue Feb 17, 2019 · 4 comments
Open

Publish Types to NPM #484

willyboy opened this issue Feb 17, 2019 · 4 comments

Comments

@willyboy
Copy link

willyboy commented Feb 17, 2019

Can you publish the typings here to DefinitelyTyped? Onesignal Cordova SDK is already in there.

@rgomezp rgomezp closed this as completed Feb 19, 2019
@VytautasLozickas
Copy link

Why was this closed?

@7freaks-otte
Copy link

7freaks-otte commented Nov 26, 2024

It would also help to export class OneSignal from this package.

I can install this SDK directly via Github in my package.json (I know this is discouraged but I just need the typings):

"onesignal-web-sdk": "github:OneSignal/OneSignal-Website-SDK#160204",

The following deep import successfully brings code completion and type checking to VS Code:

import type OneSignalWebType from 'onesignal-web-sdk/src/onesignal/OneSignal';

declare global {
  interface Window {
    OneSignal: typeof OneSignalWebType;
  }
}

But it causes TypeScript to check the complete onesignal-web-sdk and throws multiple errors on compile (probably due to tsconfig differences in my project) even with skipLibCheck: true and excludes properly configured.

@rgomezp Can anybody reopen this or reconsider a solution to make typings available?

@rgomezp rgomezp reopened this Nov 27, 2024
@sherwinski
Copy link
Contributor

I'm happy to support this, although it may take some time to get around to. I'll need to confer with the team on the best approach here (DefinitelyTyped, bundled, inline, etc).

@7freaks-otte
Copy link

@sherwinski Happy to read someone's taking care of this.

May I just add that it would be helpful to publish the types whenever a new version is deployed to the OneSignal servers or if you go for "inline" at least tag a release with "stable" as "latest" might not exactly match the version loaded via CDN.

Thank you

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

No branches or pull requests

5 participants