Defining integrals using certain integration formula is sometimes done to regularize divergent integrals. Now, as pointed out by Alexandre Eremenko in the comments, the use of the residue theorem would limit the applicability of the definition of an integral over the real line to a rather small class of functions. However, there exists a more general integration formula due to Glaisher for integrals over the real line, which is a special case of Ramanujan's master theorem:

If $f(x)$ is an even function with series expansion of the form

$$f(x) = \sum_{k=0}^{\infty}(-1)^k c_k x^{2k}$$

then

$$\int_{-\infty}^{\infty}f(x) dx = \pi c_{-\frac{1}{2}}\tag{1}$$

if this integral converges. This then needs a definition of the coefficients $c_k$ for non-integer $k$ which can be done using the rigorous formulation of Ramanujan's master theorem, but that would defeat the purpose of this attempt to get to an alternative definition of integrals. Instead, one can proceed in a more heuristic way, whenever a function is specified via some analytic expression of the $c_k$ involving e.g. factorials, the meaning of $c_{-1/2}$ won't usually pose problems.

A simple example to illustrate that (1) is more general than the residue theorem, we can take $f(x) = \exp\left(-x^2\right)$. This clearly is not a case where the residue theorem is applicable, although a derivation of the Gaussian integral using contour integration methods does exist. Since $c_k = \dfrac{1}{k!}$, we have $c_{-1/2} = \dfrac{1}{\sqrt{\pi}}$, Glaisher's method thus yields the correct result of $\sqrt{\pi}$.

indefiniteintegral in this way, would you? $\endgroup$ – Carlo Beenakker Feb 22 '19 at 10:39definiteintegral $\int_0^1 dx$ by the residue theorem? $\endgroup$ – Carlo Beenakker Feb 22 '19 at 11:05