interface Options { /** * If set to true, the lazy getter triggering on one class instance will end up saving the returned value on all * class instances, current and future. * * Has no effect on static getters. */ global?: boolean; /** * A function to determine whether we should save the results (returning a truthy value) or continue calling the * original getter (returning a falsy value). The default behaviour is to always save the 1st result. * * Gotcha: compatibility further depends on the Typescript compiler target you've set - * see README for further details. */ select?: ResultSelector; } type Fn = (this: T) => R; /** @see {Options#select} */ type ResultSelector = (this: T, output: R, self: T) => any; type Decorator = (origFn: Fn, ctx: ClassGetterDecoratorContext) => undefined | Fn; /** Save the getter's return value and don't call it again */ declare function LazyGetter(opts?: Options): Decorator; export { LazyGetter }; export type { ResultSelector, Options as LazyGetterOptions };