생성자
constructor
client): NewsClient
새 NewsClient 인스턴스를 생성합니다
매개변수
| 이름 | 타입 | 설명 |
|---|---|---|
client | Client | 주요 X API Client 인스턴스 |
반환
NewsClient
정의된 위치
메서드
get
id, options): Promise<Response>
ID로 뉴스 스토리를 가져옵니다.
주어진 ID를 사용해 뉴스 스토리를 가져옵니다.
매개변수
| Name | Type | Description |
|---|---|---|
id | string | 뉴스 기사의 식별자(id)입니다. |
options | GetOptions & { requestOptions: { raw: true } } | - |
반환
Promise<Response>
API 응답으로 resolve되는 Promise이며, requestOptions.raw가 true인 경우에는 raw Response를 반환합니다.
정의 위치
news/client.ts:141 ▸ get(id, options?): Promise<Get2NewsIdResponse>
매개변수
| 이름 | 타입 |
|---|---|
id | string |
options? | GetOptions |
반환 값
Promise<Get2NewsIdResponse>
정의된 위치
search
query, options): Promise<Response>
뉴스 검색
지정된 검색 쿼리에 부합하는 뉴스 스토리 목록을 가져옵니다.
매개변수
| Name | Type | Description |
|---|---|---|
query | string | 검색 쿼리입니다. |
options | SearchOptions & { requestOptions: { raw: true } } | - |
반환값
Promise<Response>
API 응답으로 resolve되는 Promise이며, requestOptions.raw가 true인 경우에는 원시 Response입니다.
정의 위치
news/client.ts:288 ▸ search(query, options?): Promise<Get2NewsSearchResponse>
매개변수
| 이름 | Type |
|---|---|
query | string |
options? | SearchOptions |
반환값
Promise<Get2NewsSearchResponse>