export declare interface AvatarUrlOptions { /** * Should a dark theme variant of the avatar be used. * * @default false */ isDarkTheme?: boolean; /** * If the given user is is a guest user. * This is needed as guest users use a different API endpoint. * * @default false */ isGuestUser?: boolean; /** * Avatar image size. * The backend only supports 64px and 512px. * * @default 64 */ size?: 64 | 512; } /** * Get the avatar URL for a given user. * * @param user - The user id to lookup the avatar of * @param options - Options for configuring the avatar * @return Relative URL for the avatar */ export declare function generateAvatarUrl(user: string, options?: AvatarUrlOptions): string; /** * Get the url with webroot for a file in an app * * @param {string} app the id of the app * @param {string} type the type of the file to link to (e.g. css,img,ajax.template) * @param {string} file the filename * @return {string} URL with webroot for a file in an app */ export declare const generateFilePath: (app: string, type: string, file: string) => string; /** * Get the base path for the given OCS API service * * @param {string} url OCS API service url * @param {object} params parameters to be replaced into the service url * @param {UrlOptions} options options for the parameter replacement * @return {string} Absolute path for the OCS URL */ export declare const generateOcsUrl: (url: string, params?: object, options?: UrlOptions) => string; /** * Creates an absolute url for remote use * @param {string} service id * @return {string} the url * @param {UrlOptions} [options] options for the parameter replacement */ export declare const generateRemoteUrl: (service: string, options?: UrlOptions) => string; /** * Generate the url with webroot for the given relative url, which can contain parameters * If options.baseURL is provided, generate the absolute url pointing ro remote server * * Parameters will be URL encoded automatically * * @param {string} url address (can contain placeholders e.g. /call/{token} would replace {token} with the value of params.token * @param {object} params parameters to be replaced into the url * @param {UrlOptions} options options for the parameter replacement * @return {string} URL with webroot for the given relative URL */ export declare const generateUrl: (url: string, params?: object, options?: UrlOptions) => string; /** * Return the web root path for a given app * @param {string} app The ID of the app */ export declare function getAppRootUrl(app: string): string; /** * Return the full base URL where this Nextcloud instance * is accessible, with a web root included. * For example "https://company.com/nextcloud". * * @return {string} base URL */ export declare const getBaseUrl: () => string; /** * Return the web root path where this Nextcloud instance * is accessible, with a leading slash. * For example "/nextcloud". * * @return {string} web root path */ export declare function getRootUrl(): string; /** * Get the path with webroot to an image file * if no extension is given for the image, it will automatically add .svg * * @param {string} app the app id to which the image belongs * @param {string} file the name of the image file * @return {string} */ export declare const imagePath: (app: string, file: string) => string; /** * Get an url with webroot to a file in an app * * @param app - The id of the app the file belongs to * @param file the file path relative to the app folder * @return URL with webroot to a file */ export declare function linkTo(app: string, file: string): string; /** * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: GPL-3.0-or-later */ /** * Options for URL parameter replacement */ export declare interface UrlOptions { /** * Set to false if parameters should not be URL encoded * @default true */ escape?: boolean; /** * True if you want to force index.php being added * @default false */ noRewrite?: boolean; /** * OCS version to use * @default 2 */ ocsVersion?: number; /** * URL to use as a base (defaults to current instance) * @default '' */ baseURL?: string; } export { }