@slashid/react
Version:
React SDK for the /id platform
37 lines • 1.09 kB
TypeScript
import { GDPRConsent } from "@slashid/slashid";
import { ActionType, ConsentSettings, ConsentSettingsLevel } from "./types";
export type State = {
consentSettings: ConsentSettings;
activeAction: ActionType;
open: boolean;
isLoading: boolean;
hasError: boolean;
isCustomizing: boolean;
};
type Action = {
type: "SET_OPEN";
payload: boolean;
} | {
type: "START_ACTION";
payload: ActionType;
} | {
type: "COMPLETE_ACTION";
} | {
type: "SET_HAS_ERROR";
payload: boolean;
} | {
type: "SET_IS_CUSTOMIZING";
payload: boolean;
} | {
type: "SYNC_CONSENT_SETTINGS";
payload: GDPRConsent[];
} | {
type: "TOGGLE_CONSENT";
payload: ConsentSettingsLevel;
};
export type Dispatch = React.Dispatch<Action>;
export declare const mapConsentsToSettings: (consents: GDPRConsent[]) => ConsentSettings;
export declare const createInitialState: (initialConsentSettings: ConsentSettings, initialOpen: boolean) => State;
export declare const reducer: (state: State, action: Action) => State;
export {};
//# sourceMappingURL=state.d.ts.map