once.d.ts 377 B

12345
  1. /**
  2. * A class method decorator that limits a method to be called only once. All
  3. * subsequent calls will return the result of the first call.
  4. */
  5. export declare function once<This, Args extends any[], Return>(fn: (this: This, ...args: Args) => Return, context?: ClassMethodDecoratorContext<This, (this: This, ...args: Args) => Return>): (this: This, ...args: Args) => Return;