import { PostEntity, PostsArchiveParams, FetchResponse } from '@10up/headless-core';
import { FetchHookOptions } from '@10up/headless-core/react';
/**
* The usePost hook. Returns a collection of post entities
*
* In order to automatically map URL params create a catch-all route named `[[...path]].js`.
* You can create the catch-all at any level e.g: `pages/[[...path]].js`, `pages/blog/[[...path]].js`, etc.
*
* The `pages/blog/[[...path]].js` route for instance would yield a URL like this: `/blog`, `/blog/page/2`, `/blog/category/category-name/page/3`, etc.
*
* The following URL params are supported:
* - Category (/category/category-name)
* - Tag (/tag/tag-name)
* - Author (/author/author-name)
* - Pagination (/page/2)
* - Date (/YYYY/MM/DD)
* - Custom Taxonomy (/taxonomy/term-name)
*
* ### Handling multiple WordPress routes in a single next.js route
*
* The `usePosts` hook is very flexible and can handle multiple WordPress routes in a single next.js route when using the optional-catch-all route (`[[...path]].js`).
* Alongisde with the actual data, `usePosts` also returns information about the current route so you can conditionally load different components.
*
* ```jsx
* const params = { postType: 'post' };
* const Posts = () => {
* const { data, pageType } = usePosts(params);
*
* if (pageType.isAuthorArchive) {
* return
, options?: FetchHookOptions