Skip to content
This repository was archived by the owner on May 18, 2025. It is now read-only.

Commit 3fa89f3

Browse files
authored
Merge pull request matrix-org#6243 from matrix-org/t3chguy/ts/8
2 parents 9d6d8fc + a59e94b commit 3fa89f3

File tree

14 files changed

+1006
-878
lines changed

14 files changed

+1006
-878
lines changed

src/@types/global.d.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ limitations under the License.
1616

1717
import "matrix-js-sdk/src/@types/global"; // load matrix-js-sdk's type extensions first
1818
import * as ModernizrStatic from "modernizr";
19+
1920
import ContentMessages from "../ContentMessages";
2021
import { IMatrixClientPeg } from "../MatrixClientPeg";
2122
import ToastStore from "../stores/ToastStore";
@@ -127,11 +128,24 @@ declare global {
127128
setSinkId(outputId: string);
128129
}
129130

131+
// Add Chrome-specific `instant` ScrollBehaviour
132+
type _ScrollBehavior = ScrollBehavior | "instant";
133+
134+
interface _ScrollOptions {
135+
behavior?: _ScrollBehavior;
136+
}
137+
138+
interface _ScrollIntoViewOptions extends _ScrollOptions {
139+
block?: ScrollLogicalPosition;
140+
inline?: ScrollLogicalPosition;
141+
}
142+
130143
interface Element {
131144
// Safari & IE11 only have this prefixed: we used prefixed versions
132145
// previously so let's continue to support them for now
133146
webkitRequestFullScreen(options?: FullscreenOptions): Promise<void>;
134147
msRequestFullscreen(options?: FullscreenOptions): Promise<void>;
148+
scrollIntoView(arg?: boolean | _ScrollIntoViewOptions): void;
135149
}
136150

137151
interface Error {

src/components/structures/AutoHideScrollbar.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ See the License for the specific language governing permissions and
1515
limitations under the License.
1616
*/
1717

18-
import React, { HTMLAttributes } from "react";
18+
import React, { HTMLAttributes, WheelEvent } from "react";
1919

20-
interface IProps extends HTMLAttributes<HTMLDivElement> {
20+
interface IProps extends Omit<HTMLAttributes<HTMLDivElement>, "onScroll"> {
2121
className?: string;
22-
onScroll?: () => void;
23-
onWheel?: () => void;
22+
onScroll?: (event: Event) => void;
23+
onWheel?: (event: WheelEvent) => void;
2424
style?: React.CSSProperties
2525
tabIndex?: number,
2626
wrappedRef?: (ref: HTMLDivElement) => void;

0 commit comments

Comments
 (0)