@legumeinfo/web-components
Version:
Web Components for the Legume Information System and other AgBio databases
59 lines • 2.09 kB
TypeScript
import { ReactiveController, ReactiveControllerHost } from 'lit';
/**
* A controller that allows components to interact with URL query string
* parameters in a manner that triggers changes in the component's template when
* parameter values change.
*/
export declare class LisQueryStringParametersController implements ReactiveController {
/** @ignore */
host: ReactiveControllerHost;
/** @ignore */
private _preUpdateListeners;
/** @ignore */
private _listeners;
/**
* @param host - The component that's using the controller.
*/
constructor(host: ReactiveControllerHost);
/** @ignore */
hostConnected(): void;
/** @ignore */
hostDisconnected(): void;
/**
* Gets the value of a URL query string parameter. This is reactive when used
* inside a component template.
*
* @param name - The name of the parameter to get the value of.
* @param defaultValue - The default value to return if the parameter isn't
* in the query string.
*
* @returns The value of the parameter or the default value provided.
*/
getParameter(name: string, defaultValue?: string): string;
/**
* Updates the URL query string parameters.
*
* @param parameters - An object mapping parameter names to the values to
* assign them.
*/
setParameters(parameters: object): void;
/**
* Adds a listener to the {@link !popstate | `'popstate'`} event that will be executed
* before the host's DOM is updated.
*
* @param listener - The listener to subscribe to the event.
*/
addPreUpdateListener(listener: EventListener): void;
/**
* Adds a listener to the {@link !popstate | `'popstate'`} event that will be executed
* after the host's DOM is updated.
*
* @param listener - The listener to subscribe to the event.
*/
addListener(listener: EventListener): void;
/** @ignore */
private _differentValues;
/** @ignore */
private _popState;
}
//# sourceMappingURL=lis-query-string-parameters-controller.d.ts.map