window.history.pushstate TypeScript

const url = new URL(window.location.href);
url.searchParams.set("key", "value");
const href = url.toString();
window.history.pushState({}, '', href);
Zwazel