<?php

declare(strict_types=1);

namespace FecaMailshots\WordPress;

interface WordPressFacade
{
    public function addAction(string $hook, callable $callback): void;

    public function addMenuPage(string $pageTitle, string $menuTitle, string $capability, string $slug, callable $callback): void;

    public function addSubmenuPage(string $parentSlug, string $pageTitle, string $menuTitle, string $capability, string $slug, callable $callback): void;

    public function currentUserCan(string $capability): bool;

    public function verifyNonce(string $nonce, string $action): bool;
    public function createNonce(string $action): string;

    public function requestParam(string $name, ?string $default = null): ?string;

    /** @param array<string, mixed> $payload */
    public function sendJson(array $payload, int $statusCode = 200): void;

    public function adminUrl(string $path = ''): string;

    public function currentUserId(): int;

    /**
     * @param mixed $default
     * @return mixed
     */
    public function getOption(string $name, $default = null);

    /**
     * @param mixed $value
     */
    public function updateOption(string $name, $value): bool;

    public function deleteOption(string $name): bool;
}
