Cannot find console in Custom Plugin

plugins
ios

#1

I am trying to make a plugin and inside i have used a podfile. i created a common.ts which inherits from Observable and i added some console logs.
Now i created a scripts which will run everytime but somehow i am getting following errors:

Script:
tsc nativescript-networking/NSNetworking.ios.ts --types tns-platform-declarations/ios nativescript-networking/typings/objc!AFNetworking.d.ts --lib es2016 -d true && tns plugin remove nativescript-networking && tns plugin add nativescript-networking

Errors:

nativescript-networking/NSNetworking.common.ts(1,28): error TS2307: Cannot find module 'data/Observable'.
nativescript-networking/NSNetworking.ios.ts(21,17): error TS2304: Cannot find name 'console'.
nativescript-networking/NSNetworking.ios.ts(24,17): error TS2304: Cannot find name 'console'.
nativescript-networking/typings/objc!AFNetworking.d.ts(724,151): error TS2304: Cannot find name 'NSURLSessionDelayedRequestDisposition'.

#2

Check your tsconfig.json, in a app environment the default tsconfig maps your data/observable to tns-core-modules/data/observable. So try importing with full path when you are writing plugins.

You will have to install tns-platform-declarations for native types, don’t forget to update your references.d.ts once installed. Or you can simply use

declare var NSURLSessionDelayedRequestDisposition: any;

I’m not sure about console, it usually works. If you are not using plugin seed please do, that saves lot of time from all basic setups for every plugin.