1 | import * as React from 'react';
|
2 | import { IRefObject, IStyleFunctionOrObject } from '../../Utilities';
|
3 | import { IStyle, ITheme } from '../../Styling';
|
4 | import { ScrollablePaneBase } from './ScrollablePane.base';
|
5 | import { Sticky } from '../Sticky/Sticky';
|
6 |
|
7 |
|
8 |
|
9 | export interface IScrollablePane {
|
10 |
|
11 | forceLayoutUpdate(): void;
|
12 |
|
13 | getScrollPosition(): number;
|
14 | }
|
15 |
|
16 |
|
17 |
|
18 | export interface IScrollablePaneProps extends React.HTMLAttributes<HTMLElement | ScrollablePaneBase> {
|
19 | |
20 |
|
21 |
|
22 |
|
23 | componentRef?: IRefObject<IScrollablePane>;
|
24 | |
25 |
|
26 |
|
27 | styles?: IStyleFunctionOrObject<IScrollablePaneStyleProps, IScrollablePaneStyles>;
|
28 | |
29 |
|
30 |
|
31 | theme?: ITheme;
|
32 | |
33 |
|
34 |
|
35 |
|
36 | className?: string;
|
37 | |
38 |
|
39 |
|
40 | initialScrollPosition?: number;
|
41 | scrollbarVisibility?: ScrollbarVisibility;
|
42 | }
|
43 |
|
44 |
|
45 |
|
46 | export interface IScrollablePaneStyleProps {
|
47 | |
48 |
|
49 |
|
50 | theme: ITheme;
|
51 | |
52 |
|
53 |
|
54 | className?: string;
|
55 | scrollbarVisibility?: IScrollablePaneProps['scrollbarVisibility'];
|
56 | }
|
57 |
|
58 |
|
59 |
|
60 | export interface IScrollablePaneStyles {
|
61 | |
62 |
|
63 |
|
64 | root: IStyle;
|
65 | |
66 |
|
67 |
|
68 | stickyAbove: IStyle;
|
69 | |
70 |
|
71 |
|
72 | stickyBelow: IStyle;
|
73 | |
74 |
|
75 |
|
76 | stickyBelowItems: IStyle;
|
77 | |
78 |
|
79 |
|
80 | contentContainer: IStyle;
|
81 | }
|
82 |
|
83 |
|
84 |
|
85 | export declare const ScrollbarVisibility: {
|
86 | auto: "auto";
|
87 | always: "always";
|
88 | };
|
89 |
|
90 |
|
91 |
|
92 | export declare type ScrollbarVisibility = typeof ScrollbarVisibility[keyof typeof ScrollbarVisibility];
|
93 | export interface IScrollablePaneContext {
|
94 | scrollablePane?: {
|
95 | subscribe: (handler: (container: HTMLElement, stickyContainer: HTMLElement) => void) => void;
|
96 | unsubscribe: (handler: (container: HTMLElement, stickyContainer: HTMLElement) => void) => void;
|
97 | addSticky: (sticky: Sticky) => void;
|
98 | removeSticky: (sticky: Sticky) => void;
|
99 | updateStickyRefHeights: () => void;
|
100 | sortSticky: (sticky: Sticky, sortAgain?: boolean) => void;
|
101 | notifySubscribers: (sort?: boolean) => void;
|
102 | syncScrollSticky: (sticky: Sticky) => void;
|
103 | };
|
104 | }
|
105 | export declare const ScrollablePaneContext: React.Context<IScrollablePaneContext>;
|