typescript, что я хочу, чтобы valuesMap вернул массив из значений S?
https://www.typescriptlang.org/play/index.html#src=%2F%2F%20%D0%9D%D0%B5%D0%B2%D0%B0%D0%B6%D0%BD%D0%BE%0D%0Atype%20Property%3CT%3E%20%3D%20any%3B%0D%0A%0D%0Aexport%20declare%20class%20SynchronizedSettings%3CS%20extends%20%7B%7D%3E%20%7B%0D%0A%20%20%20%20values%3CK%20extends%20keyof%20S%3E(name%3A%20K)%3A%20Property%3CS%5BK%5D%3E%3B%0D%0A%0D%0A%20%20%20%20%2F%2F%20%D0%B2%D0%BE%D1%82%20%D1%82%D1%83%D1%82%20%D0%BF%D0%BE%20%D0%BF%D0%BE%D0%B4%D0%BE%D0%B1%D0%B8%D1%8E%20%D1%81%20%D0%BF%D1%80%D0%B5%D0%B4%D1%8B%D0%B4%D1%83%D1%89%D0%B5%D0%B9%20%D1%84%D1%83%D0%BD%D0%BA%D1%86%D0%B8%D0%B5%D0%B9%20%D0%BD%D0%B0%D0%B4%D0%BE%20%D0%B7%D0%B0%D1%82%D0%B8%D0%BF%D0%B8%D0%B7%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D1%82%D1%8C%3A%20%0D%0A%20%20%20%20%2F%2F%20%D0%94%D0%BE%D0%BB%D0%B6%D0%B5%D0%BD%20%D0%B2%D0%B5%D1%80%D0%BD%D1%83%D1%82%D1%8C%D1%81%D1%8F%20%D0%BC%D0%B0%D1%81%D1%81%D0%B8%D0%B2%20%D1%82%D0%BE%D0%B3%D0%BE%2C%20%D1%87%D1%82%D0%BE%20%D0%B2%D0%BE%D0%B7%D0%B2%D1%80%D0%B0%D1%89%D0%B0%D0%B5%D1%82%20values%0D%0A%20%20%20%20valuesMap%3CK%20extends%20(keyof%20S)%5B%5D%3E(...names%3A%20K)%3A%20%5BProperty%3CS%5BK%5D%3E%5D%3B%0D%0A%7D
valuesMap<K extends keyof S>(...names: K[]): [Property<S[K]>]
Обсуждают сегодня