Skip to content

Commit 60e110b

Browse files
Ajay-singh1AritraDey-Dev
authored andcommitted
Fix: typescript (#16654)
1 parent 8c91bfd commit 60e110b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/ts/resizeObserver.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
"use strict";
1616

17-
function observeResize(el, callback) {
17+
export function observeResize(el, callback) {
1818
if (window.ResizeObserver) {
1919
const ro = new ResizeObserver(entries => {
2020
for (let entry of entries) {

src/ts/sidebar.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import { getById , toggleAttribute , isPrintableCharacter ,keyCodes, getByClass ,listen } from "./utils";
1515
import { button , click , ariaExpanded , keydown , active} from "./constants";
1616
import { KbdNav } from "./kbdnav";
17+
import { observeResize } from "./resizeObserver";
1718
declare type Callback = (element: HTMLElement) => void;
1819

1920
/* tslint:disable */
@@ -22,7 +23,6 @@ export {}; // Make this a module
2223
declare global {
2324
interface Window {
2425
handleSidebar: () => void;
25-
observeResize: (element: HTMLElement, callback: (element: HTMLElement) => void) => void;
2626
}
2727
}
2828
/* tslint:enable */
@@ -62,7 +62,7 @@ function handleSidebar(): void {
6262
});
6363
});
6464

65-
window.observeResize(body, el => {
65+
observeResize(body, (el:HTMLElement) => {
6666
if ((el.style.maxHeight !== null) && (el.style.maxHeight !== "")) {
6767
el.style.maxHeight = el.scrollHeight + "px";
6868
}

0 commit comments

Comments
 (0)