@nuxt/types
Advanced tools
Comparing version 2.16.3 to 2.17.0
278
app/vue.d.ts
@@ -9,3 +9,8 @@ /** | ||
import type { RecordPropsDefinition, ComponentOptions } from 'vue/types/options' | ||
import type { ComponentOptionsMixin } from 'vue/types/v3-component-options' | ||
import type { Data, HasDefined } from 'vue/types/common' | ||
import type { ComponentOptionsMixin, ComputedOptions, ComponentOptionsBase, MethodOptions } from 'vue/types/v3-component-options' | ||
import type { ComponentPropsOptions, ExtractDefaultPropTypes, ExtractPropTypes } from 'vue/types/v3-component-props' | ||
import type { CreateComponentPublicInstance } from 'vue/types/v3-component-public-instance' | ||
import type { DefineComponent } from 'vue/types/v3-define-component' | ||
import type { EmitsOptions } from 'vue/types/v3-setup-context' | ||
import type { CombinedVueInstance } from 'vue/types/vue' | ||
@@ -20,8 +25,146 @@ import type { NuxtRuntimeConfig } from '../config/runtime' | ||
type DefaultComputed = { [key: string]: any } | ||
type DefaultAsyncData<V> = ((this: V, context: Context) => Promise<object | void> | object | void) | ||
type DefaultAsyncData = ((this: never, context: Context) => Promise<object | void> | object | void) | ||
declare module 'vue/types' { | ||
/** | ||
* overload 1: object format with no props | ||
*/ | ||
export function defineComponent< | ||
RawBindings, | ||
D = {}, | ||
C extends ComputedOptions = {}, | ||
M extends MethodOptions = {}, | ||
Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, | ||
Extends extends ComponentOptionsMixin = ComponentOptionsMixin, | ||
Emits extends EmitsOptions = {}, | ||
EmitsNames extends string = string, | ||
AsyncData extends DefaultAsyncData = DefaultAsyncData, | ||
>( | ||
options: { functional?: never } & ComponentOptionsWithoutPropsAndWithAsyncData< | ||
{}, | ||
RawBindings, | ||
D, | ||
C, | ||
M, | ||
Mixin, | ||
Extends, | ||
Emits, | ||
EmitsNames, | ||
AsyncData | ||
> | ||
): DefineComponent< | ||
{}, | ||
RawBindings, | ||
Merged<D, Awaited<ReturnType<AsyncData>>>, | ||
C, | ||
M, | ||
Mixin, | ||
Extends, | ||
Emits | ||
> | ||
/** | ||
* overload 2: object format with array props declaration | ||
* props inferred as `{ [key in PropNames]?: any }` | ||
* | ||
* return type is for Vetur and TSX support | ||
*/ | ||
export function defineComponent< | ||
PropNames extends string, | ||
RawBindings = {}, | ||
D = {}, | ||
C extends ComputedOptions = {}, | ||
M extends MethodOptions = {}, | ||
Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, | ||
Extends extends ComponentOptionsMixin = ComponentOptionsMixin, | ||
Emits extends EmitsOptions = {}, | ||
EmitsNames extends string = string, | ||
PropsOptions extends ComponentPropsOptions = ComponentPropsOptions, | ||
AsyncData extends DefaultAsyncData = DefaultAsyncData, | ||
>( | ||
options: { functional?: never } & ComponentOptionsWithArrayPropsAndAsyncData< | ||
PropNames, | ||
RawBindings, | ||
D, | ||
C, | ||
M, | ||
Mixin, | ||
Extends, | ||
Emits, | ||
EmitsNames, | ||
Readonly<{ [key in PropNames]?: any }>, | ||
AsyncData | ||
> | ||
): DefineComponent< | ||
Readonly<{ [key in PropNames]?: any }>, | ||
RawBindings, | ||
Merged<D, Awaited<ReturnType<AsyncData>>>, | ||
C, | ||
M, | ||
Mixin, | ||
Extends, | ||
Emits | ||
> | ||
/** | ||
* overload 3: object format with object props declaration | ||
* | ||
* see `ExtractPropTypes` in './componentProps.ts' | ||
*/ | ||
export function defineComponent< | ||
Props, | ||
RawBindings = {}, | ||
D = {}, | ||
C extends ComputedOptions = {}, | ||
M extends MethodOptions = {}, | ||
Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, | ||
Extends extends ComponentOptionsMixin = ComponentOptionsMixin, | ||
Emits extends EmitsOptions = {}, | ||
EmitsNames extends string = string, | ||
PropsOptions extends ComponentPropsOptions = ComponentPropsOptions, | ||
AsyncData extends DefaultAsyncData = DefaultAsyncData, | ||
>( | ||
options: HasDefined<Props> extends true | ||
? { functional?: never } & ComponentOptionsWithPropsAndAsyncData< | ||
PropsOptions, | ||
RawBindings, | ||
D, | ||
C, | ||
M, | ||
Mixin, | ||
Extends, | ||
Emits, | ||
EmitsNames, | ||
Props, | ||
ExtractDefaultPropTypes<PropsOptions>, | ||
AsyncData | ||
> | ||
: { functional?: never } & ComponentOptionsWithPropsAndAsyncData< | ||
PropsOptions, | ||
RawBindings, | ||
D, | ||
C, | ||
M, | ||
Mixin, | ||
Extends, | ||
Emits, | ||
EmitsNames, | ||
ExtractPropTypes<PropsOptions>, | ||
AsyncData | ||
> | ||
): DefineComponent< | ||
PropsOptions, | ||
RawBindings, | ||
Merged<D, Awaited<ReturnType<AsyncData>>>, | ||
C, | ||
M, | ||
Mixin, | ||
Extends, | ||
Emits | ||
> | ||
} | ||
declare module 'vue/types/options' { | ||
interface ComponentOptions< | ||
V extends Vue, | ||
/* eslint-disable no-unused-vars,@typescript-eslint/no-unused-vars */ | ||
Data = DefaultData<V>, | ||
@@ -35,6 +178,4 @@ Methods = DefaultMethods<V>, | ||
Extends extends ComponentOptionsMixin = ComponentOptionsMixin, | ||
/* eslint-enable no-unused-vars,@typescript-eslint/no-unused-vars */ | ||
AsyncData = DefaultAsyncData<V> | ||
AsyncData = DefaultAsyncData | ||
> { | ||
// eslint-disable-next-line @typescript-eslint/ban-types | ||
asyncData?: AsyncData | ||
@@ -73,3 +214,3 @@ fetch?(ctx: Context): Promise<void> | void | ||
Extends extends ComponentOptionsMixin, | ||
AsyncData extends DefaultAsyncData<V> = DefaultAsyncData<V> | ||
AsyncData extends DefaultAsyncData = DefaultAsyncData | ||
> = object & | ||
@@ -109,3 +250,3 @@ ComponentOptions< | ||
Extends extends ComponentOptionsMixin, | ||
AsyncData extends DefaultAsyncData<V> | ||
AsyncData extends DefaultAsyncData | ||
> = object & | ||
@@ -159,3 +300,3 @@ ComponentOptions< | ||
Extends extends ComponentOptionsMixin = ComponentOptionsMixin, | ||
AsyncData extends DefaultAsyncData<V> = DefaultAsyncData<V> | ||
AsyncData extends DefaultAsyncData = DefaultAsyncData | ||
>( | ||
@@ -193,3 +334,3 @@ options?: ThisTypedComponentOptionsWithArrayPropsAndAsyncData< | ||
Extends extends ComponentOptionsMixin = ComponentOptionsMixin, | ||
AsyncData extends DefaultAsyncData<V> = DefaultAsyncData<V> | ||
AsyncData extends DefaultAsyncData = DefaultAsyncData | ||
>( | ||
@@ -219,1 +360,118 @@ options?: ThisTypedComponentOptionsWithRecordPropsAndAsyncData< | ||
} | ||
export type ComponentOptionsWithPropsAndAsyncData< | ||
PropsOptions = ComponentPropsOptions, | ||
RawBindings = Data, | ||
D = Data, | ||
C extends ComputedOptions = {}, | ||
M extends MethodOptions = {}, | ||
Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, | ||
Extends extends ComponentOptionsMixin = ComponentOptionsMixin, | ||
Emits extends EmitsOptions = {}, | ||
EmitsNames extends string = string, | ||
Props = ExtractPropTypes<PropsOptions>, | ||
Defaults = ExtractDefaultPropTypes<PropsOptions>, | ||
AsyncData extends DefaultAsyncData = DefaultAsyncData, | ||
> = ComponentOptionsBase< | ||
Props, | ||
RawBindings, | ||
D, | ||
C, | ||
M, | ||
Mixin, | ||
Extends, | ||
Emits, | ||
EmitsNames, | ||
Defaults | ||
> & { | ||
props?: PropsOptions, | ||
asyncData: AsyncData, | ||
} & ThisType< | ||
CreateComponentPublicInstance< | ||
Props, | ||
RawBindings, | ||
Merged<D, Awaited<ReturnType<AsyncData>>>, | ||
C, | ||
M, | ||
Mixin, | ||
Extends, | ||
Emits | ||
> | ||
> | ||
export type ComponentOptionsWithArrayPropsAndAsyncData< | ||
PropNames extends string = string, | ||
RawBindings = Data, | ||
D = Data, | ||
C extends ComputedOptions = {}, | ||
M extends MethodOptions = {}, | ||
Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, | ||
Extends extends ComponentOptionsMixin = ComponentOptionsMixin, | ||
Emits extends EmitsOptions = {}, | ||
EmitsNames extends string = string, | ||
Props = Readonly<{ [key in PropNames]?: any }>, | ||
AsyncData extends DefaultAsyncData = DefaultAsyncData, | ||
> = ComponentOptionsBase< | ||
Props, | ||
RawBindings, | ||
D, | ||
C, | ||
M, | ||
Mixin, | ||
Extends, | ||
Emits, | ||
EmitsNames, | ||
{} | ||
> & { | ||
props?: PropNames[], | ||
asyncData: AsyncData, | ||
} & ThisType< | ||
CreateComponentPublicInstance< | ||
Props, | ||
RawBindings, | ||
Merged<D, Awaited<ReturnType<AsyncData>>>, | ||
C, | ||
M, | ||
Mixin, | ||
Extends, | ||
Emits | ||
> | ||
> | ||
export type ComponentOptionsWithoutPropsAndWithAsyncData< | ||
Props = {}, | ||
RawBindings = Data, | ||
D = Data, | ||
C extends ComputedOptions = {}, | ||
M extends MethodOptions = {}, | ||
Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, | ||
Extends extends ComponentOptionsMixin = ComponentOptionsMixin, | ||
Emits extends EmitsOptions = {}, | ||
EmitsNames extends string = string, | ||
AsyncData extends DefaultAsyncData = DefaultAsyncData, | ||
> = ComponentOptionsBase< | ||
Props, | ||
RawBindings, | ||
D, | ||
C, | ||
M, | ||
Mixin, | ||
Extends, | ||
Emits, | ||
EmitsNames, | ||
{} | ||
> & { | ||
props?: undefined, | ||
asyncData: AsyncData, | ||
} & ThisType< | ||
CreateComponentPublicInstance< | ||
Props, | ||
RawBindings, | ||
Merged<D, Awaited<ReturnType<AsyncData>>>, | ||
C, | ||
M, | ||
Mixin, | ||
Extends, | ||
Emits | ||
> | ||
> |
@@ -37,2 +37,3 @@ /** | ||
hashAlgorithm?: string | ||
generateNonce?: boolean | ||
policies?: Partial<Record<CspPolicyName, string[]>> | ||
@@ -39,0 +40,0 @@ reportOnly?: boolean |
{ | ||
"name": "@nuxt/types", | ||
"version": "2.16.3", | ||
"version": "2.17.0", | ||
"description": "Nuxt types", | ||
@@ -14,3 +14,3 @@ "repository": "nuxt/nuxt.js", | ||
"dependencies": { | ||
"@types/babel__core": "7.20.0", | ||
"@types/babel__core": "7.20.1", | ||
"@types/compression": "1.7.2", | ||
@@ -32,3 +32,3 @@ "@types/connect": "3.4.35", | ||
"engines": { | ||
"node": "^14.18.0 || ^16.10.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" | ||
"node": "^14.18.0 || >=16.10.0" | ||
}, | ||
@@ -35,0 +35,0 @@ "publishConfig": { |
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
56512
1741
+ Added@types/babel__core@7.20.1(transitive)
- Removed@types/babel__core@7.20.0(transitive)
Updated@types/babel__core@7.20.1