chore(platform): eslint/tsconfig migration + browser utils

Migrate to eslint flat config and composite tsconfig; browser/multi updates
(hideOthers, focusScope).
This commit is contained in:
2026-06-07 16:29:28 +07:00
parent da8d137be4
commit e6919de29e
16 changed files with 443 additions and 88 deletions
-49
View File
@@ -1,49 +0,0 @@
// eslint-disable
export interface DebounceOptions {
/**
* Call the function on the leading edge of the timeout, instead of waiting for the trailing edge
*/
readonly immediate?: boolean;
/**
* Call the function on the trailing edge with the last used arguments.
* Result of call is from previous call
*/
readonly trailing?: boolean;
}
const DEFAULT_DEBOUNCE_OPTIONS: DebounceOptions = {
trailing: true,
}
export function debounce<FnArguments extends unknown[], FnReturn>(
fn: (...args: FnArguments) => PromiseLike<FnReturn> | FnReturn,
timeout: number = 20,
options: DebounceOptions = {},
) {
options = {
...DEFAULT_DEBOUNCE_OPTIONS,
...options,
};
if (!Number.isFinite(timeout) || timeout <= 0)
throw new TypeError('Debounce timeout must be a positive number');
// Last result for leading edge
let leadingValue: PromiseLike<FnReturn> | FnReturn;
// Debounce timeout id
let timeoutId: NodeJS.Timeout;
// Promises to be resolved when debounce is finished
let resolveList: Array<(value: unknown) => void> = [];
// State of currently resolving promise
let currentResolve: Promise<FnReturn>;
// Trailing call information
let trailingArgs: unknown[];
}
-1
View File
@@ -1,2 +1 @@
export * from './global';
// export * from './debounce';