  We introduce a theory to analyze the behavior of light emitters in
nanostructured environments rigorously. Based on spectral theory, the approach
opens the possibility to quantify precisely how an emitter decays to resonant
states of the structure and how it couples to a background, also in the
presence of general dispersive media. Quantification on this level is essential
for designing and analyzing topical nanophotonic setups, e.g., in quantum
technology applications. We use a numerical implementation of the theory for
computing modal and background decay rates of a single-photon emitter in a
diamond nanoresonator.
