We present a quantum and classical theory of electronic devices with onedimensional (1D) channels made of a single carbon nanotube or a semiconductor nanowire. An essential component of the device theory is a self-consistent model for electrostatics of 1D systems. It is demonstrated that specific screening properties of 1D wires result in a charge distribution in the channel different from that in bulk devices. The drift-diffusion model has been applied for studying transport in a long channel 1D field-effect transistor. A unified self-consistent description is given for both a semiconductor nanowire and a singlewall nanotube. Within this basic model we analytically calculate equilibrium (at zero current) and quasi-equilibrium (at small current) charge distributions in the channel. Numerical results are presented for arbitrary values of the driving current. General analytic expressions, found for basic device characteristic, differ from equations for a standard bulk threedimensional field-effect device. The device characteristics are shown to be sensitive to the gate and leads geometry and are analyzed separately for bulk, planar and quasi-1D contacts. The basic model is generalized to take into account external charges which can be polarized and/or moving near the channel. These charges change the self-consistent potential profile in the channel and may show up in device properties, for instance, a hysteresis may develop which can have a memory application.