Skip to content

Commit

Permalink
replace .ts with .d.ts declaration file
Browse files Browse the repository at this point in the history
  • Loading branch information
Sherwin H committed Oct 10, 2019
1 parent 3eaef7e commit d1b7fbe
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 209 deletions.
27 changes: 27 additions & 0 deletions dist/imgix-core-js.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Type definitions for imgix-core-js.js

// export as namespace ImgixClient;

/*~ This declaration specifies that the class constructor function
*~ is the exported object from the file
*/

/*~ Write your module's methods and properties in this class */
declare class ImgixClient {
domain: string;
useHTTPS: boolean;
includeLibraryParam: boolean;
secureURLToken: string;

constructor(opts: {domain: string; secureURLToken?: string; useHTTPS?: boolean; includeLibraryParam?: boolean;});


buildURL(path: string, params?: {}): string;
_sanitizePath(path: string): string;
_buildParams(params: {}): string;
_signParams(path: string, queryParams?: {}): string;
buildSrcSet(path: string, params?: {}): string;
_buildSrcSetPairs(path: string, params?: {}): string;
_buildDPRSrcSet(path: string, params?: {}): string;
}
export = ImgixClient;
9 changes: 6 additions & 3 deletions src/tsconfig.json → dist/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"compilerOptions": {
"outDir": "../dist",
// "rootDir": "./src",
"allowJs": true,
"target": "es5",
"module": "CommonJS",
// "allowJs": true,
"target": "es2015",
"module": "umd",
// types option has been previously configured
"types": [
// add node as an option
Expand All @@ -17,6 +17,9 @@
// "node_modules/@types"
// ]
},
"files": [
"imgix-core-js.d.ts"
],
"include": [
"./imgix-core-js.ts"
]
Expand Down
6 changes: 2 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,23 @@
"repository": "https://github.com/imgix/imgix-core-js",
"scripts": {
"assert_version": "node assert_version.js",
"compile": "mkdir -p dist && uglifyjs ./src/imgix-core-js.js -o ./dist/imgix-core-js.min.js && tsc -p src",
"compile": "mkdir -p dist && uglifyjs ./src/imgix-core-js.js -o ./dist/imgix-core-js.min.js && tsc -p dist",
"prepublish": "npm run compile && npm run assert_version",
"test": "mocha"
},
"main": "dist/imgix-core-js.js",
"types": "dist/imgix-core-js.d.ts",
"dependencies": {
"js-base64": "^2.1.9",
"md5": "^2.2.1"
"md5": "^2.2.1",
"typescript": "^3.6.3",
"@types/node": "^12.7.8"
},
"license": "BSD-2-Clause",
"devDependencies": {
"@types/node": "^12.7.8",
"mocha": "6.2.1",
"phantomjs": "2.1.7",
"sinon": "7.5.0",
"typescript": "^3.6.3",
"uglify-js": "3.6.0"
}
}
198 changes: 0 additions & 198 deletions src/imgix-core-js.ts

This file was deleted.

0 comments on commit d1b7fbe

Please sign in to comment.