コンストラクタ
constructor
client): NewsClient
新しい NewsClient インスタンスを作成します
パラメーター
| Name | Type | Description |
|---|---|---|
client | Client | X API のメイン Client インスタンス |
戻り値
NewsClient
定義場所
メソッド
get
id, options): Promise<Response>
ID でニュース記事を取得します指定した ID のニュース記事を取得します。
パラメータ
| Name | Type | Description |
|---|---|---|
id | string | ニュース記事の ID。 |
options | GetOptions & { requestOptions: { raw: true } } | - |
Returns
Promise<Response>
API レスポンス (requestOptions.raw が true の場合は生の Response) で解決される Promise
定義元
news/client.ts:141 ▸ get(id, options?): Promise<Get2NewsIdResponse>
パラメーター
| 名前 | 型 |
|---|---|
id | string |
options? | GetOptions |
戻り値
Promise<Get2NewsIdResponse>
定義元
news/client.ts:154search
query, options): Promise<Response>
ニュースを検索します指定した検索クエリに一致するニュース記事の一覧を取得します。
Parameters
| Name | Type | Description |
|---|---|---|
query | string | 検索クエリ文字列。 |
options | SearchOptions & { requestOptions: { raw: true } } | - |
Returns
Promise<Response>
API レスポンスに解決される Promise。requestOptions.raw が true の場合は生の Response。
定義場所
query, options?): Promise<Get2NewsSearchResponse>
パラメーター
| 名前 | type |
|---|---|
query | string |
options? | SearchOptions |
戻り値
Promise<Get2NewsSearchResponse>