/** * @typedef {Object} ShortenerAPIResponseData * @property {string} short_url */ /** * @typedef {Object} ShortenerAPIResponse * @property {ShortenerAPIResponseData} data Response payload to the shortener API * @property {number} status HTTP status */ /** * @typedef {Object} ShortenerAPIRequestParams * @property {string} url * @property {string} [email] * @property {string} [message] */ /** * Service to handle the sharing of the permalink. * * @param {angular.IHttpService} $http Angular http service. * @param {string} gmfShortenerCreateUrl URL for the shortener API * @class * @ngname gmfShareService * @hidden */ export function PermalinkShareService($http: angular.IHttpService, gmfShortenerCreateUrl: string): void; export class PermalinkShareService { /** * @typedef {Object} ShortenerAPIResponseData * @property {string} short_url */ /** * @typedef {Object} ShortenerAPIResponse * @property {ShortenerAPIResponseData} data Response payload to the shortener API * @property {number} status HTTP status */ /** * @typedef {Object} ShortenerAPIRequestParams * @property {string} url * @property {string} [email] * @property {string} [message] */ /** * Service to handle the sharing of the permalink. * * @param {angular.IHttpService} $http Angular http service. * @param {string} gmfShortenerCreateUrl URL for the shortener API * @class * @ngname gmfShareService * @hidden */ constructor($http: angular.IHttpService, gmfShortenerCreateUrl: string); /** * @type {angular.IHttpService} */ $http_: angular.IHttpService; /** * @type {string} */ gmfShortenerCreateUrl_: string; /** * Get a short URL of the permalink by calling the url shortener service. * - If no shortener API url have been specified, it returns the permalink itself. * * @param {string} url the permalink * @returns {ShortenerAPIResponse|angular.IHttpPromise} an object containing the permalink not * shortened or the promise attached to the shortener API request */ getShortUrl(url: string): ShortenerAPIResponse | angular.IHttpPromise; /** * Send the short permalink to the email provided * - If email is provided, the short permalink will be sent to this email * * @param {string} shortUrl the short permalink to send * @param {string} email the email to which the short url must be send * @param {string} [opt_message] message for the email * @returns {angular.IHttpPromise} the promise attached to the shortener API request */ sendShortUrl(shortUrl: string, email: string, opt_message?: string): angular.IHttpPromise; /** * @param {ShortenerAPIRequestParams} params parameters for the request * @returns {angular.IHttpPromise} the promise attached to the shortener API request */ postShortUrl_(params: ShortenerAPIRequestParams): angular.IHttpPromise; } export namespace PermalinkShareService { let $inject: string[]; } /** * Max length defined for the complete url. * Check IE limits, see {@link http://support.microsoft.com/kb/208427} * * @type {number} * @hidden */ export const URL_MAX_LEN: number; /** * Max length defined for the URL path section. * Check IE limits, see {@link http://support.microsoft.com/kb/208427} * * @type {number} * @hidden */ export const URL_PATH_MAX_LEN: number; export default myModule; export type ShortenerAPIResponseData = { short_url: string; }; export type ShortenerAPIResponse = { /** * Response payload to the shortener API */ data: ShortenerAPIResponseData; /** * HTTP status */ status: number; }; export type ShortenerAPIRequestParams = { url: string; email?: string; message?: string; }; import angular from 'angular'; /** * @type {angular.IModule} * @hidden */ declare const myModule: angular.IModule;