Skip to content

Commit

Permalink
Add Type Script declaration file
Browse files Browse the repository at this point in the history
  • Loading branch information
strausr committed Nov 11, 2019
1 parent bdef8bc commit 83b3344
Show file tree
Hide file tree
Showing 6 changed files with 1,701 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -202,6 +202,10 @@ cloudinary.image("sample", {format: "png", width: 100, height: 100, crop: "fill"
// <img src='http://res.cloudinary.com/demo/image/upload/c_fill,h_100,w_100/sample.png' height='100' width='100'/>
```

### Typescript

🎉New 🎉TypeScript support was just added. Check out the [declaration file](https://github.com/cloudinary/cloudinary_npm/types/index.d.ts).

### Samples

You can find our simple and ready-to-use samples projects, along with documentation in the [samples folder](https://github.com/cloudinary/cloudinary_npm/tree/master/samples).
Expand Down
16 changes: 14 additions & 2 deletions package.json
Expand Up @@ -12,7 +12,8 @@
"main": "cloudinary.js",
"dependencies": {
"lodash": "^4.17.11",
"q": "^1.5.1"
"q": "^1.5.1",
"typescript": "^2.9.2"
},
"devDependencies": {
"babel-cli": "^6.26.0",
Expand All @@ -24,6 +25,7 @@
"babel-register": "^6.26.0",
"babel-runtime": "^6.26.0",
"dotenv": "4.x",
"dtslint": "^0.9.1",
"eslint": "^5.16.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-plugin-import": "^2.17.2",
Expand All @@ -36,8 +38,18 @@
"sinon": "^6.1.4",
"webpack-cli": "^3.2.1"
},
"files": [
"lib/**/*",
"lib-es5/**/*",
"cloudinary.js",
"babel.config.js",
"package.json",
"types/*"
],
"types": "types",
"scripts": {
"test": "node_v=$(node --version)z\nif [[ \"${node_v%%.*z}\" == 'v4' ]]\nthen\nnpm run test-es5\nelse\necho 10 && npm run test-es6\nfi",
"test": "node_v=$(node --version)z\nif [[ \"${node_v%%.*z}\" == 'v4' ]]\nthen\nnpm run test-es5\nelse\necho 10 && npm run test-es6\nfi\nnpm run dtslint",
"dtslint": "dtslint --expectOnly --localTs node_modules/typescript/lib types ",
"lint": "eslint .",
"compile": "node_modules/.bin/babel lib --out-dir lib-es5 --delete-dir-on-start --verbose",
"test-es6": "which node && node node_modules/.bin/mocha --ui bdd -R spec --recursive test/",
Expand Down
16 changes: 16 additions & 0 deletions tsconfig.json
@@ -0,0 +1,16 @@
{
"compilerOptions": {
"module": "commonjs",
"noImplicitAny": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"declaration": true
},
"include": [
"dist/**/*",
"types/**/*"
],
"exclude": [
"node_modules"
]
}

0 comments on commit 83b3344

Please sign in to comment.