Previously subtypes of Error extended Error, but the matching subtypes of ErrorConstructor did not extend ErrorConstructor. The members in es5.d.ts are identical, so there's no need except for allowing interface merging into ErrorConstructor to affect subtypes as well.
12 lines
308 B
TypeScript
12 lines
308 B
TypeScript
// @lib: es5,dom
|
|
// In Node, ErrorConstructor is augmented with extra properties. Excerpted below.
|
|
interface ErrorConstructor {
|
|
captureStackTrace(targetObject: Object, constructorOpt?: Function): void;
|
|
}
|
|
|
|
declare var x: ErrorConstructor
|
|
x = Error; // OK
|
|
x = RangeError;
|
|
new x().message
|
|
x.captureStackTrace
|