function defer() {
	let fulfil;
	let reject;

	const promise = new Promise((f, r) => {
		fulfil = f;
		reject = r;
	});

	// @ts-expect-error
	return { promise, fulfil, reject };
}
@returns {import('types').Deferred & { promise: Promise<any> }}}