// Místo generic constraint můžeme použít Extract
type ValidTypes = string | number | boolean;

// S generic constraint
function processValue<T extends ValidTypes>(value: T) {
    return value;
}

// S Extract - dosáhneme podobného výsledku
function processValue2(value: Extract<unknown, ValidTypes>) {
    return value;
}