AnnouncementAPI
API
The API for interacting with the announcement bar.
Anchor to announcementapiAnnouncementApi
The API object provided to the purchase.thank-you.announcement.render
extension target.
- Anchor to announcementannouncementrequired
AnnouncementApi
The API for interacting with the announcement bar.
- announcement
Announcement
export interface AnnouncementApi {
announcement: Announcement;
}
Announcement
- addEventListener
Listen for events from the announcement bar.
(type: "close", cb: () => void) => void
- close
Close the Announcement bar.
() => void
- removeEventListener
Remove a listener for events from the announcement bar.
(type: "close", cb: () => void) => void
interface Announcement {
/**
* Close the Announcement bar.
*/
close(): void;
/**
* Listen for events from the announcement bar.
*/
addEventListener(type: 'close', cb: () => void): void;
/**
* Remove a listener for events from the announcement bar.
*/
removeEventListener(type: 'close', cb: () => void): void;
}
Was this section helpful?