/** * Defines the contract for a location strategy that the router uses to * read and manipulate the browser URL. * * Two implementations exist: * - `HashLocationStrategy` – URLs like `http://example.com/#/path?query` * - `PathLocationStrategy` – URLs like `http://example.com/path?query` * * This separation mirrors Angular's `LocationStrategy` approach and ensures * that routing logic is clean, testable, and free of scattered `if (useHash)` checks. * * @public */ export interface ILocationStrategy { /** * Returns the current normalized pathname (always starts with `/`). * * @readonly */ readonly pathname: string; /** * Returns the full `href` for the current location. * * @readonly */ readonly href: string; /** * Returns the search/query string portion of the current URL. * * @readonly */ readonly search: string; /** * Returns the fragment/hash portion of the current URL, * excluding any routing-related hash prefix. * * @readonly */ readonly hash: string; /** * Returns the hostname (e.g. `"localhost"`). * * @readonly */ readonly hostname: string; /** * Returns the full origin (e.g. `"http://localhost:8080"`). * * @readonly */ readonly origin: string; /** * Returns the host including port (e.g. `"localhost:8080"`). * * @readonly */ readonly host: string; /** * Returns the port (e.g. `"8080"`). * * @readonly */ readonly port: string; /** * Returns the protocol (e.g. `"http:"`). * * @readonly */ readonly protocol: string; /** * Pushes a new entry to the browser history for the given path. * * @param path - The application-level path to navigate to. */ pushState(path: string): void; /** * Replaces the current history entry with the given path (no new history entry). * * @param path - The application-level path. */ replaceState(path: string): void; /** * Constructs a full link string for the given pathname, * including route prefix (e.g. `#` for hash mode). * * @param pathname - The application-level path. * @returns The formatted link string. */ prepareExternalUrl(pathname: string): string; /** * Returns the value of a query parameter from the current route URL. * * @param name - The parameter name. * @returns The parameter value, or `null` if not present. */ getSearchParam(name: string): string | null; /** * Sets a query parameter on the current route URL without triggering navigation. * * @param name - The parameter name. * @param value - The parameter value. */ setSearchParam(name: string, value: string): void; /** * Removes a query parameter from the current route URL without triggering navigation. * * @param name - The parameter name to remove. */ deleteSearchParam(name: string): void; } //# sourceMappingURL=ILocationStrategy.d.ts.map