Je suis nouveau à Typescript et Angular 2. Je dois installer une dépendance npm et l'utiliser dans mon application angulaire 2.Impossible de trouver les dactylographiés.d.ts et déclarer les modules dans l'application tapuscrite angulaire 2
La dépendance est https://www.npmjs.com/package/ng2-stomp-service
J'ai installé les paquets nécessaires, mais je dois ajouter ce qui suit à mon dossier typings.d.ts
declare module 'stompjs';
declare module 'sockjs-client';
Je ne peux pas trouver le fichier typings.d.ts
dans mon projet.
Je l'ai essayé ce qui suit jusqu'à présent,
npm install typings --global
npm install @types/stompjs
npm isntall @types/sockjs-client
typings install dt~stompjs --save
typings install dt~sockjs-client --save
Je fichier typings.json
avec le contenu,
{
"dependencies": {
"sockjs-client": "registry:dt/sockjs-client#1.0.3+20160727010356",
"stompjs": "registry:dt/stompjs#2.3.0+20161111105645"
}
}
Quand je lance mon application angulaire 2 avec npm start
il jette erreur comme suit
ERROR in D:/Userfiles/subramanians/projects/hand-cricket/node_modules/ng2-stomp-service/dist/stomp.service.ts (27,2): Member 'config' implicitly has an 'any' type.
ERROR in D:/Userfiles/subramanians/projects/hand-cricket/node_modules/ng2-stomp-service/dist/stomp.service.ts (36,2): Member 'queuePromises' implicitly has an 'any[]' type.
ERROR in D:/Userfiles/subramanians/projects/hand-cricket/node_modules/ng2-stomp-service/dist/stomp.service.ts (83,32): Parameter 'str' implicitly has an 'any' type.
ERROR in D:/Userfiles/subramanians/projects/hand-cricket/node_modules/ng2-stomp-service/dist/stomp.service.ts (132,53): Parameter 'response' implicitly has an 'any' type.
ERROR in D:/Userfiles/subramanians/projects/hand-cricket/node_modules/ng2-stomp-service/dist/stomp.service.ts (27,2): Member 'config' implicitly has an 'any' type.
ERROR in D:/Userfiles/subramanians/projects/hand-cricket/node_modules/ng2-stomp-service/dist/stomp.service.ts (36,2): Member 'queuePromises' implicitly has an 'any[]' type.
ERROR in D:/Userfiles/subramanians/projects/hand-cricket/node_modules/ng2-stomp-service/dist/stomp.service.ts (83,32): Parameter 'str' implicitly has an 'any' type.
ERROR in D:/Userfiles/subramanians/projects/hand-cricket/node_modules/ng2-stomp-service/dist/stomp.service.ts (132,53): Parameter 'response' implicitly has an 'any' type.
Je ne suis pas sûr de ce qui cause le problème, je suppose que je t parce que je n'ai pas déclaré les modules dans typings.d.ts
S'il vous plaît aviser. Je vous remercie.