Add settings page for managing forecasting API key and URL via UI
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
cae411eae7
commit
1c411e402e
19809 changed files with 1962608 additions and 97 deletions
52
frontend/node_modules/es-toolkit/dist/function/throttle.d.ts
generated
vendored
Normal file
52
frontend/node_modules/es-toolkit/dist/function/throttle.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
//#region src/function/throttle.d.ts
|
||||
interface ThrottleOptions {
|
||||
/**
|
||||
* An optional AbortSignal to cancel the throttled function.
|
||||
*/
|
||||
signal?: AbortSignal;
|
||||
/**
|
||||
* An optional array specifying whether the function should be invoked on the leading edge, trailing edge, or both.
|
||||
* If `edges` includes "leading", the function will be invoked at the start of the delay period.
|
||||
* If `edges` includes "trailing", the function will be invoked at the end of the delay period.
|
||||
* If both "leading" and "trailing" are included, the function will be invoked at both the start and end of the delay period.
|
||||
* @default ["leading", "trailing"]
|
||||
*/
|
||||
edges?: Array<'leading' | 'trailing'>;
|
||||
}
|
||||
interface ThrottledFunction<F extends (...args: any[]) => void> {
|
||||
(...args: Parameters<F>): void;
|
||||
cancel: () => void;
|
||||
flush: () => void;
|
||||
}
|
||||
/**
|
||||
* Creates a throttled function that only invokes the provided function at most once
|
||||
* per every `throttleMs` milliseconds. Subsequent calls to the throttled function
|
||||
* within the wait time will not trigger the execution of the original function.
|
||||
*
|
||||
* @template F - The type of function.
|
||||
* @param func - The function to throttle.
|
||||
* @param throttleMs - The number of milliseconds to throttle executions to.
|
||||
* @returns A new throttled function that accepts the same parameters as the original function.
|
||||
*
|
||||
* @example
|
||||
* const throttledFunction = throttle(() => {
|
||||
* console.log('Function executed');
|
||||
* }, 1000);
|
||||
*
|
||||
* // Will log 'Function executed' immediately
|
||||
* throttledFunction();
|
||||
*
|
||||
* // Will not log anything as it is within the throttle time
|
||||
* throttledFunction();
|
||||
*
|
||||
* // After 1 second
|
||||
* setTimeout(() => {
|
||||
* throttledFunction(); // Will log 'Function executed'
|
||||
* }, 1000);
|
||||
*/
|
||||
declare function throttle<F extends (...args: any[]) => void>(func: F, throttleMs: number, {
|
||||
signal,
|
||||
edges
|
||||
}?: ThrottleOptions): ThrottledFunction<F>;
|
||||
//#endregion
|
||||
export { ThrottleOptions, ThrottledFunction, throttle };
|
||||
Loading…
Add table
Add a link
Reference in a new issue