Express and Typescript declaration files to extend Request object

Поділитися
Вставка
  • Опубліковано 17 чер 2024
  • In this lesson we will learn how to use declaration files in Typescript to teach the typescript compiler about added data we are adding to Express Request object.
    We will learn about declaration files.
    We will use declaration files to extend the Express.Request object.
    We will learn about DefinitelyTyped declaration files
    We will examine popular examples where you will have to use declaration files to teach the typescript compiler.
    The full source code of this lesson is available here:
    github.com/ywarezk/academeez/...
    #expressjs #typescript
    0:00 Typescript is not aware of additional data on the request object
    2:11 Lesson plan
    4:27 Starting an Express with Typescript project
    11:23 Piggy back on the Express Request object
    14:50 Locale middleware
    17:22 Declaration files
    19:51 Creating a declaration file that extends Express.Request with locale data
    25:03 Passport and creating declaration file for a module
    32:30 DefinitelyTyped
    37:35 Declaration file for overriding passport user on the Express.Request object
    44:21 tsconfig options for telling typescript to consume your declaration files
    50:04 Summary

КОМЕНТАРІ • 3

  • @kingsleydaniel3497
    @kingsleydaniel3497 3 місяці тому

    This is masterpiece. Thank you for the lessons.

  • @akashxdev
    @akashxdev 2 місяці тому

    thank you so much.. it really worked!!!!!!!

  • @abhisheksharma10600
    @abhisheksharma10600 4 місяці тому +1

    Thanks for this video,it helped me use typescript with express properly.