// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
namespace Microsoft.AspNetCore.Blazor.Services
{
///
/// Helpers for working with URIs and navigation state.
///
public interface IUriHelper
{
///
/// Gets the current absolute URI.
///
/// The browser's current absolute URI.
string GetAbsoluteUri();
///
/// An event that fires when the navigation location has changed.
///
event EventHandler OnLocationChanged;
///
/// Converts a relative URI into an absolute one (by resolving it
/// relative to the current absolute URI).
///
/// The relative URI.
/// The absolute URI.
Uri ToAbsoluteUri(string href);
///
/// Gets the URI prefix that can be prepended before URI paths to produce an absolute URI.
/// Typically this corresponds to the 'href' attribute on the document's <base> element.
///
/// The URI prefix.
string GetBaseUriPrefix();
///
/// Given a base URI prefix (e.g., one previously returned by ),
/// converts an absolute URI into one relative to the base URI prefix.
///
/// The base URI prefix (e.g., previously returned by ).
/// An absolute URI that is within the space of the base URI prefix.
/// A relative URI path.
string ToBaseRelativePath(string baseUriPrefix, string locationAbsolute);
}
}