Telegram Web K with changes to work inside I2P
https://web.telegram.i2p/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.2 KiB
43 lines
1.2 KiB
/* |
|
* https://github.com/morethanwords/tweb |
|
* Copyright (C) 2019-2021 Eduard Kuzmenko |
|
* https://github.com/morethanwords/tweb/blob/master/LICENSE |
|
*/ |
|
|
|
export default function applyMixins(derivedCtor: any, constructors: any[]) { |
|
// const callbacks: Array<(...args: any[]) => any> = []; |
|
|
|
constructors.forEach((baseCtor) => { |
|
Object.getOwnPropertyNames(baseCtor.prototype).forEach((name) => { |
|
const value: PropertyDescriptor = Object.getOwnPropertyDescriptor(baseCtor.prototype, name) || Object.create(null); |
|
/* if(name === '_constructor') { |
|
callbacks.push(value.value); |
|
return; |
|
} else */if(name === 'constructor') { |
|
return; |
|
} |
|
|
|
Object.defineProperty( |
|
derivedCtor.prototype, |
|
name, |
|
value |
|
); |
|
}); |
|
}); |
|
|
|
// if(callbacks.length) { |
|
// function c(...args: any[]): any { |
|
// callbacks.forEach((cb, idx) => { |
|
// // @ts-ignore |
|
// cb.apply(this, args[idx] || []); |
|
// }); |
|
// }; |
|
|
|
// Object.defineProperty(derivedCtor.prototype, 'superConstructor', { |
|
// configurable: true, |
|
// enumerable: true, |
|
// value: c, |
|
// writable: true |
|
// }); |
|
// } |
|
}
|
|
|