react-cookie-consent/build/index.d.ts

55 lines
1.6 KiB
TypeScript
Raw Normal View History

2018-11-28 09:05:35 +01:00
import * as React from "react";
import Cookies from "js-cookie";
export interface CookieConsentProps {
location?: "top" | "bottom" | "none";
sameSite?: "strict" | "lax" | "none";
cookieSecurity?: boolean;
2018-11-28 09:05:35 +01:00
style?: object;
buttonStyle?: object;
declineButtonStyle?: object;
2018-11-28 09:05:35 +01:00
contentStyle?: object;
children?: React.ReactNode;
disableStyles?: boolean;
hideOnAccept?: boolean;
2020-11-02 19:43:03 +01:00
onAccept?: Function;
onDecline?: Function;
2018-11-28 09:05:35 +01:00
buttonText?: Function | React.ReactNode;
declineButtonText?: Function | React.ReactNode;
2018-11-28 09:05:35 +01:00
cookieName?: string;
cookieValue?: string | boolean | number;
declineCookieValue?: string | boolean | number;
2019-08-19 19:10:23 +02:00
setDeclineCookie?: boolean;
2018-11-28 09:05:35 +01:00
debug?: boolean;
expires?: number;
containerClasses?: string;
contentClasses?: string;
2020-07-23 12:50:54 +02:00
buttonWrapperClasses?: string;
2018-11-28 09:05:35 +01:00
buttonClasses?: string;
declineButtonClasses?: string;
2018-11-28 09:05:35 +01:00
buttonId?: string;
declineButtonId?: string;
2018-11-28 09:05:35 +01:00
extraCookieOptions?: object;
disableButtonStyles?: boolean;
enableDeclineButton?: boolean;
2019-05-03 12:07:12 +02:00
flipButtons?: boolean;
ButtonComponent?: React.ElementType;
2020-06-17 10:29:15 +02:00
overlay?: boolean;
overlayClasses?: string;
overlayStyle?: object;
ariaAcceptLabel?: string;
ariaDeclineLabel?: string;
2018-11-28 09:05:35 +01:00
}
export default class CookieConsent extends React.Component<CookieConsentProps, {}> {}
2020-12-08 18:02:10 +01:00
/**
* Returns the value of the consent cookie
* Retrieves the regular value first and if not found the legacy one according
* to: https://web.dev/samesite-cookie-recipes/#handling-incompatible-clients
* @param {*} name optional name of the cookie
*/
2021-01-27 16:35:17 +01:00
export function getCookieConsentValue(name?: string): string;
2020-12-08 18:02:10 +01:00
2018-11-28 09:05:35 +01:00
export { Cookies };