Reference · Flags a page registers itself
FlagsRegisteredtype
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 it
import type { FlagsRegistered } from "@johnmorrisdotca/hata/custom";
Definition
interface FlagsRegistered {
status: "ok" | "failed" | "aborted";
source: string;
added: string[];
skipped: number;
rejected: {
id: string | null;
reason: string;
}[];
reason?: string;
remove(): void;
}
Members
| Name | Type | Description |
|---|---|---|
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 (optional) | string | undefined | Why a read failed. |
remove | (): void | Takes the whole set out again; the same as |
Examples
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);functionWhat it prints (run when this page was built)