Skip to content

Commit

Permalink
feat: support custom return types by the fetch method (#42)
Browse files Browse the repository at this point in the history
It's possible that we know what kind of data will be returned by the fetch method. So it would be useful to be able to edit the type of the information returned.
  • Loading branch information
juliomrqz committed May 25, 2020
1 parent 559843b commit 9c11915
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions types/index.d.ts
Expand Up @@ -8,7 +8,7 @@ interface NuxtContentInstance {
surround(slug: String, options?: Object): NuxtContentInstance
limit(n: Number | String): NuxtContentInstance
skip(n: Number | String): NuxtContentInstance
fetch(): Result | Result[]
fetch<T = Result | Result[]>(): T
}

type Result = (Object[] & {
Expand All @@ -32,4 +32,4 @@ declare module 'vue/types/vue' {
interface Vue {
$content(...args: String[]): NuxtContentInstance
}
}
}

0 comments on commit 9c11915

Please sign in to comment.