Complex Objects in TypeScript

Objects can have a structure of any nesting within themselves, and this structure can be described when declaring the object or in the interface.

As an example, let's make an interface like this that describes a user:

typescriptinterface User {
  name: string,
  age: number,
  parents: {
    mother: string,
    father: string
  }
}

Let's make an object that implements this interface:

typescriptlet user: User = {
  name: 'john',
  age: 30,
  parents: {
    mother: 'jane',
    father: 'eric'
  }
}
Задание 1

Given object:

typescriptlet event = {
  name: 'my new event',
  time: {
    start: '2025-11-01',
    finish: '2025-12-31'
  }
};

Create an interface that describes the structure of this object.

Задание 2

Given object:

typescriptlet employee {
  name: 'andrew',
  potision: {
    name: 'programmer'
    salary: 1000,
  }
  addr: {
    country: 'belarus',
    city: 'minsk'
  }
};

Create an interface that describes the structure of this object.