UNPKG

1.31 kBTypeScriptView Raw
1import { Configuration } from '@nuxt/types'
2import { RequestPromiseOptions } from 'request-promise-native'
3
4export type BeforeNuxtReadyFn = (nuxt: any /*TBD*/) => Promise<void>
5
6export const init: (
7 config: Configuration,
8 options?: { beforeNuxtReady?: BeforeNuxtReadyFn }
9) => Promise<any /*TBD*/>
10
11export const build: (
12 config: Configuration,
13 options?: {
14 waitFor?: number
15 beforeNuxtReady?: BeforeNuxtReadyFn
16 }
17) => Promise<{ nuxt: any /*TBD*/; builder: any /*TBD*/ }>
18
19export const generate: (
20 config: Configuration,
21 options?: { build?: boolean; init?: boolean },
22 initOptions?: { beforeNuxtReady?: BeforeNuxtReadyFn }
23) => Promise<{
24 nuxt: any /*TBD*/
25 builder: any /*TBD*/
26 generator: any /*TBD*/
27}>
28
29export const loadConfig: (
30 dir: string,
31 fixture?: string,
32 override?: Configuration,
33 options?: { merge?: boolean }
34) => Configuration
35
36export const setup: (
37 config: Configuration,
38 options?: {
39 port?: number
40 waitFor?: number
41 beforeNuxtReady?: BeforeNuxtReadyFn
42 }
43) => Promise<{ nuxt: any /*TBD*/; builder: any /*TBD*/ }>
44
45export const generatePort: (port?: number) => Promise<number>
46
47export type GetRequest<T = any> = (path: string, options?: RequestPromiseOptions) => Promise<T>
48export const get: GetRequest
49
50export const url: (path?: string) => string