xxxxxxxxxx
// specify a perticular type to the object
interface IName {
firstname: string,
lastname: string
}
var obj: IName
// force assign the type somewhere in the code
function(someinput){
var temp = someinput as IName;
// never null check
var temp = someinput!;
}
xxxxxxxxxx
unknown is the type-safe counterpart of any.
Anything is assignable to unknown, but unknown isn’t assignable
to anything but itself and any without a type assertion or a
control flow based narrowing.
Likewise, no operations are permitted on an unknown without
first asserting or narrowing to a more specific type
Take a look here for some examples:
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-0.html