Skip to content

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TypeScript Tasks - 0x04-TypeScript

This repository contains the implementation of TypeScript tasks 0-8 for the ALX Frontend JavaScript project.

Task 0: Creating an interface for a student

  • Directory: task_0/
  • Files: task_0/js/main.ts, task_0/package.json, task_0/.eslintrc.js, task_0/tsconfig.json, task_0/webpack.config.js
  • Creates a Student interface with firstName, lastName, age, and location
  • Renders a table using Vanilla JavaScript with student data

Task 1: Let's build a Teacher interface

  • Directory: task_1/
  • File: task_1/js/main.ts
  • Implements a Teacher interface with readonly firstName/lastName and other properties
  • Allows adding dynamic attributes to the Teacher object

Task 2: Extending the Teacher class

  • Directory: task_1/
  • File: task_1/js/main.ts
  • Creates a Directors interface that extends Teacher
  • Adds numberOfReports property to Directors

Task 3: Printing teachers

  • Directory: task_1/
  • File: task_1/js/main.ts
  • Implements printTeacher function that formats teacher names
  • Includes printTeacherFunction interface

Task 4: Writing a class

  • Directory: task_1/
  • File: task_1/js/main.ts
  • Creates StudentClass with constructor and methods
  • Implements interfaces for both constructor and class

Task 5: Advanced types Part 1

  • Directory: task_2/
  • File: task_2/js/main.ts
  • Implements DirectorInterface and TeacherInterface
  • Creates Director and Teacher classes
  • Includes createEmployee factory function

Task 6: Creating functions specific to employees

  • Directory: task_2/
  • File: task_2/js/main.ts
  • Implements isDirector type predicate function
  • Creates executeWork function that calls appropriate methods

Task 7: String literal types

  • Directory: task_2/
  • File: task_2/js/main.ts
  • Implements Subjects string literal type (Math | History)
  • Creates teachClass function with conditional return values

Task 8: Ambient Namespaces

  • Directory: task_3/
  • Files: task_3/js/main.ts, task_3/js/interface.ts, task_3/js/crud.d.ts
  • Defines RowID type and RowElement interface
  • Creates ambient type declarations for CRUD operations
  • Demonstrates usage with triple slash directives

Requirements

  • All files transpiled on Ubuntu 18.04
  • TypeScript scripts checked with jest (version 24.9.*)
  • No TypeScript compiler warnings or errors
  • Uses .ts extension when possible

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages