mirror of
https://github.com/tenrok/OverlayScrollbars.git
synced 2026-05-31 06:14:08 +03:00
improve plugin docu
This commit is contained in:
@@ -86,7 +86,7 @@ export type Initialization = {
|
||||
};
|
||||
|
||||
/** The initialization target element. */
|
||||
export type InitializationTargetElement = HTMLElement | HTMLTextAreaElement;
|
||||
export type InitializationTargetElement = HTMLElement; // | HTMLTextAreaElement;
|
||||
|
||||
/**
|
||||
* The initialization target object.
|
||||
|
||||
@@ -1,9 +1,19 @@
|
||||
import { each, isArray, keys, push } from '~/support';
|
||||
import type { OverlayScrollbars, OverlayScrollbarsStatic } from '~/overlayscrollbars';
|
||||
|
||||
/** Describes the instance of a OverlayScrollbars plugin. */
|
||||
export type PluginInstance =
|
||||
/** A `static` plugin. Its neither bound to a instance nor to the static object. */
|
||||
| Record<string, unknown>
|
||||
/**
|
||||
* A plugin which is bound to either a instance or to the static object.
|
||||
* The function will be called multiple times. Once with the static object and each time a new instance is created.
|
||||
* The plugin then can add new methods or fields to thow objects.
|
||||
* These plugins should be side-effect free and deterministic. (same input produces same output)
|
||||
*/
|
||||
| ((staticObj?: OverlayScrollbarsStatic, instanceObj?: OverlayScrollbars) => void);
|
||||
|
||||
/** Describes a OverlayScrollbars plugin. */
|
||||
export type Plugin<T extends PluginInstance = PluginInstance> = {
|
||||
[pluginName: string]: T;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user