Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Typed component props #6477

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@
"engines": {
"node": ">=12.11.0"
}
}
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to pnpm format or pnpm lint:fix

20 changes: 18 additions & 2 deletions packages/core/src/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
import { AllowedComponentProps, ComponentCustomProps, MethodOptions, ObjectEmitsOptions, SlotsType, VNode, VNodeProps, DefineComponent as _DefineComponent } from 'vue';
import {
AllowedComponentProps,
ComponentCustomProps,
ComponentPropsOptions,
EmitsOptions,
EmitsToProps,
ExtractDefaultPropTypes,
ExtractPropTypes,
MethodOptions,
ObjectEmitsOptions,
SlotsType,
VNode,
VNodeProps,
DefineComponent as _DefineComponent
} from 'vue';

declare type PublicProps = VNodeProps & AllowedComponentProps & ComponentCustomProps;

Expand All @@ -14,7 +28,9 @@ export declare type EmitFn<Options = ObjectEmitsOptions, Event extends keyof Opt
}[Event]
>;

export type DefineComponent<P = {}, S = {}, E = {}, M = {}> = _DefineComponent<P, {}, {}, {}, M & MethodOptions, {}, {}, E & ObjectEmitsOptions, string, {}, {}, {}, S & SlotsType>;
type ResolveProps<PropsOrPropOptions, E extends EmitsOptions> = Readonly<PropsOrPropOptions extends ComponentPropsOptions ? ExtractPropTypes<PropsOrPropOptions> : PropsOrPropOptions> & ({} extends E ? {} : EmitsToProps<E>);

export type DefineComponent<P = {}, S = {}, E = {}, M = {}> = _DefineComponent<P, {}, {}, {}, M & MethodOptions, {}, {}, E & ObjectEmitsOptions, string, PublicProps, ResolveProps<P, E & ObjectEmitsOptions>, ExtractDefaultPropTypes<P>, S & SlotsType>;

export type GlobalComponentConstructor<P = {}, S = {}, E = {}, M = {}> = {
new (): {
Expand Down
2 changes: 1 addition & 1 deletion packages/icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@
"engines": {
"node": ">=12.11.0"
}
}
}
2 changes: 1 addition & 1 deletion packages/nuxt-module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@
"engines": {
"node": ">=12.11.0"
}
}
}
2 changes: 1 addition & 1 deletion packages/primevue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -339,4 +339,4 @@
"engines": {
"node": ">=12.11.0"
}
}
}
6 changes: 6 additions & 0 deletions packages/primevue/src/primevue.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,12 @@ export { default as IconField } from './iconfield/IconField.vue';
export * from './iconfield/style/IconFieldStyle.js';
export { default as IconFieldStyle } from './iconfield/style/IconFieldStyle.js';

// IftaLabel
export * from './iftalabel/IftaLabel.vue';
export { default as IftaLabel } from './iftalabel/IftaLabel.vue';
export * from './iftalabel/style/IftaLabelStyle.js';
export { default as IftaLabelStyle } from './iftalabel/style/IftaLabelStyle.js';

Comment on lines +325 to +330
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This came after running pnpm build

// Image
export * from './image/Image.vue';
export { default as Image } from './image/Image.vue';
Expand Down
2 changes: 1 addition & 1 deletion packages/themes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@
"engines": {
"node": ">=12.11.0"
}
}
}