TypeScript object hierarchy