[simple-element-resize-detector] Add types (#47294)

* [simple-element-resize-detector] Add types

* Use export equals

* Update types/simple-element-resize-detector/index.d.ts

Co-authored-by: Piotr Błażejewicz (Peter Blazejewicz) <peterblazejewicz@users.noreply.github.com>

* Update types/simple-element-resize-detector/index.d.ts

Co-authored-by: Piotr Błażejewicz (Peter Blazejewicz) <peterblazejewicz@users.noreply.github.com>

Co-authored-by: Piotr Błażejewicz (Peter Blazejewicz) <peterblazejewicz@users.noreply.github.com>
This commit is contained in:
Nathan Bierema 2020-09-08 07:49:56 -04:00 committed by GitHub
parent 7b9709c13e
commit bcd3d52d37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,11 @@
// Type definitions for simple-element-resize-detector 1.3
// Project: https://github.com/developit/simple-element-resize-detector#readme
// Definitions by: Nathan Bierema <https://github.com/Methuselah96>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export as namespace simpleElementResizeDetector;
declare function simpleElementResizeDetector(
element: HTMLElement,
handler: (element: HTMLElement) => void
): HTMLIFrameElement;
export = simpleElementResizeDetector;

View File

@ -0,0 +1,6 @@
import observeResize = require ("simple-element-resize-detector");
declare const elementRef: HTMLElement;
declare const collapse: () => void;
const resizeDetector: HTMLIFrameElement = observeResize(elementRef, collapse);

View File

@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"dom",
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"simple-element-resize-detector-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }