{"id":16223120,"url":"https://github.com/zerebos/trilium-types","last_synced_at":"2025-10-26T11:37:06.374Z","repository":{"id":189678780,"uuid":"681019360","full_name":"zerebos/trilium-types","owner":"zerebos","description":"A @types package for Trilium Notes!","archived":false,"fork":false,"pushed_at":"2024-06-12T22:48:57.000Z","size":99,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-06T01:19:51.637Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zerebos.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-08-21T05:02:56.000Z","updated_at":"2024-07-25T01:41:54.000Z","dependencies_parsed_at":"2024-01-14T01:33:49.319Z","dependency_job_id":"9e588c29-39b8-4e0a-9ebd-5e0c8925003b","html_url":"https://github.com/zerebos/trilium-types","commit_stats":null,"previous_names":["rauenzi/trilium-types","zerebos/trilium-types"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zerebos%2Ftrilium-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zerebos%2Ftrilium-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zerebos%2Ftrilium-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zerebos%2Ftrilium-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zerebos","download_url":"https://codeload.github.com/zerebos/trilium-types/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247761048,"owners_count":20991533,"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-10-10T12:17:26.592Z","updated_at":"2025-10-26T11:37:06.265Z","avatar_url":"https://github.com/zerebos.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# trilium-types\n\nA [TypeScript](https://www.typescriptlang.org/) `@types` package for [Trilium Notes](https://github.com/zadam/trilium).\n\n## Installation\n\n```sh\nnpm install @types/trilium@npm:trilium-types\n```\n\n## Usage\n\nThis package keeps up with the latest version of Trilium available, there is not existing table or mapping showing old version of this package that correspond to old version of Trilium.\n\n### TypeScript\n\nThe Trilium frontend `api` will automatically be available in all files since working with the frontend is the most common use-case. You can easily override this with the backend api if needed:\n\n```js\nimport {BackendAPI} from \"trilium/backend\";\n\ndeclare const api: BackendAPI;\n```\n\nOtherwise, all the types should be available under `trilium/frontend`, `trilium/backend`, and `trilium/common`.\n\n### JavaScript\n\nSimilarly to in TypeScript, your IDE (like VSCode) should automatically pick up `api` as the frontend. You can override this using JSDoc syntax. First, make sure your IDE and/or linter are setup to allow an `api` global, then you can do.\n```js\n/**\n * @type {import(\"trilium/backend\").BackendAPI}\n */\nconst api = api;\n```\n\nFor other types, you can follow the same methodology and use the JSDoc syntax with `import`.\n\n\n## Why?\n\nBecause it's nice to have autocompletion and type recognition whether you're using JS or TS.\n\n### Why not [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped/)?\n\nI chose not to try to push this to DefinitelyTyped because I'm still an amateur when it comes to TypeScript and writing custom type definitions. They tend to have a quality requirement that I don't think I would meet.\n\n\n## Links\n\nCheck out my other Trilium-based projects:\n- [Trilium Markdown Preview](https://github.com/rauenzi/Trilium-MarkdownPreview/)\n- [Trilium Breadcrumbs](https://github.com/rauenzi/Trilium-Breadcrumbs)\n\nWant more? Be sure to check out the [Awesome Trilium](https://github.com/Nriver/awesome-trilium) list!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzerebos%2Ftrilium-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzerebos%2Ftrilium-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzerebos%2Ftrilium-types/lists"}