defines a tool function that is expected to be used to select different elements. It infers that the return type is Element, but this is a base class, and the methods and properties of many specific classes cannot be prompted automatically.
export const $ = (selector, scope = document): HTMLElement | HTMLInputElement => scope.querySelector(selector);
excuse me, how should I define this return value type so that I can indicate the specific properties and methods it has according to different elements? Thank you < 3