{"id":19146296,"url":"https://github.com/signpostmarv/typescript-types-test","last_synced_at":"2025-07-20T06:04:43.113Z","repository":{"id":47977802,"uuid":"203222491","full_name":"SignpostMarv/typescript-types-test","owner":"SignpostMarv","description":"typescript @types test with tsc \u0026 gulp-typescript","archived":false,"fork":false,"pushed_at":"2022-12-04T08:06:09.000Z","size":283,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-22T19:49:15.734Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SignpostMarv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-19T17:52:31.000Z","updated_at":"2020-04-03T15:04:43.000Z","dependencies_parsed_at":"2023-01-23T16:45:38.832Z","dependency_job_id":null,"html_url":"https://github.com/SignpostMarv/typescript-types-test","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SignpostMarv/typescript-types-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SignpostMarv%2Ftypescript-types-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SignpostMarv%2Ftypescript-types-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SignpostMarv%2Ftypescript-types-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SignpostMarv%2Ftypescript-types-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SignpostMarv","download_url":"https://codeload.github.com/SignpostMarv/typescript-types-test/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SignpostMarv%2Ftypescript-types-test/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266076037,"owners_count":23872729,"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":"2024-11-09T07:43:47.197Z","updated_at":"2025-07-20T06:04:43.089Z","avatar_url":"https://github.com/SignpostMarv.png","language":"JavaScript","readme":"# Typescripts Types Test\nusing requestIdleCallback in typescript requires using [@types/requestidlecallback](https://www.npmjs.com/package/@types/requestidlecallback)\n\n# Example\n```ts\nimport {requestIdleCallback} from \"requestidlecallback\";\n\nexport async function Test() : Promise\u003cvoid\u003e {\n\treturn new Promise((yup) =\u003e {\n\t\trequestIdleCallback(() =\u003e {\n\t\t\talert('done');\n\n\t\t\tyup();\n\t\t});\n\t});\n}\n```\n\n## npm run build\n```js\nimport { requestIdleCallback } from \"requestidlecallback\";\nexport async function Test() {\n    return new Promise((yup) =\u003e {\n        requestIdleCallback(() =\u003e {\n            alert('done');\n            yup();\n        });\n    });\n}\n```\n\n## gulp\n```js\nexport async function Test() {\n\treturn new Promise((yup) =\u003e {\n\t\trequestIdleCallback(() =\u003e {\n\t\t\talert('done');\n\t\t\tyup();\n\t\t});\n\t});\n}\n\n//# sourceMappingURL=test.module.js.map\n```\n\n### gulpfile.js\n\n[gulp-replace](https://www.npmjs.com/package/gulp-replace) is used mostly to\n strip out the import statement, but also to force typescript to behave and\n use tabs instead of spaces (input tabs, you output spaces for some reason), as\n per discussion on [twitter](https://mobile.twitter.com/sarah_federman/status/1146544481556033537) \u0026\n [reddit](https://www.reddit.com/r/javascript/comments/c8drjo/nobody_talks_about_the_real_reason_to_use_tabs/) regarding the accessibility\n impact of tabs \u0026 spaces.\n\n```js\nconst gulp = require('gulp');\nconst typescript = require('gulp-typescript');\nconst replace = require('gulp-replace');\nconst sourcemaps = require('gulp-sourcemaps');\n\ngulp.task('default', () =\u003e {\n\treturn gulp.src(\n\t\t'./ts/**/*.module.ts'\n\t).pipe(\n\t\tsourcemaps.init()\n\t).pipe(\n\t\ttypescript.createProject('./tsconfig.json')()\n\t).pipe(\n\t\treplace(\n\t\t\t'import { requestIdleCallback } from \"requestidlecallback\";\\n',\n\t\t\t''\n\t\t)\n\t).pipe(\n\t\treplace(\n\t\t\t/ {4}/g,\n\t\t\t'\\t'\n\t\t)\n\t).pipe(\n\t\tsourcemaps.write('./', {\n\t\t\tincludeContent: false,\n\t\t})\n\t).pipe(\n\t\tgulp.dest('./js/')\n\t);\n});\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsignpostmarv%2Ftypescript-types-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsignpostmarv%2Ftypescript-types-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsignpostmarv%2Ftypescript-types-test/lists"}