import { LitElement } from 'lit'; type UpdateHandler = (prev?: unknown, next?: unknown) => void; type NonUndefined = A extends undefined ? never : A; /** * Get the keys of the updates handler inside one class. * * keyof will only extract the keys which are non-never * * The modified object * { [key in keyof T] -?: NonUndefined extends UpdateHandler ? key : never; } * * Get the keys in the object: [key in keyof T] * * Remove the undefined keys: -? * * Ternary operator A ? B : C - Check if the type is UpdateHandler: NonUndefined extends UpdateHandler * If true, set the value of current key to the key name * Else set the value of current key to never * After that, we use the mapped type to get the keys of the object ExampleObject[keyof ExampleObject] will return an union of they key values, and the never value will be removed **/ type UpdateHandlerKeys = { [key in keyof T]-?: NonUndefined extends UpdateHandler ? key : never; }[keyof T]; type Option = { waitUntilFirstUpdate: boolean; }; export declare function watch(propertyName: string | string[], options?: Option): (target: EleClass, decoratedFnName: UpdateHandlerKeys) => void; export {};