import React, { PropsWithChildren, CSSProperties } from 'react'; import { WidgetPlus } from '@okendo/reviews-common'; import { CustomerAccount, Storefront } from '@shopify/hydrogen'; declare global { interface Window { okeLoyaltyApi?: { initialiseWidgets: () => void; }; } } declare function OkendoLoyaltyEmbeddedWidget(): React.JSX.Element; type OkendoProviderData = Partial; type OkendoProduct = 'reviews' | 'loyalty'; interface OkendoReviewsProviderData { reviewsHeaderConfig: WidgetPlus.ReviewsHeaderConfig; cssVariables: string; customCss?: string; preRenderStyleTags: string; starSymbols: string; } interface OkendoLoyaltyProviderData { loyaltySettings: string; } declare const getOkendoProviderData: ({ context, subscriberId, apiDomain, okendoProducts, appNamespace, }: { context: StorefrontContext; subscriberId: string; apiDomain?: string; okendoProducts?: OkendoProduct[]; appNamespace?: string; }) => Promise; interface StorefrontContext { customerAccount: CustomerAccount; storefront: Storefront; } interface ReviewProduct { productHandle?: string; productId: string; variantId?: string; } interface OkendoProviderProps { /** * A nonce that will be added to Okendo's scripts; * this is required if Content Security Policy is set up on your store. */ nonce?: string; /** * The promise returned by `getOkendoProviderData`. */ okendoProviderData: Promise; /** * Used by the loyalty widget to verify the user's identity via the Customer Account API. * Can be retrieved via `await context.customerAccount.getAccessToken()` in the loader function. */ customerAccessToken?: string; /** * As an alternative to `customerAccessToken` for stores which use the Storefront API for login * Please use the value of the string: `customerAccessToken.accessToken` from the login response * Caveat: This can only be used in tandem with your `storefrontAccessToken` */ storefrontCustomerAccessToken?: string; /** * Required if you are using the Storefront API for login via the `storefrontCustomerAccessToken` * Most likely in your project as `PUBLIC_STOREFRONT_API_TOKEN` and being used as the value of your `X-Shopify-Storefront-Access-Token` header * Can also be found in the Shopify Admin, in the Headless Sales Channel settings as the Storefront API `Public access token` */ storefrontAccessToken?: string; /** An optional product URL formatter */ productUrlFormatter?: (product: ReviewProduct) => string; cdnDomain?: string; } declare const OkendoProvider: ({ okendoProviderData, customerAccessToken, storefrontAccessToken, storefrontCustomerAccessToken, productUrlFormatter, cdnDomain, children, }: OkendoProviderProps & PropsWithChildren) => React.JSX.Element; interface MetafieldValue { value: string; } interface WithOkendoReviewsSnippet { okendoReviewsSnippet?: MetafieldValue | null; } interface OkendoReviewsProps { style?: CSSProperties; className?: string; productId?: string; okendoReviewsSnippet?: MetafieldValue | null; } declare const OkendoReviews: ({ style, className, productId, okendoReviewsSnippet }: OkendoReviewsProps) => React.JSX.Element; interface OkendoReviewsCarouselProps { style?: CSSProperties; className?: string; productId?: string; groupId?: string; headerBadgeUrl?: string; } declare const OkendoReviewsCarousel: ({ style, className, productId, groupId, headerBadgeUrl }: OkendoReviewsCarouselProps) => React.JSX.Element; interface WithOkendoStarRatingSnippet { okendoStarRatingSnippet?: MetafieldValue | null; } interface OkendoStarRatingProps { style?: CSSProperties; className?: string; productId: string; okendoStarRatingSnippet?: MetafieldValue | null; } declare const OkendoStarRating: ({ style, className, productId, okendoStarRatingSnippet }: OkendoStarRatingProps) => React.JSX.Element; declare const OKENDO_PRODUCT_STAR_RATING_FRAGMENT: "#graphql\n\tfragment OkendoStarRatingSnippet on Product {\n\t\tokendoStarRatingSnippet: metafield(\n\t\t\tnamespace: \"app--1576377--reviews\"\n\t\t\tkey: \"star_rating_snippet\"\n\t\t) {\n\t\t\tvalue\n\t\t}\n\t}\n"; declare const OKENDO_PRODUCT_REVIEWS_FRAGMENT: "#graphql\n\tfragment OkendoReviewsSnippet on Product {\n\t\tokendoReviewsSnippet: metafield(\n\t\t\tnamespace: \"app--1576377--reviews\"\n\t\t\tkey: \"reviews_widget_snippet\"\n\t\t) {\n\t\t\tvalue\n\t\t}\n\t}\n"; export { OKENDO_PRODUCT_REVIEWS_FRAGMENT, OKENDO_PRODUCT_STAR_RATING_FRAGMENT, OkendoLoyaltyEmbeddedWidget, OkendoProvider, OkendoReviews, OkendoReviewsCarousel, OkendoStarRating, type WithOkendoReviewsSnippet, type WithOkendoStarRatingSnippet, getOkendoProviderData };