FlagsRegistered型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
What registering a set did: the flags added, the records left out with the reason each was (never drawn), and a way to take the set out again.
インポート
import type { FlagsRegistered } from "@johnmorrisdotca/hata/custom";
定義
interface FlagsRegistered {
status: "ok" | "failed" | "aborted";
source: string;
added: string[];
skipped: number;
rejected: {
id: string | null;
reason: string;
}[];
reason?: string;
remove(): void;
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
status | "ok" | "failed" | "aborted" |
|
source | string | The source's id. |
added | string[] | The ids added, in order. |
skipped | number | How many records were left out. |
rejected | { id: string | null; reason: string; }[] | Each record left out, with its id as given (or |
reason (省略可) | string | undefined | Why a read failed. |
remove | (): void | Takes the whole set out again; the same as |
例
import type { FlagsRegistered } from "@johnmorrisdotca/hata/custom";
const say = (done: FlagsRegistered): string => `${done.status}: ${done.added.length} added, ${done.rejected.length} left out`;
console.log(typeof say);function出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。