Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

Commit

Permalink
Add Typescript definitions
Browse files Browse the repository at this point in the history
.ts/.tsx files should no longer complain about `window.objectFitPolyfill()` or `import 'objectFitPolyfill';`

reference: https://www.typescriptlang.org/docs/handbook/declaration-files/templates/global-d-ts.html
  • Loading branch information
cee-chen committed Jan 27, 2021
1 parent 4db6055 commit 8c44eea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare function objectFitPolyfill(): boolean;
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
"version": "2.3.3",
"description": "A Javascript polyfill for browsers that don't support the object-fit CSS property",
"main": "dist/objectFitPolyfill.min.js",
"types": "global.d.ts",
"files": [
"dist",
"src"
"src",
"global.d.ts"
],
"keywords": [
"object-fit",
Expand Down

0 comments on commit 8c44eea

Please sign in to comment.