To turn off type inference, simply disable it
import { F } from 'ts-toolbelt'
function example<T = never>(a: string, b: F.NoInfer<T>[], c: F.NoInfer<T>) { }
// ^ must provide a default value, or it defaults to `unknown`
example('', [], '')
// function example<never>(a: string, b: never[], c: never): void
example<string>('', [''], '')
// okay
type NoInfer<A>: [A][A extends any ? 0 : never]
If you wish to restrict the usage of a simple argument, use
type NoInfer<T> = [T][T extends any ? 0 : never];
type NeverIfNever<T> = [T] extends [never] ? never : any;
export const sample = <T = never>(
a: string & NeverIfNever<T>,
{ c, d }: { c?: NoInfer<T>[]; d?: NoInfer<T> } = {}
) => {};
sample('', {})
// Argument of type 'string' is not assignable to parameter of type 'never'.(2345)
If you encounter a challenging single function argument, feel free to inquire if assistance is required