UNPKG

1.25 kBTypeScriptView Raw
1import { TW } from 'twind';
2export * from 'twind';
3
4/**
5 * [[include:src/observe/README.md]]
6 *
7 * @packageDocumentation
8 * @module twind/observe
9 */
10
11/**
12 * Options for {@link createObserver}.
13 */
14interface ShimConfiguration {
15 /**
16 * Custom {@link twind.tw | tw} instance to use (default: {@link twind.tw}).
17 */
18 tw?: TW;
19}
20/** Provides the ability to watch for changes being made to the DOM tree. */
21interface TwindObserver {
22 /**
23 * Stops observer from observing any mutations.
24 */
25 disconnect(): TwindObserver;
26 /**
27 * Observe an additional element.
28 */
29 observe(target: Node): TwindObserver;
30}
31/**
32 * Creates a new {@link TwindObserver}.
33 *
34 * @param options to use
35 */
36declare const createObserver: ({ tw }?: ShimConfiguration) => TwindObserver;
37/**
38 * Creates a new {@link TwindObserver} and {@link TwindObserver.observe | start observing} the passed target element.
39 * @param this to bind
40 * @param target to shim
41 * @param config to use
42 */
43declare function observe(this: ShimConfiguration | undefined | void, target: Node, config?: ShimConfiguration | undefined | void): TwindObserver;
44
45export { ShimConfiguration, TwindObserver, createObserver, observe };
46//# sourceMappingURL=observe.d.ts.map