Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@types/element-resize-detector) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Installation
npm install --save @types/element-resize-detector
Summary
This package contains type definitions for element-resize-detector (https://github.com/wnr/element-resize-detector).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/element-resize-detector.
index.d.ts
declare function elementResizeDetectorMaker(
options?: elementResizeDetectorMaker.ErdmOptions,
): elementResizeDetectorMaker.Erd;
declare namespace elementResizeDetectorMaker {
interface ErdmOptions {
strategy?: "scroll" | "object" | undefined;
/**
* A custom reporter that handles reporting logs, warnings and errors.
* If not provided, a default id handler will be used.
* If set to false, then nothing will be reported.
*/
reporter?: ReporterProps | undefined;
/**
* Determines if listeners should be called when they are getting added.
* If true, the listener is guaranteed to be called when it has been added.
* If false, the listener will not be guarenteed to be called when
* it has been added (does not prevent it from being called).
*
* @default true
*/
callOnAdd?: boolean | undefined;
/**
* A custom id handler that is responsible for generating,
* setting and retrieving id's for elements.
* If not provided, a default id handler will be used.
*/
idHandler?: IdHandlerProps | undefined;
/**
* If set to true, the the system will report debug messages as default
* for the listenTo method.
*/
debug?: boolean | undefined;
}
interface IdHandlerProps {
get(element: HTMLElement, readonly: boolean): string;
set(element: HTMLElement): string;
}
interface ReporterProps {
log(idOrText: string, textOrId: string, element?: HTMLElement): void;
warn(text: string, element?: HTMLElement): void;
error(text: string): void;
}
interface Erd {
listenTo(element: HTMLElement, callback: (elem: HTMLElement) => void): void;
removeListener(element: HTMLElement, callback: (elem: HTMLElement) => void): void;
removeAllListeners(element: HTMLElement): void;
uninstall(element: HTMLElement): void;
}
}
export = elementResizeDetectorMaker;
Additional Details
- Last updated: Wed, 18 Oct 2023 01:17:34 GMT
- Dependencies: none
Credits
These definitions were written by Saransh Kataria, and Frank Li.