In my framework, every handler has to write its route twice. Once in the decorator because the runtime needs the string, and once in the generic because the types need it.
@Route('ban') class Ban extends Handler<'kick'> {} // no errors. cool. love that for me
That compiles . The handler for ban now thinks it's handling kick and TS is completely fine with it.
And yes, I tried only writing it once. class Ban extends Route('ban') . It worked(?), but every handler read like mixin tomfoolery, and go-to-definition took you to a generated base class instead of the real one, and I just didn't like how it looked, so I went back to writing it twice.…