I am the senior developer/technical lead in a small team working with a rather particular framework. The other members of my team are junior developers who cannot make the transition from junior to senior yet. I will be leaving the company in a few weeks and despite the company's best efforts we were unable to recruit a senior developer to take up my position. We appear to be somewhat successful to attract mid-level candidates. Should I disclose to those candidates that I will be leaving and they will be expected to progress in their new role without mentoring or not? (Without wanting to sound cocky) I am an expert in this particular framework and it is likely some candidates are attracted to the possibility of working with me.
That decision is primarily your manager's. Feel free to discuss your concerns with your manager. They might decide that it's indeed better to inform the candidates, or at least start dropping hints like "self-learning ability" (it's a generic buzzword in theory, but if you emphasise on this enough, some candidates will read between the lines and take the hint). But in any case, you're leaving soon, and whoever stays with the company will be your manager's responsibility, not yours.
I'd be open, at least at some stage of the process.
If I understand this correctly you are interviewing for your replacement as the tech leader. I think it pays to be clear about such things during the interview, at least at the later stages, and how can you describe the role they are expected to fill without mentioning that you will not be there?