declare function filter(f: (this: void, x: any) => x is S): S[]; const numbers = filter((x): x is number => 'number' == typeof x)