File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -642,24 +642,32 @@ type Variant = (typeof VARIANTS)[number];
642642 * @param title The title of the component.
643643 * @param description The description of the component.
644644 * @param category The category of the component.
645+ * @param categories Organize the component into multiple categories.
646+ * @param meta Optional meta data for the component.
647+ * @param variants The variants of the component that are available through the registry (default: all variants)
645648 * @returns An array of RegistryItem objects.
646649 */
647650function defineComponent ( {
648651 title,
649652 description,
650653 category,
654+ categories,
655+ meta,
651656 variants = [ 'JS-CSS' , 'JS-TW' , 'TS-CSS' , 'TS-TW' ]
652657} : {
653658 title : string ;
654659 description : string ;
655660 category : Category ;
661+ categories ?: string [ ] ;
662+ meta ?: Record < string , string > ;
656663 variants ?: readonly Variant [ ] ;
657664} ) : RegistryItem [ ] {
658665 const baseItem : Omit < RegistryItem , 'files' | 'name' > = {
659666 title,
660667 description,
661668 type : 'registry:component' ,
662- categories : [ category ]
669+ categories : [ category , ...( categories ?? [ ] ) ] ,
670+ meta
663671 } ;
664672
665673 // this might warrant a bit of explanation
You can’t perform that action at this time.
0 commit comments