| 1 |
export const POSTS_ENDPOINT = '/wp/v2/posts' |
| 2 |
|
| 3 |
export interface Post { |
| 4 |
id: number |
| 5 |
date: string | null |
| 6 |
date_gmt?: string | null |
| 7 |
readonly guid?: { rendered: string } |
| 8 |
link: string |
| 9 |
modified?: string |
| 10 |
modified_gmt?: string |
| 11 |
slug: string |
| 12 |
status?: PostStatus |
| 13 |
readonly type: string |
| 14 |
password?: string |
| 15 |
readonly permalink_template?: string |
| 16 |
readonly generated_slug?: string |
| 17 |
title: { rendered: string } |
| 18 |
content?: { |
| 19 |
rendered: string |
| 20 |
protected: boolean |
| 21 |
} |
| 22 |
excerpt: { |
| 23 |
rendered: string |
| 24 |
protected: false |
| 25 |
} |
| 26 |
author: number |
| 27 |
featured_media: number |
| 28 |
comment_status?: 'open' | 'closed' |
| 29 |
ping_status?: 'open' | 'closed' |
| 30 |
format?: PostFormat |
| 31 |
meta?: Record<string, unknown> |
| 32 |
sticky?: boolean |
| 33 |
template?: string |
| 34 |
categories?: number[] |
| 35 |
tags?: number[] |
| 36 |
} |
| 37 |
|
| 38 |
export type PostStatus = 'publish' | 'future' | 'draft' | 'pending' | 'private' |
| 39 |
|
| 40 |
export type PostFormat = |
| 41 |
'standard' | 'aside' | 'chat' | 'gallery' | 'link' | 'image' | 'quote' | 'status' | 'video' | 'audio' |
| 42 |
|
| 43 |
export type Posts = Post[] |
| 44 |
|