Let's consider example
type Routes = 'first' | 'second';
type BeforeSign = //...
const handleRoute = (route: BeforeSign<Routes, '#'>) => route;
handleRoute('first');
handleRoute('first#additional');
handleRoute('first#random');
handleRoute('second#example');
// @ts-expect-error
handleRoute('third');
// @ts-expect-error
handleRoute('third#nope');
How to write BeforeSign generic type to make all handleRoute calls without error?