{"version":"2.1.271","anchor":"plugin-types-command-now-also-emits-claude-code-pluginsdts","canonical_anchor":"new-plugin-type-contract-validator-and-claude-code-pluginsd","heading":"Plugins can now declare TypeScript type contracts for \/plugin-types","tier":"use","area":"Plugins","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.271\/e\/plugin-types-command-now-also-emits-claude-code-pluginsdts","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.271","markdown":"### Plugins can now declare TypeScript type contracts for \/plugin-types\n\nPlugins can declare a validated `types` file describing what they add, generated into a new claude-code-plugins.d.ts\n\n**What**\n\n- Plugin manifests (`plugin.json`) can now declare a `types` field pointing at a `.d.ts` file that describes the plugin's type contract: what it adds to the shared `$` object via `engine.create` and declares on `EngineInterface`. The path must end in `.d.ts` and stay inside the plugin directory.\n\n- A new validator strictly checks the declared type contract: it rejects imports\/requires\/references, runnable code, stray tokens, non-ASCII or control characters, `@ts-` pragmas, and anything other than `declare module 'claude-code' { ... }` or type\/interface exports.\n\n- Valid contracts are copied into a `claude-code-plugins\/` folder and referenced from a generated `claude-code-plugins.d.ts` file.\n\n- The `\/plugin-types` command now writes this `claude-code-plugins.d.ts` file in addition to the existing `claude-code.d.ts` and `claude-code-mcp.d.ts`.\n\n- Plugin validation also reports, as a warning, which members of the plugin's declared interface it exposes on `$`.\n\n**Why**\n\nThis lets plugin authors declare and get type-checking for the custom functionality their plugin adds, with `\/plugin-types` generating declaration files that editors and tooling can use for autocomplete and validation.\n\n- Area: Plugins\n- Names: `\/plugin-types`\n- Tier: Use it now\n- Useful: 4\/5\n- Signal: 3\/5"}