Skip to content

Commit 277fe31

Browse files
Update type of confirmed (such that confirmed can be 0)
1 parent 8223e0f commit 277fe31

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

src/core.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,12 @@ export type Metadata = Record<string, unknown>;
143143

144144
/** setConsent() options */
145145
export interface ConsentOptions {
146-
/** Was consent confirmed by the user? */
147-
confirmed?: boolean;
146+
/**
147+
* - `true` if consent has been confirmed by the user and has not expired
148+
* - `0` if consent has been confirmed by the user and has expired
149+
* - `false` if consent has not been confirmed by the user
150+
*/
151+
confirmed?: boolean | 0;
148152
/**
149153
* Was the UI shown to the user?
150154
* @deprecated
@@ -603,11 +607,12 @@ const ReservedMetadata = t.partial({
603607

604608
export const CoreTrackingConsentDetails = t.intersection([
605609
t.type({
606-
/**
607-
* Was tracking consent confirmed by the user?
608-
* If this is false, the consent was resolved from defaults & is not yet confirmed
610+
/**
611+
* - `true` if consent has been confirmed by the user and has not expired
612+
* - `0` if consent has been confirmed by the user and has expired
613+
* - `false` if consent has not been confirmed by the user
609614
*/
610-
confirmed: t.boolean,
615+
confirmed: t.union([t.boolean, t.literal(0)]),
611616
/** Consent resolution/last-modified timestamp (ISO 8601) */
612617
timestamp: t.string,
613618
}),

0 commit comments

Comments
 (0)