@petit-kit/scoped 0.0.6-beta.0 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts DELETED
@@ -1,613 +0,0 @@
1
- export * from './plugins';
2
- /**
3
- * Scope - A lightweight, framework-agnostic library for building web components
4
- *
5
- * @module scope
6
- * @version 0.0.5
7
- * @description Provides a minimal abstraction over Custom Elements API, making it easy
8
- * to create reusable, encapsulated components with reactive state, lifecycle hooks,
9
- * and a simple template-based rendering system.
10
- *
11
- * @example Basic component
12
- * ```javascript
13
- * import { define } from './scope.js';
14
- *
15
- * define("c-slider", {
16
- * props: { value: { type: Number, default: 0 } }
17
- * }, ({ link, emit, actions, host }) => {
18
- * link("value", "value")
19
- *
20
- * actions.handleChange = event => {
21
- * host.updateState({ value: event.target.valueAsNumber })
22
- * emit("on-change", { value: event.target.valueAsNumber })
23
- * }
24
- *
25
- * return () => `
26
- * <div>
27
- * <input
28
- * type="range"
29
- * min="0" max="100" step="1"
30
- * bind:value="value"
31
- * on:input="handleChange"
32
- * />
33
- * <c-number ref="number" bind:value="value"></c-number>
34
- * </div>
35
- * `
36
- * })
37
-
38
- * ```
39
- *
40
- * @example Component with shadow DOM
41
- * ```javascript
42
- * define('styled-button', {
43
- * shadow: true,
44
- * styles: 'button { background: blue; color: white; }'
45
- * }, () => {
46
- * return () => '<button>Click me</button>';
47
- * });
48
- * ```
49
- *
50
- * @see {@link ComponentContext} for available context properties
51
- * @see {@link ComponentOptions} for configuration options
52
- */
53
- /**
54
- * Library version.
55
- *
56
- * @constant {string}
57
- */
58
- declare const SCOPE_VERSION = "0.0.5";
59
- /**
60
- * Logs version and repository info for @petit-kit/scoped.
61
- * Useful for debugging or confirming library presence.
62
- */
63
- export declare const happy: () => void;
64
- /**
65
- * Supported prop types for type checking and parsing
66
- *
67
- * @typedef {StringConstructor|NumberConstructor|BooleanConstructor|ObjectConstructor|ArrayConstructor} PropType
68
- */
69
- export type PropType = StringConstructor | NumberConstructor | BooleanConstructor | ObjectConstructor | ArrayConstructor;
70
- /**
71
- * Definition for a single prop, including type, default value, and reflection behavior
72
- *
73
- * @template T - The type of the prop value
74
- * @interface PropDefinition
75
- *
76
- * @example
77
- * ```typescript
78
- * const propDef: PropDefinition<number> = {
79
- * type: Number,
80
- * default: 0,
81
- * reflect: true
82
- * };
83
- * ```
84
- */
85
- export interface PropDefinition<T = any> {
86
- /**
87
- * Type constructor for parsing the prop value from attributes
88
- * @type {PropType}
89
- */
90
- type?: PropType;
91
- /**
92
- * Default value if prop is not provided
93
- * @type {T}
94
- */
95
- default?: T;
96
- /**
97
- * Whether to reflect prop changes back to HTML attributes
98
- * @type {boolean}
99
- * @default false
100
- */
101
- reflect?: boolean;
102
- }
103
- /**
104
- * Props definition object mapping prop names to their definitions or default values
105
- *
106
- * @typedef {Record<string, PropDefinition | any>} PropsDefinition
107
- *
108
- * @example
109
- * ```typescript
110
- * const props: PropsDefinition = {
111
- * count: { type: Number, default: 0 },
112
- * name: { type: String, default: 'World' },
113
- * active: { type: Boolean, default: false }
114
- * };
115
- * ```
116
- */
117
- export type PropsDefinition = Record<string, PropDefinition | any>;
118
- /**
119
- * Plugin for extending the component context.
120
- */
121
- export type ComponentPlugin<Ext extends Record<string, any> = {}> = {
122
- /** Optional plugin name for debugging */
123
- name?: string;
124
- /**
125
- * Extend the component context with new capabilities.
126
- */
127
- extend: (context: ComponentContextBase<any, any, any, any>, host: ComponentHost) => Ext;
128
- };
129
- /**
130
- * Options for component definition
131
- *
132
- * @interface ComponentOptions
133
- *
134
- * @example
135
- * ```typescript
136
- * const options: ComponentOptions = {
137
- * props: { count: { type: Number, default: 0 } },
138
- * shadow: true,
139
- * styles: 'div { color: red; }'
140
- * };
141
- * ```
142
- */
143
- export interface ComponentOptions<Plugins extends readonly ComponentPlugin<any>[] = ComponentPlugin<any>[]> {
144
- /**
145
- * Prop definitions for the component
146
- * @type {PropsDefinition}
147
- */
148
- props?: PropsDefinition;
149
- /**
150
- * Whether to use Shadow DOM (default: false, uses light DOM)
151
- * @type {boolean}
152
- * @default false
153
- */
154
- shadow?: boolean;
155
- /**
156
- * CSS styles to inject into document head (for shadow DOM components)
157
- * @type {string}
158
- */
159
- styles?: string;
160
- /**
161
- * Plugins that extend the component context.
162
- * @type {Plugins}
163
- */
164
- plugins?: Plugins;
165
- }
166
- /**
167
- * Methods available on the component host element
168
- *
169
- * @interface ComponentHost
170
- *
171
- * @example
172
- * ```typescript
173
- * define('my-component', {}, ({ host }) => {
174
- * host.setState({ count: 5 });
175
- * host.updateState({ scrollY: 100 });
176
- * host.setProps({ title: 'New Title' });
177
- * });
178
- * ```
179
- */
180
- export interface ComponentHost {
181
- /**
182
- * Update state and trigger full re-render
183
- * @method setState
184
- * @param {Partial<State>} partial - Partial state object to merge
185
- * @template State
186
- *
187
- * @example
188
- * ```typescript
189
- * host.setState({ count: 5, name: 'Updated' });
190
- * ```
191
- */
192
- setState: <State>(partial: Partial<State>) => void;
193
- /**
194
- * Update state without re-render (triggers effects only)
195
- * @method updateState
196
- * @param {Partial<State>} partial - Partial state object to merge
197
- * @template State
198
- *
199
- * @example
200
- * ```typescript
201
- * // Update scroll position without re-rendering
202
- * host.updateState({ scrollY: window.scrollY });
203
- * ```
204
- */
205
- updateState: <State>(partial: Partial<State>) => void;
206
- /**
207
- * Update props programmatically
208
- * @method setProps
209
- * @param {Partial<Props>} partial - Partial props object to merge
210
- * @template Props
211
- *
212
- * @example
213
- * ```typescript
214
- * // Pass large data (recommended for objects/arrays)
215
- * element.setProps({ data: largeArray, config: complexObject });
216
- * ```
217
- */
218
- setProps: <Props>(partial: Partial<Props>) => void;
219
- /**
220
- * Schedule a partial update (effects only)
221
- * @method scheduleUpdate
222
- *
223
- * @example
224
- * ```typescript
225
- * host.scheduleUpdate(); // Runs effects on next animation frame
226
- * ```
227
- */
228
- scheduleUpdate: () => void;
229
- /**
230
- * Force an update (full or partial render)
231
- * @method update
232
- * @param {boolean} fullRender - Whether to perform full render or effects only
233
- *
234
- * @example
235
- * ```typescript
236
- * host.update(true); // Full render
237
- * host.update(false); // Effects only
238
- * ```
239
- */
240
- update: (fullRender: boolean) => void;
241
- /**
242
- * Force a full re-render even if template is unchanged
243
- * @method forceRender
244
- *
245
- * @example
246
- * ```typescript
247
- * host.forceRender(); // Forces DOM update even if template string matches
248
- * ```
249
- */
250
- forceRender: () => void;
251
- /**
252
- * Clean up component and run destroy callbacks
253
- * @method destroy
254
- *
255
- * @example
256
- * ```typescript
257
- * host.destroy(); // Cleans up effects, events, and runs onDestroy hooks
258
- * ```
259
- */
260
- destroy: () => void;
261
- /**
262
- * Remove the component from the DOM
263
- * @method remove
264
- *
265
- * @example
266
- * ```typescript
267
- * host.remove(); // Removes element and triggers cleanup via disconnectedCallback
268
- * ```
269
- */
270
- remove: () => void;
271
- }
272
- /**
273
- * Context object passed to the setup function, providing access to component APIs
274
- *
275
- * @template Props - Type of component props
276
- * @template State - Type of component state
277
- * @template Actions - Type of action methods
278
- * @template Refs - Type of DOM refs
279
- * @interface ComponentContext
280
- *
281
- * @example Basic usage
282
- * ```typescript
283
- * define('counter', {}, ({ props, state, actions, host }) => {
284
- * state.count = 0;
285
- * actions.increment = () => host.setState({ count: state.count + 1 });
286
- * return () => `<div>${state.count}</div>`;
287
- * });
288
- * ```
289
- *
290
- * @example With lifecycle hooks
291
- * ```typescript
292
- * define('component', {}, ({ onMount, onDestroy, effect }) => {
293
- * onMount(() => console.log('Mounted'));
294
- * onDestroy(() => console.log('Destroyed'));
295
- * effect((deps) => {
296
- * const timer = setInterval(() => {}, 1000);
297
- * return () => clearInterval(timer);
298
- * }, []);
299
- * return () => '<div>Hello</div>';
300
- * });
301
- * ```
302
- *
303
- * @see {@link ComponentHost} for host methods
304
- * @see {@link ComponentOptions} for component configuration
305
- */
306
- export interface ComponentContextBase<Props = Record<string, any>, State = Record<string, any>, Actions = Record<string, Function>, Refs = Record<string, HTMLElement | HTMLElement[]>> {
307
- /**
308
- * Component props (read-only, updated via attributes or setProps)
309
- * @type {Props}
310
- * @readonly
311
- */
312
- props: Props;
313
- /**
314
- * Component state (mutable, updated via setState/updateState)
315
- * @type {State}
316
- */
317
- state: State;
318
- /**
319
- * Action methods that can be called from event handlers
320
- * @type {Actions}
321
- *
322
- * @example
323
- * ```typescript
324
- * actions.handleClick = () => { /* ... *\/ };
325
- * // Use in template: <button on:click="handleClick">
326
- * ```
327
- */
328
- actions: Actions;
329
- /**
330
- * DOM element references (populated after render)
331
- * @type {Refs}
332
- *
333
- * @example
334
- * ```typescript
335
- * // In template: <div ref="myDiv"></div>
336
- * // Access: refs.myDiv
337
- * ```
338
- */
339
- refs: Refs;
340
- /**
341
- * Emit custom events that bubble up the DOM tree
342
- * @method emit
343
- * @param {string} name - Event name
344
- * @param {any} [detail] - Optional event detail data
345
- *
346
- * @example
347
- * ```typescript
348
- * emit('item-clicked', { id: 123, name: 'Item' });
349
- * ```
350
- */
351
- emit: (name: string, detail?: any) => void;
352
- /**
353
- * Listen to a custom event from a given target
354
- * @method listen
355
- * @param {EventTarget} target - Target to attach the listener to
356
- * @param {string} name - Custom event name to listen for
357
- * @param {function(CustomEvent): void} handler - Event handler
358
- * @param {AddEventListenerOptions} [options] - Listener options
359
- * @returns {() => void} Cleanup function to remove the listener
360
- *
361
- * @example
362
- * ```typescript
363
- * const cleanup = listen(window, 'theme-change', (e) => {
364
- * console.log(e.detail);
365
- * });
366
- * ```
367
- */
368
- listen: (target: EventTarget, name: string, handler: (event: CustomEvent<any>) => void, options?: AddEventListenerOptions) => () => void;
369
- /**
370
- * Update state without triggering a re-render (triggers effects only)
371
- * @method updateState
372
- * @param {Partial<State>} partial - Partial state object to merge
373
- *
374
- * @example
375
- * ```typescript
376
- * updateState({ count: 5 }); // Updates state, runs effects, but doesn't re-render
377
- * ```
378
- */
379
- updateState: (partial: Partial<State>) => void;
380
- /**
381
- * The component host element with all host methods
382
- * @type {HTMLElement & ComponentHost}
383
- *
384
- * @see {@link ComponentHost}
385
- */
386
- host: HTMLElement & ComponentHost;
387
- /**
388
- * Register callback to run after component is mounted
389
- * @method onMount
390
- * @param {function(): void} callback - Callback function
391
- */
392
- onMount: (callback: () => void) => void;
393
- /**
394
- * Register callback to run when component is destroyed
395
- * @method onDestroy
396
- * @param {function(): void} callback - Callback function
397
- */
398
- onDestroy: (callback: () => void) => void;
399
- /**
400
- * Register callback to run after each update/re-render
401
- * @method onUpdate
402
- * @param {function(): void} callback - Callback function
403
- */
404
- onUpdate: (callback: () => void) => void;
405
- /**
406
- * Register callback to run before each update/re-render
407
- * @method onBeforeUpdate
408
- * @param {function(): void} callback - Callback function
409
- */
410
- onBeforeUpdate: (callback: () => void) => void;
411
- /**
412
- * Register callback to run only on the first update (after mount)
413
- * @method onFirstUpdate
414
- * @param {function(): void} callback - Callback function
415
- */
416
- onFirstUpdate: (callback: () => void) => void;
417
- /**
418
- * Register callback to run when props change
419
- * @method onPropsChanged
420
- * @param {function(string, any, any): void} callback - Callback function
421
- *
422
- * @example
423
- * ```typescript
424
- * onPropsChanged((propName, oldValue, newValue) => {
425
- * console.log(`${propName} changed from ${oldValue} to ${newValue}`);
426
- * });
427
- * ```
428
- */
429
- onPropsChanged: (callback: (propName: string, oldValue: any, newValue: any) => void) => void;
430
- /**
431
- * Link a prop and a state key (two-way, no extra render)
432
- *
433
- * Updates state when the prop changes, and updates the prop/attribute
434
- * when the state changes without triggering a render. Attribute
435
- * reflection is forced even if the prop is not marked reflect: true.
436
- *
437
- * @method link
438
- * @param {string} propName - Prop name to link
439
- * @param {string} [stateKey] - State key to link (defaults to propName)
440
- *
441
- * @example
442
- * ```typescript
443
- * link('value'); // state.value <-> props.value
444
- * link('title', 'text'); // state.text <-> props.title
445
- * ```
446
- */
447
- link: (propName: string, stateKey?: string) => void;
448
- /**
449
- * Register effect function that runs after renders (with optional cleanup)
450
- * @method effect
451
- * @param {function(any[]): (void|function())} fn - Effect function that can return cleanup
452
- * @param {any[] | (() => any[])} [deps] - Optional dependency array or deps getter
453
- * @returns {() => void} Cleanup function to remove the effect
454
- *
455
- * @example
456
- * ```typescript
457
- * const cleanup = effect((deps) => {
458
- * const timer = setInterval(() => {}, 1000);
459
- * return () => clearInterval(timer); // Cleanup function
460
- * }, []);
461
- * ```
462
- */
463
- effect: (fn: EffectFn, deps?: any[] | (() => any[])) => () => void;
464
- /**
465
- * Register a computed value that updates before renders.
466
- *
467
- * @method computed
468
- * @param {function(any[]): *} getter - Function that returns the computed value
469
- * @param {any[] | (() => any[])} [deps] - Optional dependency array or deps getter
470
- * @returns {() => T} Getter for the current computed value
471
- *
472
- * @example
473
- * ```typescript
474
- * const fullName = computed((deps) => `${props.first} ${state.last}`, () => [props.first, state.last]);
475
- * return () => `<div>${fullName()}</div>`;
476
- * ```
477
- */
478
- computed: <T>(getter: ComputedGetter<T>, deps?: ComputedDeps) => () => T;
479
- /**
480
- * Set up event delegation for dynamic content
481
- * @method delegate
482
- * @param {string} eventType - The event type (e.g., 'click', 'input')
483
- * @param {string} selector - CSS selector to match target elements
484
- * @param {function(Event, Element): void} handler - Handler function
485
- * @returns {() => void} Cleanup function to remove the delegation
486
- *
487
- * @example
488
- * ```typescript
489
- * const cleanup = delegate('click', '.item', (e, target) => {
490
- * console.log('Item clicked:', target);
491
- * });
492
- * ```
493
- */
494
- delegate: (eventType: string, selector: string, handler: (event: Event, target: Element) => void) => () => void;
495
- }
496
- /**
497
- * Component context including plugin-provided extensions.
498
- */
499
- export type ComponentContext<Props = Record<string, any>, State = Record<string, any>, Actions = Record<string, Function>, Refs = Record<string, HTMLElement | HTMLElement[]>, Ext = {}> = ComponentContextBase<Props, State, Actions, Refs> & Ext;
500
- type UnionToIntersection<U> = (U extends any ? (arg: U) => void : never) extends (arg: infer I) => void ? I : never;
501
- type PluginExtensions<Plugins extends readonly ComponentPlugin<any>[]> = UnionToIntersection<Plugins[number] extends ComponentPlugin<infer Ext> ? Ext : {}>;
502
- /**
503
- * Setup function that receives component context and returns a render function
504
- *
505
- * @template Props - Type of component props
506
- * @template State - Type of component state
507
- * @template Actions - Type of action methods
508
- * @template Refs - Type of DOM refs
509
- * @typedef {function} SetupFunction
510
- * @param {ComponentContext<Props, State, Actions, Refs, Ext>} context - Component context
511
- * @returns {() => string} Render function that returns HTML template string
512
- *
513
- * @example
514
- * ```typescript
515
- * const setup: SetupFunction = ({ props, state, actions }) => {
516
- * state.count = 0;
517
- * actions.increment = () => state.count++;
518
- * return () => `<div>Count: ${state.count}</div>`;
519
- * };
520
- * ```
521
- *
522
- * @see {@link ComponentContext}
523
- */
524
- export type SetupFunction<Props = Record<string, any>, State = Record<string, any>, Actions = Record<string, Function>, Refs = Record<string, HTMLElement | HTMLElement[]>, Ext = {}> = (context: ComponentContext<Props, State, Actions, Refs, Ext>) => () => string;
525
- /**
526
- * Information about a delegated event handler
527
- */
528
- export type DelegatedEventInfo = {
529
- /** The event type (e.g., 'click', 'input') */
530
- eventType: string;
531
- /** CSS selector to match elements */
532
- selector: string;
533
- /** The actual event listener attached to the root */
534
- listener: (e: Event) => void;
535
- /** Set of handler functions registered for this delegation */
536
- handlers: Set<(e: Event, target: Element) => void>;
537
- };
538
- export type EffectDeps = any[] | (() => any[]);
539
- export type ComputedDeps = any[] | (() => any[]);
540
- export type EffectFn = (deps?: any[]) => void | (() => void);
541
- export type ComputedGetter<T = any> = (deps?: any[]) => T;
542
- export type EffectRecord = {
543
- fn: EffectFn;
544
- deps?: EffectDeps;
545
- prevDeps?: any[];
546
- cleanup?: () => void;
547
- };
548
- export type ComputedRecord<T = any> = {
549
- getter: ComputedGetter<T>;
550
- deps?: ComputedDeps;
551
- prevDeps?: any[];
552
- value: T;
553
- };
554
- /**
555
- * Defines a new custom element component
556
- *
557
- * @function define
558
- * @template Props - Type of component props
559
- * @template State - Type of component state
560
- * @template Actions - Type of action methods
561
- * @template Refs - Type of DOM refs
562
- *
563
- * @param {string} tagName - The custom element tag name (must contain a hyphen, e.g., 'my-component')
564
- * @param {ComponentOptions} [options={}] - Component configuration options
565
- * @param {SetupFunction<Props, State, Actions, Refs, PluginExtensions<Plugins>>} [setup] - Optional setup function that receives context and returns render function
566
- * @returns {Function} The custom element class constructor
567
- *
568
- * @throws {Error} If tagName doesn't contain a hyphen (required by Custom Elements spec)
569
- * @throws {Error} If component is already defined (logs warning instead of throwing)
570
- *
571
- * @example Basic component
572
- * ```javascript
573
- * define('my-counter', {
574
- * props: { initialValue: { type: Number, default: 0 } }
575
- * }, ({ props, state, actions, host }) => {
576
- * state.count = props.initialValue;
577
- * actions.increment = () => host.setState({ count: state.count + 1 });
578
- * return () => `<div>Count: ${state.count}</div>`;
579
- * });
580
- * ```
581
- *
582
- * @example Component with shadow DOM
583
- * ```javascript
584
- * define('styled-button', {
585
- * shadow: true,
586
- * styles: 'button { background: blue; color: white; }'
587
- * }, () => {
588
- * return () => '<button>Click me</button>';
589
- * });
590
- * ```
591
- *
592
- * @example Component with TypeScript types
593
- * ```typescript
594
- * interface MyProps { count: number }
595
- * interface MyState { value: string }
596
- * interface MyActions { handleClick: () => void }
597
- *
598
- * define<MyProps, MyState, MyActions>('typed-component', {
599
- * props: { count: { type: Number, default: 0 } }
600
- * }, ({ props, state, actions }) => {
601
- * state.value = `Count: ${props.count}`;
602
- * actions.handleClick = () => console.log('clicked');
603
- * return () => `<div>${state.value}</div>`;
604
- * });
605
- * ```
606
- *
607
- * @see {@link ComponentContext} for available context properties
608
- * @see {@link ComponentOptions} for configuration options
609
- * @see {@link SetupFunction} for setup function signature
610
- */
611
- declare function define<Props = Record<string, any>, State = Record<string, any>, Actions = Record<string, Function>, Refs = Record<string, HTMLElement | HTMLElement[]>, Plugins extends readonly ComponentPlugin<any>[] = []>(tagName: string, options?: ComponentOptions<Plugins>, setup?: SetupFunction<Props, State, Actions, Refs, PluginExtensions<Plugins>>): typeof HTMLElement;
612
- export { define, SCOPE_VERSION };
613
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index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.ts","sourceRoot":"","sources":["../../../src/plugins/content/index.ts"],"names":[],"mappings":""}
@@ -1,8 +0,0 @@
1
- import type { ComponentPlugin } from '../../index';
2
- export type DeviceControls = {
3
- onMediaQuery: (query: string, handler: (matches: boolean, event: MediaQueryListEvent | null) => void, options?: {
4
- immediate?: boolean;
5
- }) => () => void;
6
- };
7
- export declare const devicePlugin: () => ComponentPlugin<DeviceControls>;
8
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/device/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAwB,MAAM,aAAa,CAAC;AAEzE,MAAM,MAAM,cAAc,GAAG;IAS3B,YAAY,EAAE,CACZ,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,mBAAmB,GAAG,IAAI,KAAK,IAAI,EACtE,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,KAC9B,MAAM,IAAI,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,YAAY,QAAO,eAAe,CAAC,cAAc,CA6C5D,CAAC"}
@@ -1,11 +0,0 @@
1
- export { devicePlugin, type DeviceControls } from './device';
2
- export { morphPlugin, type IdiomorphAPI, type IdiomorphGetter, type MorphControls, type MorphOptions, } from './morph';
3
- export { windowPlugin, type WindowControls } from './window';
4
- export { inViewPlugin, type InViewControls, type InViewHandler, type InViewOptions, } from './inview';
5
- export { lenisPlugin, type LenisControls, type LenisGetter, type LenisInstance, type LenisScrollEvent, type LenisScrollHandler, } from './lenis';
6
- export { timerPlugin, type TimerControls, type TimerIntervalHandle, type TimerRafCallback, type TimerRafUnsubscribe, type TimerTimeoutHandle, } from './timer';
7
- export { mousePlugin, type MouseControls, type MouseEventHandler, type MouseUnsubscribe, type MouseWheelHandler, } from './mouse';
8
- export { pointerPlugin, type PointerControls } from './pointer';
9
- export { lerpPlugin, type LerpControls } from './lerp';
10
- export { springPlugin, type SpringControls } from './spring';
11
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,EACL,WAAW,EACX,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,YAAY,GAClB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,EACL,YAAY,EACZ,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,aAAa,GACnB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,GACxB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GACxB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,GACvB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,aAAa,EAAE,KAAK,eAAe,EAAE,MAAM,WAAW,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC"}