{"id":22413032,"url":"https://github.com/deeper-x/custom-declaration","last_synced_at":"2026-04-09T21:33:02.450Z","repository":{"id":97569652,"uuid":"163831931","full_name":"deeper-x/custom-declaration","owner":"deeper-x","description":"Typescript: simple demo with custom declaration file, included with reference path ","archived":false,"fork":false,"pushed_at":"2023-04-30T04:11:44.000Z","size":143,"stargazers_count":0,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T03:27:40.165Z","etag":null,"topics":["custom-declaration-file","declaration-files","npm","tsconfig","typescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/deeper-x.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":"2019-01-02T11:22:36.000Z","updated_at":"2019-01-02T14:48:58.000Z","dependencies_parsed_at":"2025-03-27T03:37:11.838Z","dependency_job_id":null,"html_url":"https://github.com/deeper-x/custom-declaration","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/deeper-x/custom-declaration","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deeper-x%2Fcustom-declaration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deeper-x%2Fcustom-declaration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deeper-x%2Fcustom-declaration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deeper-x%2Fcustom-declaration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deeper-x","download_url":"https://codeload.github.com/deeper-x/custom-declaration/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deeper-x%2Fcustom-declaration/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259777283,"owners_count":22909634,"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":["custom-declaration-file","declaration-files","npm","tsconfig","typescript"],"created_at":"2024-12-05T14:11:41.368Z","updated_at":"2026-04-09T21:32:57.414Z","avatar_url":"https://github.com/deeper-x.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Typescript - Declaration file for a custom module\nWith this simple example, we show how to define and set up a type definition for a custom Javascript library, in a Typescript module.\n\nWe write and publish on npm a test module, a \"reverse with sharps\" library: given an input string, it returns the reversed version with some sharps around.\n\nExample:\n```javascript\nconsole.log(reverseWithSharps(\"ALBERTO\"));\n\n// result: ## OTREBLA ##\n```\n\nThen we use it in a TS file, simply defining a declaration file, requiring an input string as a parameter, returning a string as a result:\n```javascript\n/// \u003creference path=\"./reverse-with-sharps.d.ts\"/\u003e\nimport * as myModule from 'reverse-with-sharps';\n\nconsole.log(myModule.reverseWithSharps(\"ALBERTO\"));\n\n// result: ## OTREBLA ##\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeeper-x%2Fcustom-declaration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeeper-x%2Fcustom-declaration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeeper-x%2Fcustom-declaration/lists"}