{"id":28489092,"url":"https://github.com/tiddly-gittly/tw5-typed","last_synced_at":"2025-06-27T19:30:56.526Z","repository":{"id":43472580,"uuid":"414559269","full_name":"tiddly-gittly/TW5-Typed","owner":"tiddly-gittly","description":"TypeScript type definitions for TiddlyWiki5.","archived":false,"fork":false,"pushed_at":"2025-05-07T14:13:08.000Z","size":695,"stargazers_count":13,"open_issues_count":3,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-08T06:39:56.904Z","etag":null,"topics":["plugin-system","tiddlywiki","tiddlywiki-plugin"],"latest_commit_sha":null,"homepage":"https://tiddly-gittly.github.io/TW5-Typed/","language":"TypeScript","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/tiddly-gittly.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,"zenodo":null}},"created_at":"2021-10-07T10:39:35.000Z","updated_at":"2025-05-07T14:13:11.000Z","dependencies_parsed_at":"2024-01-02T19:24:06.795Z","dependency_job_id":"078d89c7-8da5-4a38-adca-b4f6aa315df4","html_url":"https://github.com/tiddly-gittly/TW5-Typed","commit_stats":{"total_commits":138,"total_committers":4,"mean_commits":34.5,"dds":0.1594202898550725,"last_synced_commit":"e1ea4ad752a19ed8a282eb0ead64de2a30c1f444"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/tiddly-gittly/TW5-Typed","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiddly-gittly%2FTW5-Typed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiddly-gittly%2FTW5-Typed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiddly-gittly%2FTW5-Typed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiddly-gittly%2FTW5-Typed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tiddly-gittly","download_url":"https://codeload.github.com/tiddly-gittly/TW5-Typed/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiddly-gittly%2FTW5-Typed/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261583379,"owners_count":23180642,"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":["plugin-system","tiddlywiki","tiddlywiki-plugin"],"created_at":"2025-06-08T06:30:49.164Z","updated_at":"2025-06-27T19:30:56.510Z","avatar_url":"https://github.com/tiddly-gittly.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TW5-Typed\n\nTypeScript type definitions for TiddlyWiki5.\n\n[Doc Site - tiddly-gittly.github.io/TW5-Typed](https://tiddly-gittly.github.io/TW5-Typed/)\n\n## Usage\n\nFirst, install it as dev-dependency:\n\n```sh\nnpm i -D tw5-typed\n```\n\nAdd `tw5-typed` to your `tsconfig.json`'s `compilerOptions`\n\n```json\n{\n  \"compilerOptions\": {\n    \"types\": [\"node\", \"tw5-typed\"] /* Type declaration files to be included in compilation. */\n  }\n}\n```\n\nThen you will have global types like `$tw` automatically. You can import the rest of the types using `import type` statement:\n\n```typescript\nimport type { ISearchOptions, SourceIterator, IFilterOperatorParamOperator } from 'tiddlywiki';\n```\n\n### Alias\n\nSometimes you may want to use a modified version of tw, you can re-export types like this in your `src/type.d.ts`:\n\n```typescript\ndeclare module '@tiddlygit/tiddlywiki' {\n  export * from 'tiddlywiki';\n}\n```\n\n## Development\n\nFirstly, Install eslint using npm:\n\n```sh\nnpm i\n```\n\nYou can add new `*.d.ts` file to contain your types:\n\n1. use `declare module 'tiddlywiki' { }` to wrap all your types.\n1. don't forget to `export` all your types.\n1. to add type for global variable, add `global { }` inside that `declare module 'tiddlywiki' { }`, like `global { var $tw: I$TW; }`\n1. add type import like `/// \u003creference path=\"ast.d.ts\" /\u003e` in the `tw.d.ts`\n\n### Importing type from other files\n\n- add type import like `/// \u003creference path=\"parser.d.ts\" /\u003e`\n- using normal import, like `import { parse } from './parser';` will not work\n\n### Test in your node_modules\n\nTo rapid prototype the type, just right click a type to open `.d.ts` file in the `node_modules`, and try create new file there, and copy to this repo after a success.\n\n### Before publish\n\nMake sure doc build and test are passed.\n\n1. Doc: `pnpm run docs:generate \u0026\u0026 pnpm run docs:dev`, see `.github\\workflows\\deploy-docs-to-github-pages.yml`\n1. Tests: `pnpm run check`, see `.github\\workflows\\test.yml`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiddly-gittly%2Ftw5-typed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiddly-gittly%2Ftw5-typed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiddly-gittly%2Ftw5-typed/lists"}