SitePoint
Blog
Forum
Library
Login
Join Premium
Toggle sidebar
Build an App with TypeScript and the Pexels API
Toggle community discussions
Close
Content
Files
Bookmarks
Preface
Build an App With Typescript
Notice of Rights
Notice of Liability
Trademark Notice
About Jack Franklin
About SitePoint
Who Should Read This Book?
Conventions Used
Supplementary Materials
1
A Step-by-Step TypeScript Tutorial for Beginners
Some Erroneous JavaScript Code
Running TypeScript from the Editor
Installing and Running TypeScript Locally
Fixing the Errors in Our JavaScript Code
How to Configure TypeScript
Describe the Function Signature with JSDoc
Declaring Data Types Using an Interface
Conclusion
Build an Application with TypeScript from Scratch
Pexels API Key
Setting up Vite as the Build Tool
Installing Dependencies
Configuring TypeScript with Vite
Building the Project with Vite
Making API Requests with TypeScript
Interfaces in TypeScript
Declaring Function Return Types
Generic Types
Using Third-party Libraries with TypeScript
Using lit-html to Render Image Results
Linting with ESLint-TypeScript.
Conclusion
Adding More Functionality
Refactoring the App to Create a render Method
Rendering a Search Form
Searching for Photos
Using FormData to Read Form Values
Using the formData Object
Writing an API for Local Storage
Favoriting Photos
Creating pexels.ts to Contain Our API Code
Liking a Photo
Defining the Types of Callback Functions
Improving Our Code with readonly
Adding Video Results
Rendering Videos
Type Predicates
Rendering Videos
Liking Videos
Defining a Resource Type
Defining renderResource
Liked Data and Enums
Features to Add Next
Conclusion
Open text modal
Community Questions
Close