{"id":28156832,"url":"https://github.com/devhasanmia/assignment-1","last_synced_at":"2025-05-15T08:15:33.117Z","repository":{"id":292027739,"uuid":"979558977","full_name":"devhasanmia/assignment-1","owner":"devhasanmia","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-07T18:42:53.000Z","size":1,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T19:39:12.427Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devhasanmia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-07T17:45:44.000Z","updated_at":"2025-05-07T18:42:56.000Z","dependencies_parsed_at":"2025-05-07T19:39:56.259Z","dependency_job_id":"f6b16a85-6db3-41b5-9f01-0df7fb9f9a6b","html_url":"https://github.com/devhasanmia/assignment-1","commit_stats":null,"previous_names":["devhasanmia/assignment-1"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devhasanmia%2Fassignment-1","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devhasanmia%2Fassignment-1/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devhasanmia%2Fassignment-1/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devhasanmia%2Fassignment-1/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devhasanmia","download_url":"https://codeload.github.com/devhasanmia/assignment-1/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254301618,"owners_count":22047907,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-15T08:15:16.917Z","updated_at":"2025-05-15T08:15:33.094Z","avatar_url":"https://github.com/devhasanmia.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# Assalamu Alaikum, how are you all? \r\n I hope everyone is doing well.\r\n Today we will discuss interfaces and types.\r\n Let's get started without delay.\r\n## What are some differences between interfaces and types in TypeScript?\r\n\r\nIn TypeScript, both Interfaces and Types are used to define type definitions for objects, functions, or variables. Their primary purpose is to define structural types in the type system, reducing type-related errors in code and making the code more readable and maintainable.\r\n\r\n# For Example: \r\n ````\r\n// Interface\r\ninterface Person {\r\n  name: string;\r\n  dataOfBirth: number;\r\n  address: string;\r\n}\r\n\r\n// Type\r\ntype Person = {\r\n  name: string;\r\n  age: number;\r\n  address: string;\r\n};\r\n````\r\nNow let's see when to use which one.\r\n\r\n## Interfaces:\r\nUseful only for defining object structures.\r\nIt is not suitable for defining complex types (such as unions, tuples).\r\nHowever TypeScript merges interfaces with the same name if they are declared multiple times. This is very useful in large projects where modules are extended through separate declarations.\r\n## Types:\r\nTypes are more useful for defining complex types, such as union types, tuples, function types, etc.\r\nbut Type declaration merging is not supported. Declaring types with the same name will result in an error.\r\n\r\nThank you.\r\n\r\n# Explain the difference between any, unknown, and never types in TypeScript.\r\n\r\nThe types any, unknown, and never are used in various ways in TypeScript. Let's explain them in simple to understand their uses and differences.\r\n\r\n### any Type\r\nUsing the any type in TypeScript disables the compiler from checking the type. This allows any type of data to be assigned to a variable and any operation to be performed on that variable. This provides flexibility, but it removes the type safety benefits of TypeScript. Therefore, you should be careful when using any.\r\n````\r\nlet value: any;\r\nvalue = 42;       \r\nvalue = \"hello\";  \r\nvalue.toFixed(); \r\n````\r\n### unknown Type\r\nThe unknown type can accept any value, just like any. However, unlike any, you cannot directly perform operations on a value of type unknown without first ensuring its type. This type-checking requirement makes unknown much safer and less error-prone.\r\n\r\n### never Type\r\nThe never type in TypeScript is a special type that represents values or functions that are impossible to produce or complete. It signifies that some operations or code paths will never yield a value. Understanding its purpose is crucial for advanced type safety and handling edge cases in TypeScript.\r\n\r\nEveryone stay well and healthy, we'll talk later, one day, Inshallah.\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevhasanmia%2Fassignment-1","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevhasanmia%2Fassignment-1","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevhasanmia%2Fassignment-1/lists"}