{"id":27243168,"url":"https://github.com/react-gjs/gjs-esm-types","last_synced_at":"2026-05-16T00:34:46.955Z","repository":{"id":109695459,"uuid":"609642960","full_name":"react-gjs/gjs-esm-types","owner":"react-gjs","description":null,"archived":false,"fork":false,"pushed_at":"2023-07-04T15:01:25.000Z","size":4815,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T22:32:42.625Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/react-gjs.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-04T19:50:16.000Z","updated_at":"2023-03-23T12:03:48.000Z","dependencies_parsed_at":"2024-10-29T13:21:55.831Z","dependency_job_id":null,"html_url":"https://github.com/react-gjs/gjs-esm-types","commit_stats":{"total_commits":17,"total_committers":2,"mean_commits":8.5,"dds":0.2941176470588235,"last_synced_commit":"61ba629adb2f1cfdfb393828b1c678ee4af43b7d"},"previous_names":["ncpa0cpl/gjs-esm-types"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-gjs%2Fgjs-esm-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-gjs%2Fgjs-esm-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-gjs%2Fgjs-esm-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-gjs%2Fgjs-esm-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/react-gjs","download_url":"https://codeload.github.com/react-gjs/gjs-esm-types/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248290017,"owners_count":21078923,"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-04-10T20:27:19.439Z","updated_at":"2026-05-16T00:34:41.924Z","avatar_url":"https://github.com/react-gjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"#### This package provides module declarations for some of the most common GJS gir modules (see [Gnome JavaScript](https://gjs.guide/about/)). With it you will get fully typed imports for the following modules:\n\n- `gi://Atk?version=1.0`\n- `gi://GLib?version=2.0`\n- `gi://GModule?version=2.0`\n- `gi://GObject?version=2.0`\n- `gi://Gdk?version=3.0`\n- `gi://Gdk?version=4.0`\n- `gi://GdkPixbuf?version=2.0`\n- `gi://Gio?version=2.0`\n- `gi://Graphene?version=1.0`\n- `gi://Gsk?version=4.0`\n- `gi://Gtk?version=3.0`\n- `gi://Gtk?version=4.0`\n- `gi://HarfBuzz?version=0.0`\n- `gi://Pango?version=1.0`\n- `gi://PangoCairo?version=1.0`\n- `gi://Soup?version=2.4`\n- `gi://Soup?version=3.0`\n- `gi://cairo?version=1.0`\n- `gi://freetype2?version=2.0`\n- `gi://xlib?version=2.0`\n\nAdditionally a module declaration for `system` module is included as well as some global functions and variables like `globalThis.print()`, `globalThis.imports`, `globalThis.pkg` etc.\n\n# Use\n\n1. Install this package via npm or yarn\n2. Add this package to the tsconfig.json typeRoots:\n   ```json tsconfig.json\n   {\n     \"compilerOptions\": {\n       \"typeRoots\": [\"node_modules/gjs-esm-types\", \"node_modules/@types\"]\n     }\n   }\n   ```\n3. `gi` imports should now be correctly typed:\n\n   ```ts\n   import Gtk from \"gi://Gtk?version=3.0\";\n\n   const window = new Gtk.Window();\n   // Resolved Type - const window: Gtk.Window;\n   ```\n\n# Imports without version specifier\n\nThis package only provides module declarations for imports with a version specifier. If you want your imports to not include the version, add a `.d.ts` file in your project and define the module declarations in there, similarly to this:\n\n### Example 1 - Gtk\n\n```ts\ndeclare module \"gi://Gtk\" {\n  import Gtk from \"gi://Gtk?version=4.0\";\n  export default Gtk;\n}\n```\n\n### Example 2 - GLib\n\n```ts\ndeclare module \"gi://GLib\" {\n  import GLib from \"gi://GLib?version=2.0\";\n  export default GLib;\n}\n```\n\n### Example 3 - Soup\n\n```ts\ndeclare module \"gi://Soup\" {\n  import Soup from \"gi://Soup?version=2.4\";\n  export default Soup;\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-gjs%2Fgjs-esm-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freact-gjs%2Fgjs-esm-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-gjs%2Fgjs-esm-types/lists"}