Refactor #3879 - For ScrollTop

This commit is contained in:
Tuğçe Küçükoğlu 2023-04-21 16:42:00 +03:00
parent 1af654c740
commit 9dd6301979
3 changed files with 59 additions and 2 deletions

View file

@ -10,6 +10,49 @@
import { VNode } from 'vue';
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
export declare type ScrollTopPassThroughOptionType = ScrollTopPassThroughAttributes | ((options: ScrollTopPassThroughMethodOptions) => ScrollTopPassThroughAttributes) | null | undefined;
/**
* Custom passthrough(pt) option method.
*/
export interface ScrollTopPassThroughMethodOptions {
props: ScrollTopProps;
state: ScrollTopState;
}
/**
* Custom passthrough(pt) options.
* @see {@link ScrollTopProps.pt}
*/
export interface ScrollTopPassThroughOptions {
/**
* Uses to pass attributes to the root's DOM element.
*/
root?: ScrollTopPassThroughOptionType;
/**
* Uses to pass attributes to the icon's DOM element.
*/
icon?: ScrollTopPassThroughOptionType;
}
/**
* Custom passthrough attributes for each DOM elements
*/
export interface ScrollTopPassThroughAttributes {
[key: string]: any;
}
/**
* Defines current inline state in ScrollTop component.
*/
export interface ScrollTopState {
/**
* Current visible state as a boolean.
* @defaultValue false
*/
visible: boolean;
}
/**
* Defines valid properties in ScrollTop component.
*/
@ -34,6 +77,11 @@ export interface ScrollTopProps {
* @defaultValue smooth
*/
behavior?: string | undefined;
/**
* Uses to pass attributes to DOM elements inside the component.
* @type {ScrollTopPassThroughOptions}
*/
pt?: ScrollTopPassThroughOptions;
}
/**