Skip to content

ConsentState

type ConsentState = {
decisions: Record<string, boolean>;
isOpen: boolean;
noticeOpen: boolean;
ready: boolean;
resolved: ResolvedCategory[];
storedAt: number | null;
};

Defined in: store.ts:11

Type declaration

NameTypeDescriptionDefined in
decisionsRecord<string, boolean>Map of category ID → granted (true) / denied (false).store.ts:24
isOpenbooleanTrue when the consent banner / preference centre should be visible.store.ts:15
noticeOpenbooleanTrue when a notice card should be visible — set when the site has any notice-mode category and no consent-mode category (the consent banner already covers notice-mode categories in its list, so we don’t show both). Closes when the user saves, resets, or explicitly dismisses.store.ts:22
readybooleanTrue after the store has hydrated from the cookie (client-only).store.ts:13
resolvedResolvedCategory[]Resolved categories for the active jurisdiction.store.ts:26
storedAtnumber | nullTimestamp of the most-recent stored decision, if any.store.ts:28