The door had hardly shut when she called me back.
(ドアが閉まったとたんに、彼女は私を呼び出した。)
I had scarcely gone to bed before someone knocked at the door.
(私が寝ようとしたとたんに、誰かがドアをノックした。)
「hardly (scarcely)」は否定語なので、文頭に置く場合は倒置をします。 Hardly had the door shut when she called me back.