# @dmdata/telegram-json-types

> DMDATA.JP が提供する [JSON Schema](https://dmdata.jp/doc/reference/conversion/json/) の、TypeScript型定義を公開しています。

Latest version **1.2.5** (published 2026-06-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install @dmdata/telegram-json-types
pnpm add @dmdata/telegram-json-types
yarn add @dmdata/telegram-json-types
bun add @dmdata/telegram-json-types
```

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; no vulnerabilities; has provenance; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.2.5 |
| Published | 2026-06-01 |
| First published | 2021-12-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=18 |
| Dependencies | 0 |
| Unpacked size | 708 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 6 |
| Maintainers | soshi1822 |

## Links

- npm: https://www.npmjs.com/package/@dmdata/telegram-json-types
- Repository: https://github.com/pdmdss/telegram-json-types
- Homepage: https://github.com/pdmdss/telegram-json-types#readme
- Issues: https://github.com/pdmdss/telegram-json-types/issues
- npm.io page: https://npm.io/package/@dmdata/telegram-json-types

## Recent versions

- 1.2.5 (latest) — 2026-06-01
- 1.0.9-jschema.3 (jschema) — 2022-01-26
- 1.2.4 — 2026-05-22
- 1.2.3 — 2026-04-07
- 1.2.1 — 2026-03-30
- 1.2.0 — 2026-03-30
- 1.1.18 — 2025-12-17
- 1.1.17 — 2025-12-14
- 1.1.16 — 2024-08-21
- 1.1.15 — 2024-06-02
- 1.1.14 — 2024-02-01
- 1.1.13 — 2023-02-02
- 1.1.12 — 2023-01-28
- 1.1.11 — 2022-09-11
- 1.1.10 — 2022-08-14
- … 18 more at https://npm.io/package/@dmdata/telegram-json-types/versions

## README

# @dmdata/telegram-json-types

## 概要

DMDATA.JP が提供する [JSON Schema](https://dmdata.jp/doc/reference/conversion/json/) の、TypeScript型定義を公開しています。

## 使い方

### インストール

`$ npm i -D @dmdata/telegram-json-types`

### 型の使用

```typescript
import { EarthquakeInformation }  from '@dmdata/telegram-json-types';

const data = await fetch('https://data.api.dmdata.jp/v1/...')
      .then(res => res.json()) as Promise<EarthquakeInformation.Latest.Main>
      
```

## JSON Schema による整合性チェック

Telegram JSON が、仕様通り整合するかチェックができます。

`$ npm i @dmdata/telegram-json-types ajv`

```typescript
import { getJSchema } from '@dmdata/telegram-json-types';

// 実際の電文データ
const telegramData = {
  _schema: {
    type: 'earthquake-information',
    version: '1.1.0'
  }
};

async function check() {
  // Schema 名から JSON Schema 定義を読み込む 
  const jschema = await getJSchema(telegramData._schema.type, telegramData._schema.version);

  const validate = ajv.complite(jschema);

  console.log(validate(telegramData)); // false
}

check();
```

## 使える型定義

* [earthquake-information v1.1.0](https://dmdata.jp/doc/reference/conversion/json/schema/earthquake-information)
* [earthquake-explantion v1.0.0](https://dmdata.jp/doc/reference/conversion/json/schema/earthquake-explantion)
* [earthquake-counts v1.0.0](https://dmdata.jp/doc/reference/conversion/json/schema/earthquake-counts)
* [earthquake-hypocenter-update v1.0.0](https://dmdata.jp/doc/reference/conversion/json/schema/earthquake-hypocenter-update)
* [earthquake-nankai v1.0.0](https://dmdata.jp/doc/reference/conversion/json/schema/earthquake-nankai)
* [eew-information v1.0.0](https://dmdata.jp/doc/reference/conversion/json/schema/eew-information)
* [forecast-2week-temperature v1.0.0](https://dmdata.jp/doc/reference/conversion/json/schema/forecast-2week-temperature)
* [forecast-prefecture v1.0.0](https://dmdata.jp/doc/reference/conversion/json/schema/forecast-prefecture)
* [forecast-season v1.0.0](https://dmdata.jp/doc/reference/conversion/json/schema/forecast-season)
* [forecast-warning-possibility v1.0.0](https://dmdata.jp/doc/reference/conversion/json/schema/forecast-warning-possibility)
* [forecast-weathermap v1.0.0](https://dmdata.jp/doc/reference/conversion/json/schema/forecast-weathermap)
* [tsunami-information v1.1.0](https://dmdata.jp/doc/reference/conversion/json/schema/tsunami-information)
    * [tsunami-information v1.0.0](https://dmdata.jp/doc/reference/conversion/json/schema/legacy/tsunami-information_1.0.0)
* [volcano-information v1.0.0](https://dmdata.jp/doc/reference/conversion/json/schema/volcano-information)
* [weather-warning v1.1.0](https://dmdata.jp/doc/reference/conversion/json/schema/weather-warning)
    * [weather-warning v1.0.0](https://dmdata.jp/doc/reference/conversion/json/schema/legacy/weather-warning_1.0.0)
* [weather-warning-timeseries v1.0.0](https://dmdata.jp/doc/reference/conversion/json/schema/weather-warning-timeseries)
* [weather-commentary v1.0.0](https://dmdata.jp/doc/reference/conversion/json/schema/weather-commentary)
* [weather-information v1.0.0](https://dmdata.jp/doc/reference/conversion/json/schema/weather-information)
* [weather-impact-society v1.0.1](https://dmdata.jp/doc/reference/conversion/json/schema/weather-impact-society)
    * [weather-impact-society v1.0.0](https://dmdata.jp/doc/reference/conversion/json/schema/legacy/weather-impact-society_1.0.0)
* [weather-early v1.0.0](https://dmdata.jp/doc/reference/conversion/json/schema/weather-early)
* [weather-tornado v1.0.0](https://dmdata.jp/doc/reference/conversion/json/schema/weather-tornado)
* [weather-typhoon v1.0.0](https://dmdata.jp/doc/reference/conversion/json/schema/weather-typhoon)
* [weather-landslide v1.0.0](https://dmdata.jp/doc/reference/conversion/json/schema/weather-landslide)
* [weather-river-flood v1.0.0](https://dmdata.jp/doc/reference/conversion/json/schema/weather-river-flood)

---
_Source: https://npm.io/package/@dmdata/telegram-json-types · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
