builder-settings-types 0.0.461 → 0.0.462

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 CHANGED
@@ -38,4 +38,5 @@ export * from './groups/margin-setting-group/marginSettingGroup';
38
38
  export * from './groups/background-setting-set/backgroundSettingsSet';
39
39
  export * from './groups/image-setting-set/imageSettingSet';
40
40
  export * from './utils/settingsTypes';
41
+ export * from './utils/debounce';
41
42
  export * from './types/index';
@@ -14,6 +14,7 @@ export interface NumberSettingsProps extends SettingProps<number> {
14
14
  export declare class NumberSetting extends Setting<number, NumberSettingsProps> {
15
15
  inputType: InputTypes;
16
16
  private inputElement;
17
+ private debouncedSetValue;
17
18
  mobileValue?: number;
18
19
  constructor(props: NumberSettingsProps);
19
20
  draw(): HTMLElement;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Creates a debounced function that delays invoking the provided function
3
+ * until after the specified delay (in milliseconds) has elapsed since
4
+ * the last time it was invoked.
5
+ *
6
+ * @param fn - The function to debounce
7
+ * @param ms - The number of milliseconds to delay
8
+ * @returns A debounced function with a cancel method
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * const debouncedFn = debounce((value: string) => {
13
+ * console.log(value)
14
+ * }, 300)
15
+ *
16
+ * debouncedFn('hello') // Will execute after 300ms
17
+ * debouncedFn('world') // Cancels previous call, will execute after 300ms
18
+ * debouncedFn.cancel() // Cancels any pending execution
19
+ * ```
20
+ */
21
+ export declare function debounce<T extends (...args: any[]) => any>(fn: T, ms: number): ((...args: Parameters<T>) => void) & {
22
+ cancel: () => void;
23
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "builder-settings-types",
3
3
  "description": "builder settings",
4
- "version": "0.0.461",
4
+ "version": "0.0.462",
5
5
  "type": "module",
6
6
  "main": "dist/builder-settings-types.cjs.js",
7
7
  "module": "dist/builder-settings-types.es.js",