import type { OverlayScrollbars, PartialOptions, EventListeners } from 'overlayscrollbars'; import type { HTMLAttributes, SvelteHTMLElements } from 'svelte/elements'; import type { Component, ComponentProps, Snippet } from 'svelte'; export type ValidSvelteHTMLTags = Extract; export type ValidSvelteComponent = Component<{ children?: Snippet; [prop: string | number | symbol]: any; }, { getElement: () => SvelteHTMLElementFromHtmlAttributes | undefined; [prop: string | number | symbol]: any; }>; export type ValidSvelteElement = ValidSvelteHTMLTags | ValidSvelteComponent; export type ValidSvelteElementProps = T extends ValidSvelteComponent ? ComponentProps : T extends keyof SvelteHTMLElements ? SvelteHTMLElements[T] : {}; export type ValidSvelteHTMLElement = T extends ValidSvelteComponent ? Exclude['getElement']>, undefined> : T extends keyof SvelteHTMLElements ? SvelteHTMLElementFromHtmlAttributes : HTMLElement; type SvelteHTMLElementFromHtmlAttributes = E extends HTMLAttributes ? (EventTarget extends El ? HTMLElement : El) : HTMLElement; export type OverlayScrollbarsComponentProps = ValidSvelteElementProps & { /** Tag of the root element. */ element?: T; /** OverlayScrollbars options. */ options?: PartialOptions | false | null; /** OverlayScrollbars events. */ events?: EventListeners | false | null; /** Whether to defer the initialization to a point in time when the browser is idle. (or to the next frame if `window.requestIdleCallback` is not supported) */ defer?: boolean | IdleRequestOptions; }; export interface OverlayScrollbarsComponentRef { /** Returns the OverlayScrollbars instance or null if not initialized. */ osInstance(): OverlayScrollbars | null; /** Returns the root element. */ getElement(): ValidSvelteHTMLElement | null; } export {};