リファレンス · KanjiVG由来の筆順:描く、描いた漢字から探す
loadStrokes関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The strokes of the kanji in a text, fetched: one piece of about 20 kB gzipped for each place they are in. Anything that is not a kanji the table has is left out of the answer.
インポート
import { loadStrokes } from "@johnmorrisdotca/jisho/strokes";
定義
function loadStrokes(text: string): Promise<PackedStrokes>
引数
| 名前 | 型 | 説明 |
|---|---|---|
text | string | A kanji, or a text with some. |
戻り値
Promise<PackedStrokes>
A table to give strokesOf, strokeOrderSvg and findByDrawing, with those kanji in it.
例
import { loadStrokes, strokesOf } from "@johnmorrisdotca/jisho/strokes";
console.log(strokesOf(await loadStrokes("日本"), "日").length); // 44出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。