Files
NapCatQQ/.pnpm-store/v3/files/bb/e2422bcc043fe0bd3814ca2a18bd188313f823c4c2a071d9d8c5b0ef0ca0a684f0ab9433266039d71d622ee94c9ba2e1d1accabae4a3c39e516ac8c12ab1eb
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

29 lines
1.1 KiB
Plaintext

// Standard, based on CSSOM View spec
export type ScrollBehavior = 'auto' | 'smooth'
export type ScrollLogicalPosition = 'start' | 'center' | 'end' | 'nearest'
// This new option is tracked in this PR, which is the most likely candidate at the time: https://github.com/w3c/csswg-drafts/pull/1805
export type ScrollMode = 'always' | 'if-needed'
// New option that skips auto-scrolling all nodes with overflow: hidden set
// See FF implementation: https://hg.mozilla.org/integration/fx-team/rev/c48c3ec05012#l7.18
export type SkipOverflowHiddenElements = boolean
export interface Options {
block?: ScrollLogicalPosition
inline?: ScrollLogicalPosition
scrollMode?: ScrollMode
boundary?: CustomScrollBoundary
skipOverflowHiddenElements?: SkipOverflowHiddenElements
}
// Custom behavior, not in any spec
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