import { getPost, requireRecord, requireStringField } from './client.ts'
import type { GetPostInput } from './client.ts'
/**
* Read one Reddit post and its comment tree.
* @param params.id - `t3_…` fullname or the bare post id.
* @example
* import getPost from 'kody:@kody/reddit/get-post'
* const thread = await getPost({ id: 'abc123', commentLimit: 10 })
* // => { post: { title: '...', permalink: '...' }, comments: [{ author, body, score }] }
*/
export default async function getPostEntrypoint(
params: Partial<GetPostInput> & Record<string, unknown> = {},
) {
const input = requireRecord(params, 'get-post')
requireStringField(input, 'id', 'get-post')
return getPost(input as GetPostInput)
}