planning
All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 35s

This commit is contained in:
2024-10-14 09:15:30 +02:00
parent bcba00a730
commit 6e64e138e2
21059 changed files with 2317811 additions and 1 deletions

View File

@@ -0,0 +1,13 @@
import { CustomScrollBehaviorCallback, Options as BaseOptions, ScrollBehavior } from './types';
export interface StandardBehaviorOptions extends BaseOptions {
behavior?: ScrollBehavior;
}
export interface CustomBehaviorOptions<T> extends BaseOptions {
behavior: CustomScrollBehaviorCallback<T>;
}
export interface Options<T = any> extends BaseOptions {
behavior?: ScrollBehavior | CustomScrollBehaviorCallback<T>;
}
declare function scrollIntoView<T>(target: Element, options: CustomBehaviorOptions<T>): T;
declare function scrollIntoView(target: Element, options?: Options | boolean): void;
export default scrollIntoView;

View File

@@ -0,0 +1,19 @@
export type ScrollBehavior = 'auto' | 'smooth';
export type ScrollLogicalPosition = 'start' | 'center' | 'end' | 'nearest';
export type ScrollMode = 'always' | 'if-needed';
export type SkipOverflowHiddenElements = boolean;
export interface Options {
block?: ScrollLogicalPosition;
inline?: ScrollLogicalPosition;
scrollMode?: ScrollMode;
boundary?: CustomScrollBoundary;
skipOverflowHiddenElements?: SkipOverflowHiddenElements;
}
export type CustomScrollBoundaryCallback = (parent: Element) => boolean;
export type CustomScrollBoundary = Element | CustomScrollBoundaryCallback | null;
export interface CustomScrollAction {
el: Element;
top: number;
left: number;
}
export type CustomScrollBehaviorCallback<T> = (actions: CustomScrollAction[]) => T;