Options
All
  • Public
  • Public/Protected
  • All
Menu

Module src/core/functools/deprecation

core/functools/deprecation

This module provides a bunch of functions and decorators to mark deprecated functions with the special flag.

import { deprecate, deprecated } from 'core/functools/deprecation';

const foo = deprecate({
name: 'foo',
renamedTo: 'bar'
}, bar);

function bar() {

}

class Baz {
@deprecated({alternative: 'newMethod'})
oldMethod() {

}

newMethod() {}
}

Index

References

Re-exports InlineWarnOptions
Re-exports WarnAlternative
Re-exports WarnAlternativeOptions
Re-exports WarnContext
Re-exports WarnExprType
Re-exports WarnOptions
Re-exports WarnedFn

Functions

  • deprecate<T>(opts: WarnOptions, fn: T): T extends (...args: infer A) => infer R ? WarnedFn<A, R> : T
  • deprecate(opts: InlineWarnOptions): void
  • deprecate<T>(fn: T): T extends (...args: infer A) => infer R ? WarnedFn<A, R> : T
  • deprecated(target: object, key: string | symbol, descriptor: PropertyDescriptor): void
  • deprecated(opts?: WarnOptions): Function