UNPKG

scrivito

Version:

Scrivito is a professional, yet easy to use SaaS Enterprise Content Management Service, built for digital agencies and medium to large businesses. It is completely maintenance-free, cost-effective, and has unprecedented performance and security.

25 lines (17 loc) 590 B
// @rewire import { InternalError } from 'scrivito_sdk/common'; export type ResolvedUrl = RecognizedUrl | null; interface RecognizedUrl { obj_id: string; query?: string; fragment?: string; } export function resolveUrl(url: string): Readonly<ResolvedUrl> { if (!urlResolutionHandler) throw new InternalError(); return urlResolutionHandler(url); } type UrlResolutionHandler = (url: string) => ResolvedUrl; let urlResolutionHandler: UrlResolutionHandler | undefined; export function setUrlResolutionHandler(handler: UrlResolutionHandler) { urlResolutionHandler = handler; }