Třeba tak:
interface IProduct {
name: string;
type: string;
}
this.products = ko.observableArray<IProduct>([
{ name: "Sušenky", type: "free" },
{ name: "Alkohol", type: "adult" },
{ name: "Mléko", type: "free" }
]);
return ko.utils.arrayFilter(self.products(), (prod: IProduct) => prod.type === self.currentFilter());
S použitím definičního souboru.