Interfaces pinned by quenched disorder are often used to model jerky self-organized critical motion. We study static avalanches, or shocks, defined here as jumps between distinct global minima upon changing an external field. We show how the full statistics of these jumps is encoded in the functional-renormalization-group fixed-point functions. This allows us to obtain the size distribution P(S) of static avalanches in an expansion in the internal dimension d of the interface. Near and above d=4 this yields the mean-field distribution P(S) approximately S;{-3/2}e;{-S4S_{m}} , where S_{m} is a large-scale cutoff, in some cases calculable. Resumming all one-loop contributions, we find P(S) approximately S;{-tau}exp(C(SS_{m});{1/2}-B/4(S/S_{m});{delta}) , where B , C , delta , and tau are obtained to first order in =4-d . Our result is consistent to O() with the relation tau=tau_{zeta}:=2-2/d+zeta , where zeta is the static roughness exponent, often conjectured to hold at depinning. Our calculation applies to all static universality classes, including random-bond, random-field, and random-periodic disorders. Extended to long-range elastic systems, it yields a different size distribution for the case of contact-line elasticity, with an exponent compatible with tau=2-1/d+zeta to O(=2-d) . We discuss consequences for avalanches at depinning and for sandpile models, relations to Burgers turbulence and the possibility that the relation tau=tau_{zeta} be violated to higher loop order. Finally, we show that the avalanche-size distribution on a hyperplane of codimension one is in mean field (valid close to and above d=4 ) given by P(S) approximately K_{13}(S)S , where K is the Bessel- K function, thus tau_{hyperplane}=4/3 .