diff --git a/package-lock.json b/package-lock.json index de047b8..430ed10 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2810,11 +2810,6 @@ "integrity": "sha1-1Xn7f2k7hYAElHrzn6DbSfeVYCw=", "dev": true }, - "intersection-observer": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/intersection-observer/-/intersection-observer-0.5.0.tgz", - "integrity": "sha512-8Zgt4ijlyvIrQVTA7MPb2W9+KhoetrAbxlh0RmTGxpx0+ZsAXvy7IsbNnZIrqZ6TddAdWeQj49x7Ph7Ir6KRkA==" - }, "invariant": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.2.tgz", diff --git a/package.json b/package.json index f7d9968..7b62cd5 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,11 @@ "main": "dist/Vueresize.js", "files": [ "dist/Vueresize.js", - "dist/Vueresize.js.map" + "dist/Vueresize.js.map", + "types/index.d.ts", + "types/vueresize.d.ts" ], + "types": "types/index.d.ts", "keywords": [ "vue", "vuejs", @@ -20,7 +23,6 @@ }, "dependencies": { "css-element-queries": "^1.0.2", - "intersection-observer": "^0.5.0", "lodash.debounce": "^4.0.8" }, "devDependencies": { diff --git a/src/Vueresize.js b/src/Vueresize.js index af83bdf..09145c0 100644 --- a/src/Vueresize.js +++ b/src/Vueresize.js @@ -1,7 +1,5 @@ import ResizeSensor from 'resizeSensor' import lodashDebounce from 'lodash.debounce' -require('./findPolyfill'); -require('intersection-observer'); const { debounce = lodashDebounce } = lodashDebounce; const defaultDelay = 150; diff --git a/types/index.d.ts b/types/index.d.ts new file mode 100644 index 0000000..86372f5 --- /dev/null +++ b/types/index.d.ts @@ -0,0 +1,4 @@ +import { VueResizeDirectiveOptions } from "./vueresize"; + +declare var VueResize: VueResizeDirectiveOptions; +export default VueResize; diff --git a/types/vueresize.d.ts b/types/vueresize.d.ts new file mode 100644 index 0000000..069f0a4 --- /dev/null +++ b/types/vueresize.d.ts @@ -0,0 +1,4 @@ +import { PluginObject } from "vue"; +import { DirectiveOptions } from "vue/types/options"; + +export interface VueResizeDirectiveOptions extends DirectiveOptions {}