/** * An object used to manage the query segment of the current page's URL. * * Get hands-on experience with the URL query parameters on the [Hello Query Parameters](https://dev.wix.com/docs/coding-examples/getting-started/hello-world/hello-query-parameters) example page. */ export interface QueryParams { /** * Adds query parameters to the current page's URL. * * Adds one or more query parameters to the current page's URL. * * The `add()` method can only be used when browser * [rendering](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/frontend-code/page-rendering/about-page-rendering) happens, * meaning you can only use it in frontend code after the page is ready. * * If a specified key already exists as a query parameter, the * newly specified value overwrites the key's previous value. * * Calling the `add()` method triggers `onChange()` * if it has been registered. * > **Note:** To retrieve the page's current query parameters, use the * `query` method. * @param toAdd - An object containing a `key:value` pair * for each query parameter to add to the URL, where the object's * keys are the query parameter keys and the object's values * are the corresponding query parameter values. * @requiredField toAdd */ add(toAdd: object): Promise; /** * Removes query parameters from the current page's URL. * * Removes 1 or more query parameters to the current page's URL. * * The `remove()` method can only be used when browser * [rendering](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/frontend-code/page-rendering/about-page-rendering) happens, * meaning you can only use it in frontend code after the page is ready. * * If a specified key doesn't exist as a query parameter, it * is ignored. * * Calling the `remove()` method triggers `onChange()` * if it has been registered. * > **Note:** To retrieve the page's current query parameters, use the * `query` method. * @param toRemove - List of keys to remove. * @requiredField toRemove */ remove(toRemove: string[]): Promise; } /** * Adds query parameters to the current page's URL. * * Adds one or more query parameters to the current page's URL. * * The `add()` method can only be used when browser * [rendering](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/frontend-code/page-rendering/about-page-rendering) happens, * meaning you can only use it in frontend code after the page is ready. * * If a specified key already exists as a query parameter, the * newly specified value overwrites the key's previous value. * * Calling the `add()` method triggers `onChange()` * if it has been registered. * > **Note:** To retrieve the page's current query parameters, use the * `query` method. * @param toAdd - An object containing a `key:value` pair * for each query parameter to add to the URL, where the object's * keys are the query parameter keys and the object's values * are the corresponding query parameter values. * @requiredField toAdd */ export function add(toAdd: object): Promise; /** * Removes query parameters from the current page's URL. * * Removes 1 or more query parameters to the current page's URL. * * The `remove()` method can only be used when browser * [rendering](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/frontend-code/page-rendering/about-page-rendering) happens, * meaning you can only use it in frontend code after the page is ready. * * If a specified key doesn't exist as a query parameter, it * is ignored. * * Calling the `remove()` method triggers `onChange()` * if it has been registered. * > **Note:** To retrieve the page's current query parameters, use the * `query` method. * @param toRemove - List of keys to remove. * @requiredField toRemove */ export function remove(toRemove: string[]): Promise;