Skip to content

Commit 1f7ad56

Browse files
authored
docs: move type after usage
1 parent c5cfbf8 commit 1f7ad56

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

docs/content/docs/4.utils/4.query-collection-search-sections.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,6 @@ description: The queryCollectionSearchSections composable generates searchable
44
sections from a collection for enhanced content discovery.
55
---
66

7-
## Type
8-
9-
```ts
10-
function queryCollectionSearchSections(collection: keyof Collections, opts?: { ignoredTags: string[] }): ChainablePromise<T, Section[]>
11-
12-
interface ChainablePromise<T extends keyof PageCollections, R> extends Promise<R> {
13-
where(field: keyof PageCollections[T] | string, operator: SQLOperator, value?: unknown): ChainablePromise<T, R>
14-
andWhere(groupFactory: QueryGroupFunction<PageCollections[T]>): ChainablePromise<T, R>
15-
orWhere(groupFactory: QueryGroupFunction<PageCollections[T]>): ChainablePromise<T, R>
16-
order(field: keyof PageCollections[T], direction: 'ASC' | 'DESC'): ChainablePromise<T, R>
17-
}
18-
```
19-
207
## Usage
218

229
Use the auto-imported `queryCollectionSearchSections` to generate searchable sections from a specific collection. This is particularly useful for creating advanced search functionality or content discovery features in your application.
@@ -33,6 +20,18 @@ const { data: sections } = await useAsyncData('search-sections', () => {
3320
The `queryCollectionSearchSections` utility is available in both Vue and Nitro. Checkout [Server Usage](#server-usage) for more details on how to use it on the server side.
3421
::
3522

23+
## Type
24+
25+
```ts
26+
function queryCollectionSearchSections(collection: keyof Collections, opts?: { ignoredTags: string[] }): ChainablePromise<T, Section[]>
27+
28+
interface ChainablePromise<T extends keyof PageCollections, R> extends Promise<R> {
29+
where(field: keyof PageCollections[T] | string, operator: SQLOperator, value?: unknown): ChainablePromise<T, R>
30+
andWhere(groupFactory: QueryGroupFunction<PageCollections[T]>): ChainablePromise<T, R>
31+
orWhere(groupFactory: QueryGroupFunction<PageCollections[T]>): ChainablePromise<T, R>
32+
order(field: keyof PageCollections[T], direction: 'ASC' | 'DESC'): ChainablePromise<T, R>
33+
}
34+
```
3635

3736
## API
3837

0 commit comments

Comments
 (0)