This repository has been archived on 2026-04-03. You can view files and clone it, but cannot push or open issues or pull requests.
Nico e2667f8e12 Initial nyx project — fork of hermes-frontend
Forked from hermes-frontend, stripped openclaw/bun specifics:
- Auth tokens: openclaw_session -> nyx_session
- Vite proxy: localhost:3003 -> localhost:8000 (assay)
- Prod WS: wss://assay.loop42.de/ws
- Workspace paths: removed openclaw-specific paths
- Added missing deps: @heroicons/vue, overlayscrollbars-vue
- Branding: title -> nyx

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 20:23:27 +02:00

49 lines
1.6 KiB
TypeScript

//#region src/index.d.ts
interface DebounceOptions {
/**
Call the `fn` on the [leading edge of the timeout](https://css-tricks.com/debouncing-throttling-explained-examples/#article-header-id-1).
Meaning immediately, instead of waiting for `wait` milliseconds.
@default false
*/
readonly leading?: boolean;
/**
Call the `fn` on trailing edge with last used arguments. Result of call is from previous call.
@default true
*/
readonly trailing?: boolean;
}
type DebouncedReturn<ArgumentsT extends unknown[], ReturnT> = ((...args: ArgumentsT) => Promise<ReturnT>) & {
/**
* Cancel pending function call
*/
cancel: () => void;
/**
* Immediately invoke pending function call
*/
flush: () => Promise<ReturnT> | undefined;
/**
* Get pending function call
*/
isPending: () => boolean;
};
/**
Debounce functions
@param fn - Promise-returning/async function to debounce.
@param wait - Milliseconds to wait before calling `fn`. Default value is 25ms
@returns A function that delays calling `fn` until after `wait` milliseconds have elapsed since the last time it was called.
@example
```
import { debounce } from 'perfect-debounce';
const expensiveCall = async input => input;
const debouncedFn = debounce(expensiveCall, 200);
for (const number of [1, 2, 3]) {
console.log(await debouncedFn(number));
}
//=> 1
//=> 2
//=> 3
```
*/
declare function debounce<ArgumentsT extends unknown[], ReturnT>(fn: (...args: ArgumentsT) => PromiseLike<ReturnT> | ReturnT, wait?: number, options?: DebounceOptions): DebouncedReturn<ArgumentsT, ReturnT>;
//#endregion
export { DebounceOptions, DebouncedReturn, debounce };