Global augmentation
You can also add declarations to the global scope from inside a module:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | // observable.ts export class Observable<T> { // ... still no implementation ... } declare global { interface Array<T> { toObservable(): Observable<T>; } } Array.prototype.toObservable = function () { // ... } |
Global augmentations have the same behavior and limits as module augmentations.
Please login to continue.