@nuxt/docs-nightly 5.0.0-29778506.75ed8ed2 → 5.0.0-29778625.7e4a0779
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/4.api/5.kit/12.nitro.md
CHANGED
|
@@ -200,7 +200,7 @@ You can read more about Nitro plugins in the [Nitro documentation](https://nitro
|
|
|
200
200
|
::
|
|
201
201
|
|
|
202
202
|
::warning
|
|
203
|
-
It is necessary to explicitly import `definePlugin` from
|
|
203
|
+
It is necessary to explicitly import `definePlugin` from `nitro` within your plugin file. The same requirement applies to utilities such as `useRuntimeConfig`.
|
|
204
204
|
::
|
|
205
205
|
|
|
206
206
|
### Usage
|
|
@@ -330,7 +330,7 @@ export default defineNuxtModule({
|
|
|
330
330
|
### Type
|
|
331
331
|
|
|
332
332
|
```ts
|
|
333
|
-
function addServerImports (dirs:
|
|
333
|
+
function addServerImports (dirs: NuxtImport | NuxtImport[]): void
|
|
334
334
|
```
|
|
335
335
|
|
|
336
336
|
### Parameters
|
|
@@ -31,14 +31,14 @@ export default defineNuxtModule({
|
|
|
31
31
|
### Type
|
|
32
32
|
|
|
33
33
|
```ts
|
|
34
|
-
function useLogger (tag?: string, options?:
|
|
34
|
+
function useLogger (tag?: string, options?: NuxtLoggerOptions): NuxtLogger
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
### Parameters
|
|
38
38
|
|
|
39
39
|
**`tag`**: A tag to suffix all log messages with, displayed on the right near the timestamp.
|
|
40
40
|
|
|
41
|
-
**`options`**:
|
|
41
|
+
**`options`**: Logger options, such as `level`, `reporters`, `defaults` and `formatOptions`.
|
|
42
42
|
|
|
43
43
|
### Example
|
|
44
44
|
|
|
@@ -55,7 +55,7 @@ export default defineNuxtModule({
|
|
|
55
55
|
### Type
|
|
56
56
|
|
|
57
57
|
```ts
|
|
58
|
-
function addImports (imports:
|
|
58
|
+
function addImports (imports: NuxtImport | NuxtImport[]): void
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
### Parameters
|
|
@@ -138,22 +138,22 @@ export default defineNuxtModule({
|
|
|
138
138
|
### Type
|
|
139
139
|
|
|
140
140
|
```ts
|
|
141
|
-
function addImportsSources (importSources:
|
|
141
|
+
function addImportsSources (importSources: NuxtImportPresetSource | NuxtImportPresetSource[]): void
|
|
142
142
|
```
|
|
143
143
|
|
|
144
144
|
### Parameters
|
|
145
145
|
|
|
146
146
|
**importSources**: An object or an array of objects with the following properties:
|
|
147
147
|
|
|
148
|
-
-
|
|
148
|
+
- `NuxtImportPreset`
|
|
149
149
|
|
|
150
|
-
| Property | Type
|
|
151
|
-
|
|
152
|
-
| `from` | `string`
|
|
153
|
-
| `imports` | `
|
|
150
|
+
| Property | Type | Required | Description |
|
|
151
|
+
|-----------|------------------------------------------------------|----------|-----------------------------------------------------------------------------------|
|
|
152
|
+
| `from` | `string` | `true` | Module specifier to import from. |
|
|
153
|
+
| `imports` | `(NuxtImportEntry \| NuxtImportPreset)[]`{lang="ts"} | `true` | An array of entries, which can be import names, import objects or nested presets. |
|
|
154
154
|
|
|
155
|
-
-
|
|
155
|
+
- `NuxtPackageImportPreset`
|
|
156
156
|
|
|
157
|
-
| Property | Type
|
|
158
|
-
|
|
159
|
-
| `package` | `string`
|
|
157
|
+
| Property | Type | Required | Description |
|
|
158
|
+
|-----------|----------|----------|----------------------|
|
|
159
|
+
| `package` | `string` | `true` | Name of the package. |
|
package/4.api/5.kit/6.context.md
CHANGED
|
@@ -47,10 +47,10 @@ The `useNuxt` function returns the Nuxt instance, which contains all the options
|
|
|
47
47
|
| Property | Type | Description |
|
|
48
48
|
| ---------- | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
|
|
49
49
|
| `options` | `NuxtOptions` | The resolved Nuxt configuration. |
|
|
50
|
-
| `hooks` | `
|
|
50
|
+
| `hooks` | `NuxtHookRegistry<NuxtHooks>` | The Nuxt hook system. Allows registering and listening to lifecycle events. |
|
|
51
51
|
| `hook` | `(name: string, (...args: any[]) => Promise<void> \| void) => () => void` | Shortcut for `nuxt.hooks.hook`. Registers a single callback for a specific lifecycle hook. |
|
|
52
52
|
| `callHook` | `(name: string, ...args: any[]) => Promise<any>` | Shortcut for `nuxt.hooks.callHook`. Triggers a lifecycle hook manually and runs all registered callbacks. |
|
|
53
|
-
| `addHooks` | `(configHooks:
|
|
53
|
+
| `addHooks` | `(configHooks: NuxtNestedHooks) => () => void` | Shortcut for `nuxt.hooks.addHooks`. Registers multiple hooks at once. |
|
|
54
54
|
|
|
55
55
|
### Example
|
|
56
56
|
|