import { AbortController } from "abort-controller";
//#region extensions/telegram/src/timeout-abort.ts
/** grammY `Api` expects `abort-controller` signals, not Node/DOM `AbortSignal.timeout()`. */
function createTimeoutAbortSignal(ms) {
	const ac = new AbortController();
	const t = setTimeout(() => ac.abort(), ms);
	return {
		signal: ac.signal,
		dispose: () => clearTimeout(t)
	};
}
//#endregion
export { createTimeoutAbortSignal };

//# sourceMappingURL=timeout-abort.js.map