/// import { type ITerminal } from '@rushstack/terminal'; import type { ISpfxServeSessionConfiguration } from '../../spfxConfig/interfaces/serve'; /** * @public * Helper utility for constructing URL's for testing SharePoint Framework components. */ export declare class SPFxDebugPageUrl { static readonly DEBUG_QUERY_PARAMETER: string; static readonly NO_REDIRECT_QUERY_PARAMETER: string; static readonly DEBUG_MANIFESTS_QUERY_PARAMETER: string; static readonly LOAD_SPFX_QUERY_PARAMETER: string; static readonly CUSTOM_ACTIONS_QUERY_PARAMETER: string; static readonly FIELD_CUSTOMIZERS_QUERY_PARAMETER: string; static readonly PROPERTIES_QUERY_PARAMETER: string; static readonly ROOT_FOLDER_QUERY_PARAMETER: string; static readonly TENANT_DOMAIN_PLACEHOLDER: string; static readonly TENANT_DOMAIN_REPLACEMENT_REGEX: RegExp; readonly searchParams: URLSearchParams; initialUrl: string | undefined; /** * Replaces a URL with a \{tenantDomain\} token with the value from the SPFX_SERVE_TENANT_DOMAIN environment variable. * If the environment variable is not set, a warning is logged and the URL is returned unmodified. * * @remarks * Examples for `SPFX_SERVE_TENANT_DOMAIN=contoso.sharepoint.com`: * "https://\{tenantDomain\}/SitePages/myPage.aspx" -\> "https://contoso.sharepoint.com/SitePages/myPage.aspx" * "https://example.com" -\> "https://example.com" * "\{noUrl\}" -\> "\{noUrl\}" * undefined -\> undefined * * @param url - The URL to replace the token in. * @returns The URL with the token replaced, or the original URL if no replacement was made. */ static replaceTenantDomainToken(url: string | undefined, replacementDomain: string | undefined): string | undefined; constructor(); /** * Returns the current (modified) URL's query parameters as a string. * For example: "?debugManifestsFile=http%3A%2F%2Flocalhost%3A4321%2Ftemp%2Fbuild%2Fmanifests.js&loadSPFX=true" * Returns undefined if the initial URL is invalid. */ get href(): string | undefined; /** * Adds the "loadSPFX" query parameter to the URL. * This is used when the page we are launching is not an SPFx page, but we want to load SPFx scripts * onto the page (for example, when testing field customizers or command sets). */ addLoadSpfxParameter(): void; /** * Adds the "debugManifestsFile" query parameter to the URL. * This is required to load the debug manifests from the local dev server. * @param manifestsUrl - The URL to the manifests.js file (hosted by the local dev server). */ addDebugManifestsFileParameter(manifestsUrl: string): void; /** * Adds the "customActions" query parameter to the URL. * This is used to specify custom actions to be loaded on the page. * @param customActions - The custom actions to add (as a JSON string). */ addCustomActionsParameter(customActions: ISpfxServeSessionConfiguration['customActions']): void; /** * Adds the "fieldCustomizers" query parameter to the URL. * This is used to specify field customizers to be loaded on the page. * @param fieldCustomizers - The field customizers to add (as a JSON string). */ addFieldCustomizersParameter(fieldCustomizers: ISpfxServeSessionConfiguration['fieldCustomizers']): void; /** * Adds the form customizer parameters to the URL. * @param formCustomizer - The form customizer configuration to add. */ addFormCustomizerParameters(formCustomizer: NonNullable): void; /** * Checks if the current URL is a valid testing URL. * Use to verify that the URL is valid for opening a browser for testing. * @returns Returns true if the URL is a valid testing URL (contains the debugManifestsFile query parameter and points to a real tenant). */ isValidTestingUrl(): boolean; /** * Writes the query string to the provided terminal in a box. */ printDebugQueryString(terminal: ITerminal): void; /** * Sets the properties parameter for form customizers. This is a JSON string. * @param value - The properties value to process and set. */ private _setFormCustomizerPropertiesParameter; /** * Sets the RootFolder parameter for form customizers. * @param value - The RootFolder value to process and set. */ private _setFormCustomizerRootFolderParameter; /** * Helper method to set a parameter with validation to ensure it's not already set with a different value. * @param parameter - The parameter name to set. * @param value - The value to set for the parameter. */ private _setParameter; } //# sourceMappingURL=SPFxDebugPageUrl.d.ts.map