vue-component-type-helpers
Advanced tools
Comparing version 1.7.12 to 1.7.13
@@ -5,4 +5,9 @@ declare const text: string; | ||
export type ComponentType<T> = | ||
T extends new () => {} ? 1 : | ||
T extends (...args: any) => any ? 2 : | ||
0; | ||
export type ComponentProps<T> = | ||
T extends new () => { $props: infer P } ? NonNullable<P> : | ||
T extends new () => { $props: infer P; } ? NonNullable<P> : | ||
T extends (props: infer P, ...args: any) => any ? P : | ||
@@ -12,9 +17,9 @@ {}; | ||
export type ComponentSlots<T> = | ||
T extends new () => { $slots: infer S } ? NonNullable<S> : | ||
T extends (props: any, ctx: { slots: infer S }, ...args: any) => any ? NonNullable<S> : | ||
T extends new () => { $slots: infer S; } ? NonNullable<S> : | ||
T extends (props: any, ctx: { slots: infer S; }, ...args: any) => any ? NonNullable<S> : | ||
{}; | ||
export type ComponentEmit<T> = | ||
T extends new () => { $emit: infer E } ? NonNullable<E> : | ||
T extends (props: any, ctx: { emit: infer E }, ...args: any) => any ? NonNullable<E> : | ||
T extends new () => { $emit: infer E; } ? NonNullable<E> : | ||
T extends (props: any, ctx: { emit: infer E; }, ...args: any) => any ? NonNullable<E> : | ||
{}; | ||
@@ -24,3 +29,3 @@ | ||
T extends new () => infer E ? E : | ||
T extends (props: any, ctx: { expose(exposed: infer E): any }, ...args: any) => any ? NonNullable<E> : | ||
T extends (props: any, ctx: { expose(exposed: infer E): any; }, ...args: any) => any ? NonNullable<E> : | ||
{}; | ||
@@ -33,4 +38,4 @@ | ||
export type Vue2ComponentSlots<T> = | ||
T extends new () => { $scopedSlots: infer S } ? NonNullable<S> : | ||
T extends (props: any, ctx: { slots: infer S }, ...args: any) => any ? NonNullable<S> : | ||
T extends new () => { $scopedSlots: infer S; } ? NonNullable<S> : | ||
T extends (props: any, ctx: { slots: infer S; }, ...args: any) => any ? NonNullable<S> : | ||
{}; |
35
index.js
exports.default = ` | ||
type ComponentProps<T> = | ||
T extends new () => { $props: infer P } ? NonNullable<P> : | ||
export type ComponentType<T> = | ||
T extends new () => {} ? 1 : | ||
T extends (...args: any) => any ? 2 : | ||
0; | ||
export type ComponentProps<T> = | ||
T extends new () => { $props: infer P; } ? NonNullable<P> : | ||
T extends (props: infer P, ...args: any) => any ? P : | ||
{}; | ||
type ComponentSlots<T> = | ||
T extends new () => { $slots: infer S } ? NonNullable<S> : | ||
T extends (props: any, ctx: { slots: infer S }, ...args: any) => any ? NonNullable<S> : | ||
export type ComponentSlots<T> = | ||
T extends new () => { $slots: infer S; } ? NonNullable<S> : | ||
T extends (props: any, ctx: { slots: infer S; }, ...args: any) => any ? NonNullable<S> : | ||
{}; | ||
type ComponentEmit<T> = | ||
T extends new () => { $emit: infer E } ? NonNullable<E> : | ||
T extends (props: any, ctx: { emit: infer E }, ...args: any) => any ? NonNullable<E> : | ||
export type ComponentEmit<T> = | ||
T extends new () => { $emit: infer E; } ? NonNullable<E> : | ||
T extends (props: any, ctx: { emit: infer E; }, ...args: any) => any ? NonNullable<E> : | ||
{}; | ||
type ComponentExposed<T> = | ||
export type ComponentExposed<T> = | ||
T extends new () => infer E ? E : | ||
T extends (props: any, ctx: { expose(exposed: infer E): any }, ...args: any) => any ? NonNullable<E> : | ||
T extends (props: any, ctx: { expose(exposed: infer E): any; }, ...args: any) => any ? NonNullable<E> : | ||
{}; | ||
/** | ||
* Vue 2.x | ||
*/ | ||
* Vue 2.x | ||
*/ | ||
type Vue2ComponentSlots<T> = | ||
T extends new () => { $scopedSlots: infer S } ? NonNullable<S> : | ||
T extends (props: any, ctx: { slots: infer S }, ...args: any) => any ? NonNullable<S> : | ||
export type Vue2ComponentSlots<T> = | ||
T extends new () => { $scopedSlots: infer S; } ? NonNullable<S> : | ||
T extends (props: any, ctx: { slots: infer S; }, ...args: any) => any ? NonNullable<S> : | ||
{}; | ||
`.trim(); |
{ | ||
"name": "vue-component-type-helpers", | ||
"version": "1.7.12", | ||
"version": "1.7.13", | ||
"license": "MIT", | ||
@@ -14,3 +14,3 @@ "files": [ | ||
}, | ||
"gitHead": "9e712c2d603c690cd03502f5ec1a99bd80b800ac" | ||
"gitHead": "32d5d5e4414f97b0dc28cd727a9cecf60acd4e97" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4199
58