Temporal coupled-mode theory for resonant apertures