Skip to content

Commit

Permalink
VirtualScroller update TS doc for scrollInView (#6472)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Apr 25, 2024
1 parent 484aab3 commit daf5acc
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
5 changes: 5 additions & 0 deletions components/lib/api/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ import { ProgressBarPassThroughOptions } from '../progressbar/progressbar';
import { ProgressSpinnerPassThroughOptions } from '../progressspinner/progressspinner';
import { RadioButtonPassThroughOptions } from '../radiobutton/radiobutton';
import { RatingPassThroughOptions } from '../rating/rating';
import { RipplePassThroughOptions } from '../ripple/ripple';
import { RowPassThroughOptions } from '../row/row';
import { ScrollPanelPassThroughOptions } from '../scrollpanel/scrollpanel';
import { ScrollTopPassThroughOptions } from '../scrolltop/scrolltop';
Expand Down Expand Up @@ -546,6 +547,10 @@ export interface PrimeReactPTOptions {
* Custom passthrough(pt) options for Rating.
*/
rating?: RatingPassThroughOptions;
/**
* Custom passthrough(pt) options for Ripple.
*/
ripple?: RipplePassThroughOptions;
/**
* Custom passthrough(pt) options for Row.
*/
Expand Down
32 changes: 32 additions & 0 deletions components/lib/ripple/ripple.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,28 @@
*
*/
import * as React from 'react';
import { PassThroughOptions } from '../passthrough';
import { PassThroughType } from '../utils';

export declare type RipplePassThroughType<T> = PassThroughType<T, RipplePassThroughMethodOptions>;

/**
* Custom passthrough(pt) option method.
*/
export interface RipplePassThroughMethodOptions {
props: RippleProps;
}

/**
* Custom passthrough(pt) options.
* @see {@link RippleProps.pt}
*/
export interface RipplePassThroughOptions {
/**
* Uses to pass attributes to the root's DOM element.
*/
root?: RipplePassThroughType<React.HTMLAttributes<HTMLDivElement>>;
}

/**
* Defines valid properties in Ripple component.
Expand All @@ -24,6 +46,16 @@ export interface RippleProps {
* @defaultValue false
*/
unstyled?: boolean;
/**
* Uses to pass attributes to DOM elements inside the component.
* @type {RipplePassThroughOptions}
*/
pt?: RipplePassThroughOptions;
/**
* Used to configure passthrough(pt) options of the component.
* @type {PassThroughOptions}
*/
ptOptions?: PassThroughOptions;
}

/**
Expand Down
6 changes: 3 additions & 3 deletions components/lib/virtualscroller/virtualscroller.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -514,17 +514,17 @@ export declare class VirtualScroller extends React.Component<VirtualScrollerProp
public scrollTo(options: VirtualScrollerOptionsType): void;
/**
* Scroll to move to a specific item.
* @param {number} index - Index of item according to orientation mode.
* @param {number | number[]} index - Index of item according to orientation mode.
* @param {'auto' | 'smooth'} behavior - Behavior of scroll, valid values are 'auto' and 'smooth'
*/
public scrollToIndex(index: number | number[], behavior?: 'auto' | 'smooth'): void;
/**
* It is used to move the specified index into the view. It is a method that will usually be needed when keyboard support is added to the virtualScroller component.
* @param {number} index - Index of item according to orientation mode.
* @param {number | number[]} index - Index of item according to orientation mode.
* @param {'to-start' | 'to-end'} to - Defines the location of the item in view, valid values are 'to-start' and 'to-end'.
* @param {'auto' | 'smooth'} behavior - Behavior of scroll, valid values are 'auto' and 'smooth'
*/
public scrollInView(index: number | number[], to: 'to-start' | 'to-end', behavior?: 'auto' | 'smooth'): void;
public scrollInView(index: number | number[], to?: 'to-start' | 'to-end', behavior?: 'auto' | 'smooth'): void;
/**
* Returns the range of items added to the DOM.
*/
Expand Down

0 comments on commit daf5acc

Please sign in to comment.