This package prevents typescript to work correctly due to problems with typescript definitions.
node_modules/@sendgrid/client/src/client.d.ts(37,10): error TS2714: The expression of an export assignment must be an identifier or qualified name in an ambient context.
node_modules/@sendgrid/helpers/classes/email-address.d.ts(11,3): error TS7010: 'fromData', which lacks return-type annotation, implicitly has an 'any' return type.
node_modules/@sendgrid/helpers/classes/email-address.d.ts(16,3): error TS7010: 'setName', which lacks return-type annotation, implicitly has an 'any' return type.
node_modules/@sendgrid/helpers/classes/email-address.d.ts(21,3): error TS7010: 'setEmail', which lacks return-type annotation, implicitly has an 'any' return type.
node_modules/@sendgrid/mail/src/mail.d.ts(33,10): error TS2714: The expression of an export assignment must be an identifier or qualified name in an ambient context.
Please I need this fix ASAP!
@demian85 in the mean time you can fork the repo, make the above fixes and them do your npm install from your master branch of the forked repo.
@nitish24p he can just point to my fork without creating another one..
Thanks @nitish24p and @phra for providing a temporary fix until we get this merged.
@demian85,
Did their solution work for you?
Well, not really. It's really a mindfuck for me to have slashes in the import route.
After adding dependency as yarn add phra/sendgrid-nodejs#89b988a61d0b3e8b9d19e261b3f3f9880c20f16e, I keep getting src/server/emails/emailer.ts(5,25): error TS2307: Cannot find module 'sendgrid'.
I just want the email package, but I'm not sure what I'm getting when importing...
import mailer = require('sendgrid/mail'); // what? where is mail?
import { MailData } from 'sendgrid/helpers/classes/mail'; // how to import this type?
I'd appreciate any help!
@demian85 quick fix is to try the following:
import mailer = require('@sendgrid/mail'); // tslint:disable-line
but the library is broken right now with TS 2.6 (see #619)