UNPKG

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