-
Notifications
You must be signed in to change notification settings - Fork 554
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
Typescript definition #521
Comments
I would also like to see this, we use a Typescript + Angular 1.5 at the moment and some up to date TS definitions would very welcome. |
+1 |
Pull request in for v10 here. However, I have to say that figuring out what is public versus private right now is near impossible. I went with scientific "well, if it's listed in an example, it's public" approach. If there's something I missed that should be on the public API, make a comment on that pull request. |
EDIT DefinitivelyTyped accepted the pull request so I deleted my fork. Use the DefinitivelyTyped version now like so: OLD COMMENT This will work for now until they accept the pull request over at DefinitivelyTyped |
@carusology thanks! Great work. I'm also trying to get Auth0-lock to work with TypeScript. I'm trying to use it with webpack and npm. Your definition works so that I pass the TypeScript compilation and I have an import statement for the auth0 module like this: I've also tried changing the import statement to I have a sample repo here that is forked from the official webpack example (that is using javascript, not typescript). Does someone here have any idea on how I can import the auth0-lock package from npm and use it with TypeScript (+definitions)? |
@mikeesouth Yeah, I ran into that issue with v9 of the auth0-lock as well. Here's what I did in my project to solve the problem:
|
@carusology ah, thank you so much. It works. I've been at this issue for a while now :) |
My changeset was merged into DefinitivelyTyped here. This issue can be closed. |
To save others from the same pain.
the auth0 typings were renamed a few days ago to auth0-js ! This is working for me with Auth0 lock v10.2.1 in a Webpack Angular2 project. |
Great job @carusology and @mikeesouth . After scouring the net, this got it all going. Many thanks. @SaltyDH, coles notes also helpful re: auth0.js. It might be helpful if the Auth0 folks updated their tutorials to reflect these nuggets of knowledge. |
Closing this one, will update angular docs about it |
@carusology Does this still work with the current
|
@mikebridge We ran into this too about a month ago. If I recall correctly, a DefinitivelyTyped contributor made a breaking change (represented as v8 of |
@carusology I was pulling down the most recent one: "@types/auth0-lock": "*" Npm does not download the "@types/auth0-js": "*" ... and then I copied your auth0-lock definitions locally, removed the 'v7' reference and added these lines: /// <reference types="auth0-js" />
import Auth0Error = auth0.Auth0Error;
import Auth0UserProfile = auth0.Auth0Error; This seems to be working so far. |
@mikebridge Yeah, that's what I figured. Here's our types in
The key to getting the v7 version of the auth0-js typing is setting your Note that I'm not sure you'll need that raw |
@carusology Thanks! In the meantime it looks like there is now a pending commit to fix it. |
Is it planed to provide an official typescript definition file for use with frameworks like Aurelia or Angular2?
It seems that the definition on DefinitelyTyped is a bit outdated
The text was updated successfully, but these errors were encountered: