All files / ima/meta MetaManager.js

100% Statements 2/2
100% Branches 0/0
0% Functions 0/11
100% Lines 2/2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133    6x                                                                                                                                                                                                                                                                 6x  
import ns from '../namespace';
 
ns.namespace('ima.meta');
 
/**
 * The Meta manager is a utility for managing various page attributes related
 * to the SEO (search engine optimization) and social network integration.
 *
 * The Meta manager is used to manage the following:
 * - page title, set using the contents of the {@code <title>} element
 * - page links, linking related documents and meta-information, added to the
 *   using {@code <link>} elements
 * - page meta information:
 *   - the generic named meta information added to the page via
 *     {@code <meta>} elements with the {@code name} attribute, for
 *     example the {@code keywords}.
 *   - specialized meta information added to the page via {@code <meta>}
 *     elements with the {@code property} attribute, for example the OG meta
 *     tags ({@code og:type}, {@code og:image}, etc.).
 *
 * @interface
 */
export default class MetaManager {
  /**
	 * Sets the page title.
	 *
	 * @param {string} title The new page title.
	 */
  setTitle(title) {}
 
  /**
	 * Returns the page title. The method returns an empty string if no page
	 * title has been set yet.
	 *
	 * Note that the page title is cached internally by the meta manager and
	 * may therefore differ from the current document title if it has been
	 * modified by a 3rd party code.
	 *
	 * @return {string} The current page title.
	 */
  getTitle() {}
 
  /**
	 * Set the specified named meta information property.
	 *
	 * @param {string} name Meta information property name, for example
	 *        {@code keywords}.
	 * @param {string} value The meta information value.
	 */
  setMetaName(name, value) {}
 
  /**
	 * Returns the value of the specified named meta information property. The
	 * method returns an empty string for missing meta information (to make the
	 * returned value React-friendly).
	 *
	 * @param {string} name The name of the named meta information property.
	 * @return {string} The value of the generic meta information, or an empty
	 *         string.
	 */
  getMetaName(name) {}
 
  /**
	 * Returns the names of the currently specified named meta information
	 * properties.
	 *
	 * @return {string[]} The names of the currently specified named meta
	 *         information properties.
	 */
  getMetaNames() {}
 
  /**
	 * Sets the specified specialized meta information property.
	 *
	 * @param {string} name Name of the specialized meta information property.
	 * @param {string} value The value of the meta information property.
	 */
  setMetaProperty(name, value) {}
 
  /**
	 * Returns the value of the specified specialized meta information
	 * property. The method returns an empty string for missing meta
	 * information (to make the returned value React-friendly).
	 *
	 * @param {string} name The name of the specialized meta information
	 *        property.
	 * @return {string} The value of the specified meta information, or an
	 *         empty string.
	 */
  getMetaProperty(name) {}
 
  /**
	 * Returns the names of the currently specified specialized meta
	 * information properties.
	 *
	 * @return {string[]} The names of the currently specified specialized meta
	 *         information properties.
	 */
  getMetaProperties() {}
 
  /**
	 * Sets the specified specialized link information.
	 *
	 * @param {string} relation The relation of the link target to the current
	 *        page.
	 * @param {string} reference The reference to the location of the related
	 *        document, e.g. a URL.
	 */
  setLink(relation, reference) {}
 
  /**
	 * Return the reference to the specified related linked document. The
	 * method returns an empty string for missing meta information (to make the
	 * returned value React-friendly).
	 *
	 * @param {string} relation The relation of the link target to the current
	 *        page.
	 * @return {string} The reference to the location of the related document,
	 *         e.g. a URL.
	 */
  getLink(relation) {}
 
  /**
	 * Returns the relations of the currently set related documents linked to
	 * the current page.
	 *
	 * @return {string[]}
	 */
  getLinks() {}
}
 
ns.ima.meta.MetaManager = MetaManager;