<?php

namespace Planaday\Platform\PlatformAbstraction;

interface UrlHandler {
	public function getUrlQueryField( string $fieldName): ?string;
	public function getPageWithShortCode(string $shortcode): ?string;

	/**
	 * @return string[][]
	 */
	public function getPagesWithShortCode(string $shortcode): array;

	/**
	 * @return string[][]
	 */
	public function getPagesWithBlock(string $blockName):array;

	/**
	 * @return array<array{title:string, id:int}>
	 */
	public function getAllPages():array;
	public function getBaseUrl():string;
	public function getWebsiteName():string;
	public function redirect(string $url):void;

	/**
	 * @param int $pageId
	 *
	 * @return false|string
	 */
	public function getPageUrl(int $pageId): false|string;

	public function currentPageHasShortCode( string $shortcode ): bool;
	public function flushRewriteRules():void;
	public function getCurrentPageId():int;
	public function getFileUrl(string $filePath):string;

	/**
	 * @return string url relative to domain and with trailing slash, example: "/api/planaday/rest/v1/"
	 */
	public function getRestApiPrefix():string;
}