{"id":19694112,"url":"https://github.com/agent-006/typescript-master","last_synced_at":"2026-03-03T19:32:52.983Z","repository":{"id":253752157,"uuid":"843751718","full_name":"Agent-006/TypeScript-Master","owner":"Agent-006","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-19T08:10:50.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-27T12:38:48.527Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","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/Agent-006.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}},"created_at":"2024-08-17T10:04:03.000Z","updated_at":"2024-08-19T08:10:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"cc93258c-e069-4511-a966-57ac5c9da30c","html_url":"https://github.com/Agent-006/TypeScript-Master","commit_stats":null,"previous_names":["agent-006/typescript-master"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Agent-006/TypeScript-Master","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Agent-006%2FTypeScript-Master","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Agent-006%2FTypeScript-Master/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Agent-006%2FTypeScript-Master/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Agent-006%2FTypeScript-Master/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Agent-006","download_url":"https://codeload.github.com/Agent-006/TypeScript-Master/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Agent-006%2FTypeScript-Master/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30056069,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T18:21:05.932Z","status":"ssl_error","status_checked_at":"2026-03-03T18:20:59.341Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2024-11-11T19:20:22.394Z","updated_at":"2026-03-03T19:32:52.965Z","avatar_url":"https://github.com/Agent-006.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MANDATORY STUFF:\n\nInstall vs code, nodejs and tyepscript\n\n# LET'S WRITE SOME CODE:\n\n## Basic Types\n\n- Number, String, Boolean\n- Arrays, Typles\n- Any, Unknown, Never, Void\n- Enums\n\n### Number, String, Boolean\n```\nlet arr: [];\nlet arr3: string;\n\nlet variable: number;\nlet variable1: boolean;\n```\n### Arrays, Typles\n```\nlet variable2: [];\nlet array: [boolean ,number, string] = [false, 1, 'hello'];\n\narray.push(2);\nconsole.log(array);\n```\n\n### any, unknown\nthese 2 have some differences will discuss later\n```\nlet variable3: unknown;\nlet variable4: any;\n```\n\n### never\nnever is used when a function never returns anything\n```\nfunction runInfiniteLoop(): never {\n    while(true) {\n        console.log('Infinity');\n    }\n}\n\nrunInfiniteLoop();\n```\nrunning the function will cause the program to run infinitely and never return anything back to the caller function. Also the code below the function will not run as the function will run infinitely.\n\n### void\n\n * The function `efgh` logs 'Hello' to the console.\n```\nfunction efgh(): void {\n    console.log('Hello');\n}\n```\n\n`efgh();` is calling the function named `efgh` in TypeScript. This function logs 'Hello' to the\nconsole. So, when `efgh();` is executed, it will output 'Hello' to the console. \n```\nefgh();\n```\n\n\n * The function \"abcd\" in TypeScript returns the number 12.\n * @returns The function `abcd` is returning the number 12.\n```\nfunction abcd(): number {\n    return 12;\n}\n\nabcd();\n```\n### Enums\n\n```\nlet upDirection = \"UP\";\nlet downDirection = \"DOWN\";\nlet leftDirection = \"LEFT\";\nlet rightDirection = \"RIGHT\";\n```\n\n## Type Inference\n\nType inference is a feature in many programming languages where the compiler or interpreter automatically deduces the types of variables or expressions without the need for explicit type annotations by the programmer.\n\nFor example, if you write a line of code like let x = 5 in a language that supports type inference, the compiler can infer that x is of type integer based on the value 5. This makes the code more concise and often easier to write, as the programmer doesn't need to manually specify the type of every variable.\n\n```\nlet a = 12;\nlet b = 'a';\nlet c = true;\n```\n\nType inference is common in statically typed languages like TypeScript, Swift, and Rust, and helps in reducing boilerplate code while still maintaining type safety.\n\n## Union and Intersection Types\n\n### Union\n\n```\nlet variable: string | null;\n\nvariable = null;\nvariable = 'abcd';\n```\n\n```\nfunction abcd(variable: string | number) {\n    if (typeof variable === 'string') {\n        variable.toUpperCase();\n    } else {\n        variable.toFixed(2);\n    }\n}\n\nabcd('abcd'); // OK\nabcd(123); // OK\n// abcd(true); // Error\n```\n\n### Intersection\n```\ntype City = {\n    name: string;\n    population: number;\n}\n\ntype Planet = {\n    name: string;\n    cities: number;\n}\n\ntype CitiesInPlanet = City \u0026 Planet;\n\nlet value: CitiesInPlanet = {\n    name: 'Earth',\n    population: 7_594_000_000,\n    cities: 1_000_000\n}\n```\n\n## Type Aliases\n\n\n\n## Interfaces\n\n## Classes\n\n- Constructors\n- Public, Private, Protected Members\n- Readonly Properties\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagent-006%2Ftypescript-master","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagent-006%2Ftypescript-master","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagent-006%2Ftypescript-master/lists"}