import { StateMachine } from "@snap/state-management"; import type { RemoteConfiguration } from "../remote-configuration/remoteConfiguration"; import type { LegalPromptFactory } from "./legalPrompt"; declare const createLegalState: () => StateMachine | import("@snap/state-management").Action<"accept", string> | import("@snap/state-management").Action<"reject", string>, import("@snap/state-management").State<"unknown", undefined> | import("@snap/state-management").State<"accepted", undefined> | import("@snap/state-management").State<"rejected", undefined>>; export type LegalState = ReturnType; /** * We maintain the state of the user's acceptance of Snap's various legal documents. Other components may require that * the legal state be "accepted" before proceeding (e.g. to apply a lens). * * On page load, the legal state starts as "unknown." If a request is made to determine the legal state, the following * business logic is implemented: * * 1. Download remote COF config value containing the legal documents + a `disabled` field to optionally skip the legal * requirement. * 2. Check for a `lastAcceptedTosContentHash` stored in IndexedDB. * 3. Prompt the user to accept/reject the legal documents. * * ┌────────────────────────────────────────────────────────┐ * │ COF config value includes "disabled: true" │ * └────────────────────────────────────────────────────────┘ * │ * │ * ┌────────No────────────┴────────────Yes──────────────────┐ * │ │ * ▼ │ * ┌────────────────────────────────────┐ ▼ * │"lastAcceptedTosContentHash" exists │ ┌────────────┐ * └────────────────────────────────────┘ │ Skip ToS │ * │ └────────────┘ * │ ▲ * ┌─────────────No───┴───────Yes────────────┐ │ * │ │ │ * │ │ │ * ▼ ▼ │ * ┌────────────┐ ┌────────────────────────────────────────┐ │ * │ Show ToS │ │ Hash of ToS content from COF matches │ │ * └────────────┘ │ "lastAcceptedTosContentHash" │ │ * ▲ └────────────────────────────────────────┘ │ * │ │ │ * │ │ │ * └──────────────────No─────────────────────┴───────────────────Yes───────────┘ * * @internal */ export declare const legalStateFactory: { (args_0: RemoteConfiguration, args_1: LegalPromptFactory): StateMachine | import("@snap/state-management").Action<"accept", string> | import("@snap/state-management").Action<"reject", string>, import("@snap/state-management").State<"unknown", undefined> | import("@snap/state-management").State<"accepted", undefined> | import("@snap/state-management").State<"rejected", undefined>>; token: "legalState"; dependencies: readonly ["remoteConfiguration", "legalPrompt"]; }; export {}; //# sourceMappingURL=legalState.d.ts.map