{"_id":"vue-component-type-helpers@3.3.11","bugs":{"url":"https://github.com/vuejs/language-tools/issues"},"dist":{"shasum":"b2f683937e744cf5724c614955dff9bc32342fb4","tarball":"http://registry-npm.ywwl.com/vue-component-type-helpers/download/vue-component-type-helpers-3.3.11.tgz","fileCount":5,"integrity":"sha512-LwcxzeliO9fkQcpJG0PoX8X5kmAhKmH9wkpDLxNabwzkQ9Zeib2YVHwFV4pcWmMLfXVfjr/dSV+DaJ3cIPgSNA==","signatures":[{"sig":"MEUCIDkozllTrUBi90St8lfvHn+xQRY6V2ihTTYqtzGn1MziAiEA9L2Z4JkFHeEeOUFv/9vEJLmdaY365sd7m0W9q7JuPos=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIA8AI+ANAG4yS9DJK+TslmPQDSfQNbq++nd7whJxIxf/AiEApGra1TjdXlIwNtqK9Vi3C/Dtas0fAdEW44+yufvsa9k="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/vue-component-type-helpers@3.3.11","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":5632,"size":2211,"noattachment":false,"key":"/vue-component-type-helpers/-/vue-component-type-helpers-3.3.11.tgz"},"name":"vue-component-type-helpers","types":"./index.d.ts","gitHead":"f521b39b402ebaaa9ee70faf5a60a895544ed9e9","license":"MIT","version":"3.3.11","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:cae60a83-18dd-4aa3-8cbd-238c9c5d29e3"}},"homepage":"https://github.com/vuejs/language-tools#readme","repository":{"url":"git+https://github.com/vuejs/language-tools.git","type":"git","directory":"packages/component-type-helpers"},"_npmVersion":"lerna/5.6.0/node@v24.19.0+x64 (linux)","description":"<p>   <a href=\"https://www.npmjs.com/package/vue-component-type-helpers\"><img src=\"https://img.shields.io/npm/v/vue-component-type-helpers.svg?labelColor=18181B&color=1584FC\" alt=\"NPM version\"></a>   <a href=\"https://github.com/vuejs/language-tools/blob/m","directories":{},"maintainers":[{"name":"johnsoncodehk","email":"johnsoncodehk@gmail.com"},{"name":"kazariex","email":"mimorimaboroshi@gmail.com"}],"sideEffects":false,"_nodeVersion":"24.19.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/vue-component-type-helpers_3.3.11_1787306894990_0.13138786929878843"},"readme":"# vue-component-type-helpers\n\n<p>\n  <a href=\"https://www.npmjs.com/package/vue-component-type-helpers\"><img src=\"https://img.shields.io/npm/v/vue-component-type-helpers.svg?labelColor=18181B&color=1584FC\" alt=\"NPM version\"></a>\n  <a href=\"https://github.com/vuejs/language-tools/blob/master/LICENSE\"><img src=\"https://img.shields.io/github/license/vuejs/language-tools.svg?labelColor=18181B&color=1584FC\" alt=\"License\"></a>\n</p>\n\nHelper utilities for extracting types such as props, slots, attrs, emit, and exposed from Vue component types. No runtime dependencies; provides TypeScript type definitions only.\n\n## Installation\n\n```bash\nnpm install vue-component-type-helpers\n```\n\n## Type Helpers\n\n### `ComponentProps<T>`\n\nExtracts the props type of a component.\n\n```typescript\nimport type { ComponentProps } from 'vue-component-type-helpers';\nimport MyComponent from './MyComponent.vue';\n\ntype Props = ComponentProps<typeof MyComponent>;\n```\n\n### `ComponentSlots<T>`\n\nExtracts the slots type of a component.\n\n```typescript\nimport type { ComponentSlots } from 'vue-component-type-helpers';\nimport MyComponent from './MyComponent.vue';\n\ntype Slots = ComponentSlots<typeof MyComponent>;\n```\n\n### `ComponentAttrs<T>`\n\nExtracts the attrs type of a component.\n\n```typescript\nimport type { ComponentAttrs } from 'vue-component-type-helpers';\nimport MyComponent from './MyComponent.vue';\n\ntype Attrs = ComponentAttrs<typeof MyComponent>;\n```\n\n### `ComponentEmit<T>`\n\nExtracts the emit function type of a component.\n\n```typescript\nimport type { ComponentEmit } from 'vue-component-type-helpers';\nimport MyComponent from './MyComponent.vue';\n\ntype Emit = ComponentEmit<typeof MyComponent>;\n```\n\n### `ComponentExposed<T>`\n\nExtracts the instance type exposed via `defineExpose`.\n\n```typescript\nimport type { ComponentExposed } from 'vue-component-type-helpers';\nimport MyComponent from './MyComponent.vue';\n\ntype Exposed = ComponentExposed<typeof MyComponent>;\n```\n\n## Example\n\nGiven the following component:\n\n```vue\n<!-- MyComponent.vue -->\n<script setup lang=\"ts\">\ndefineProps<{\n  title: string;\n  count?: number;\n}>();\n\ndefineEmits<{\n  update: [value: string];\n  close: [];\n}>();\n\ndefineSlots<{\n  default(props: { item: string }): any;\n  header(): any;\n}>();\n\nconst internalState = ref(0);\ndefineExpose({\n  reset: () => { internalState.value = 0; },\n});\n</script>\n```\n\nUsing type helpers:\n\n```typescript\nimport type { ComponentProps, ComponentSlots, ComponentEmit, ComponentExposed } from 'vue-component-type-helpers';\nimport MyComponent from './MyComponent.vue';\n\ntype Props = ComponentProps<typeof MyComponent>;\n// { title: string; count?: number }\n\ntype Slots = ComponentSlots<typeof MyComponent>;\n// { default(props: { item: string }): any; header(): any }\n\ntype Emit = ComponentEmit<typeof MyComponent>;\n// { (e: 'update', value: string): void; (e: 'close'): void }\n\ntype Exposed = ComponentExposed<typeof MyComponent>;\n// { reset: () => void }\n```\n\n## License\n\n[MIT](https://github.com/vuejs/language-tools/blob/master/LICENSE) License\n","publish_time":1787306895107,"_cnpm_publish_time":1787306895107,"dist-tags":{"latest":"3.3.13","v3.0":"3.0.11"}}