Check out example codes for "typescript class type t". It will help you in understanding the concepts better.

Code Example 1

class GenericNumber<T> {
    zeroValue: T;
    add: (x: T, y: T) => T;
}

let myGenericNumber = new GenericNumber<number>();
myGenericNumber.zeroValue = 0;
myGenericNumber.add = function(x, y) { return x + y; };

Learn ReactJs, React Native from akashmittal.com