diff --git a/types/index.d.ts b/types/index.d.ts index 30f599f..3e6a053 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -104,6 +104,12 @@ interface NuxtHTTPInstance { $delete(url: Request | URL | string, options?: Options): Promise; + /** + * Set the baseURL for all subsequent requests. + * @param baseURL - the base URL (e.g. `https://myapi.com/`) + */ + setBaseURL(baseURL: string): void + /** * Set a header on all subsequent requests. * @param name - Header name. @@ -146,6 +152,11 @@ interface NuxtHTTPInstance { * This hook enables you to globally handle request errors. */ onError(hook: (error: ky.HTTPError) => void): void + + /** + * If you need to create your own ky instance which based on $http defaults, you can use the create(options) method. + */ + create(options: Partial): NuxtHTTPInstance } declare module '@nuxt/vue-app' {