const name = 'Mike';
export const userName = {
    age: 99,
    name,
};
/**
 * Type-Safe definition eines Objects-
 *
 * Das Objekt hat zwei parameter: name + age
 */
export const userData = {
    age: 99,
    name: 'Gerda',
};
/**
 * Das komplexe Object hat eine Callback als zweiten parameter
 */
export const complexObject = {
    name: 'Mike',
    callback(age) {
        return `Age: ${age}`;
    },
};
export const anotherComplexObject = {
    data: [4, 5, 6],
    name: 'Mike',
};
// - Union Types -------------------------------------------------------------------------------------------------------
export const myRealAge = 99;
export function showMyRealAge(age) {
    return typeof age === 'number' ? `N: ${age}` : `S: ${age}`;
}
// - never Type --------------------------------------------------------------------------------------------------------
/**
 * Die Funktion endet nie - deshalb der return type: never
 */
export function neverEnds() {
    throw new Error('An error occurred!');
}
// - not nullable Types ------------------------------------------------------------------------------------------------
export function tryToReturnNull(paramShouldNotBeNull) {
    // tslint:disable-next-line
    return paramShouldNotBeNull === 'Mike' ? paramShouldNotBeNull : null;
}
//# sourceMappingURL=objects_and_types.js.map