Step 1: Define variables.
Let the number of bananas bought from the four types be
\[
x_1,x_2,x_3,x_4
\]
Step 2: Write the total condition.
Since total bananas are \(12\),
\[
x_1+x_2+x_3+x_4=12
\]
Step 3: Apply the condition of at least one banana from each type.
\[
x_1\geq 1,\quad x_2\geq 1,\quad x_3\geq 1,\quad x_4\geq 1
\]
Step 4: Convert into non-negative variables.
Let
\[
y_i=x_i-1
\]
for \(i=1,2,3,4\). Then
\[
y_i\geq 0
\]
Step 5: Substitute in the equation.
\[
(y_1+1)+(y_2+1)+(y_3+1)+(y_4+1)=12
\]
\[
y_1+y_2+y_3+y_4=8
\]
Step 6: Use stars and bars formula.
The number of non-negative integer solutions of
\[
y_1+y_2+y_3+y_4=8
\]
is
\[
\binom{8+4-1}{4-1}
\]
Step 7: Calculate the value.
\[
\binom{11}{3}
=
\frac{11\cdot 10\cdot 9}{3\cdot 2\cdot 1}
=
165
\]
\[
\boxed{165}
\]