UNPKG

edit-on-slate

Version:

Slate 기반의 직관적이고 강력한 리액트 텍스트 에디터 라이브러리

29 lines (26 loc) 1.13 kB
// 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