You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/06/24 13:27:47 UTC

[GitHub] [cordova-plugin-file] timbru31 edited a comment on issue #400: Add documentation on how to use this plugin with TypeScript

timbru31 edited a comment on issue #400:
URL: https://github.com/apache/cordova-plugin-file/issues/400#issuecomment-648819057


   This one works fine for us:
   
   ```json
   {
   	"extends": "./tsconfig.json",
   	"compilerOptions": {
   		"outDir": "./out-tsc/app",
   		"preserveConstEnums": true,
   		"types": ["node", "cordova", "cordova-plugin-file", "cordova-plugin-lottie-splashscreen"]
   	},
   	"files": ["src/main.ts", "src/polyfills.ts"],
   	"include": ["src/**/*.d.ts"]
   }
   ```
   
   Base `tsconfig.json` is:
   ```json
   {
   	"compileOnSave": false,
   	"compilerOptions": {
   		"baseUrl": "./",
   		"outDir": "./dist/out-tsc",
   		"sourceMap": true,
   		"declaration": false,
   		"module": "esnext",
   		"moduleResolution": "node",
   		"emitDecoratorMetadata": true,
   		"experimentalDecorators": true,
   		"importHelpers": true,
   		"noImplicitAny": true,
   		"strictNullChecks": false,
   		"noUnusedLocals": true,
   		"noUnusedParameters": true,
   		"resolveJsonModule": true,
   		"allowSyntheticDefaultImports": true,
   		"allowUnreachableCode": false,
   		"target": "es2015",
   		"typeRoots": ["node_modules/@types"],
   		"lib": ["es2020", "dom"]
   	},
   	"angularCompilerOptions": {
   		"disableTypeScriptVersionCheck": true,
   		"fullTemplateTypeCheck": true,
   		"strictInjectionParameters": true
   	}
   }
   
   ```
   
   Blind guess: You are missing the `cordova-plugin-file` entry in the `types` array.
   
   Edit: Oh and no need to call `import 'cordova-plugin-file'`


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org