To achieve this functionality, one can utilize an inferred rest type approach, albeit with some complexity due to trailing optional arguments that disrupt the rest-type matching process. A solution to this issue involves enclosing the parameters in non-optional singleton tuples, which can then be unwrapped to obtain the initial parameters.
type Wrap<T> = {[K in keyof T]-?: [T[K]]}
type Unwrap<T> = {[K in keyof T]: Extract<T[K], [any]>[0]}
type InitialParameters<F extends (...args: any) => any> =
Wrap<Parameters<F>> extends [...infer InitPs, any] ? Unwrap<InitPs> : never
const f1 = (str: string, n?: number, b?: boolean) => {}
const f2 = (to: string, overrides?: number) => {}
type Test1 = InitialParameters<typeof f1>
// [str: string, n: number | undefined]
type Test2 = InitialParameters<typeof f2>
// [to: string]
TypeScript playground