@sitevision/api 1.0.7 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ interface Collection {}
2
+
3
+ export default Collection;
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@sitevision/api",
3
- "version": "1.0.7",
3
+ "version": "1.0.11",
4
4
  "author": "Sitevision AB",
5
5
  "license": "MIT",
6
6
  "types": "index.d.ts",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "https://github.com/sitevision/siteivision-apps.git",
9
+ "url": "https://github.com/sitevision/sitevision-apps.git",
10
10
  "directory": "packages/api"
11
11
  },
12
12
  "bugs": {
13
- "url": "https://github.com/sitevision/siteivision-apps/issues"
13
+ "url": "https://github.com/sitevision/sitevision-apps/issues"
14
14
  },
15
15
  "scripts": {
16
16
  "prepare": "yarn build",
@@ -26,5 +26,5 @@
26
26
  "access": "public",
27
27
  "directory": "dist"
28
28
  },
29
- "gitHead": "3f87b5444a9c07c96cbcf4dc9ef87fec98ec8f0c"
29
+ "gitHead": "cc9cb637f880cbc0def7dccfaa295bc43f2a3e5e"
30
30
  }
@@ -24,38 +24,51 @@ export const PROPERTY_SHORTID: string;
24
24
  export const PROPERTY_VISIBLE_IN_MENUS: string;
25
25
 
26
26
  /**
27
- * Creates an article as sub node to a specified parent.
28
- * @returns {Node} a sv:article node corresponding to the newly created article. Will never return null
29
- * @param {Node} aParent - the parent node of the article. May not be null
30
- * @param {Node} aTemplate - the template used for the article. May not be null
31
- * @param {string} aName - the name of the sv:article. May not be null
32
- */
33
- export function createArticle(aParent: Node, aTemplate: Node, aName: string): Node;
27
+ * Creates an article as sub node to a specified parent.
28
+ * @returns {Node} a sv:article node corresponding to the newly created article. Will never return null
29
+ * @param {Node} aParent - the parent node of the article. May not be null
30
+ * @param {Node} aTemplate - the template used for the article. May not be null
31
+ * @param {string} aName - the name of the sv:article. May not be null
32
+ */
33
+ export function createArticle(
34
+ aParent: Node,
35
+ aTemplate: Node,
36
+ aName: string
37
+ ): Node;
34
38
 
35
39
  /**
36
- * Creates an article with properties and web content.
37
- * @returns {Node} a sv:article node corresponding to the newly created article. Will never return null
38
- * @param {Node} aParent - the parent node of the article. May not be null
39
- * @param {Node} aTemplate - the sv:template node to be used for the article. May not be null
40
- * @param {string} aName - the name of the sv:article. May not be null
41
- * @param {Map<string, any>} properties - the article properties. May be null
42
- * @param {Map<string, string>} content - a map containing the HTML content. The keys must correspond to layout names on the node. May be null
43
- */
44
- export function createArticle(aParent: Node, aTemplate: Node, aName: string, properties: Map<string, any>, content: Map<string, string>): Node;
40
+ * Creates an article with properties and web content.
41
+ * @returns {Node} a sv:article node corresponding to the newly created article. Will never return null
42
+ * @param {Node} aParent - the parent node of the article. May not be null
43
+ * @param {Node} aTemplate - the sv:template node to be used for the article. May not be null
44
+ * @param {string} aName - the name of the sv:article. May not be null
45
+ * @param {Map<string, any>} properties - the article properties. May be null
46
+ * @param {Map<string, string>} content - a map containing the HTML content. The keys must correspond to layout names on the node. May be null
47
+ */
48
+ export function createArticle(
49
+ aParent: Node,
50
+ aTemplate: Node,
51
+ aName: string,
52
+ properties: Map<string, any>,
53
+ content: Map<string, string>
54
+ ): Node;
45
55
 
46
56
  /**
47
- * Alters the name of an article.
48
- * @param {Node} anArticle - the article that should be renamed. May not be null
49
- * @param {string} aName - the new name of the article. May not be null
50
- */
57
+ * Alters the name of an article.
58
+ * @param {Node} anArticle - the article that should be renamed. May not be null
59
+ * @param {string} aName - the new name of the article. May not be null
60
+ */
51
61
  export function renameArticle(anArticle: Node, aName: string): void;
52
62
 
53
63
  /**
54
- * Updates the properties of an article.
55
- * @param {Node} anArticle - the sv:article that will be altered. May not be null
56
- * @param {Map<string, any>} properties - the article properties. May not be null
57
- */
58
- export function updateArticle(anArticle: Node, properties: Map<string, any>): void;
64
+ * Updates the properties of an article.
65
+ * @param {Node} anArticle - the sv:article that will be altered. May not be null
66
+ * @param {Map<string, any>} properties - the article properties. May not be null
67
+ */
68
+ export function updateArticle(
69
+ anArticle: Node,
70
+ properties: Map<string, any>
71
+ ): void;
59
72
 
60
73
  declare namespace articleUtil {
61
74
  export {
@@ -79,5 +92,3 @@ declare namespace articleUtil {
79
92
  }
80
93
 
81
94
  export default articleUtil;
82
-
83
- PROPERTY_CREATED_BY
@@ -0,0 +1,95 @@
1
+ import List from '../../builtins/List';
2
+ import Node from '../../builtins/Node';
3
+
4
+ /**
5
+ * Returns a list of <code>Node</code> objects for all bookmarks belonging to
6
+ * the current user regardless of category. This method only returns valid bookmarks
7
+ * (existing, published objects)
8
+ *
9
+ * @return {List<Node>} a list of bookmark nodes. Is never <code>null</code>
10
+ */
11
+ export function getBookmarks(): List<Node>;
12
+
13
+ /**
14
+ * Returns a list of <code>Node</code> objects corresponding to the bookmarks for
15
+ * the current user and the provided categories. This method only returns valid bookmarks
16
+ * (existing, published objects)
17
+ *
18
+ * @param {string} category a comma separated list of categories or <code>null</code> for no category
19
+ * @return {List<Node>} a list of bookmark nodes. Is never <code>null</code>
20
+ */
21
+ export function getBookmarks(category: string): List<Node>;
22
+
23
+ /**
24
+ * Adds a bookmark for the current user. This operation is synchronized
25
+ *
26
+ * @param {Node} bookmark the node to be bookmarked must be a <code>sv:page</code>,
27
+ * <code>sv:sitePage</code> or an <code>sv:article</code>
28
+ * @param {string} categories a comma separated list of categories to where this bookmark belongs
29
+ * @throws IllegalArgumentException if <code>bookmark</code> is node of wrong type
30
+ * @throws NullPointerException if <code>bookmark</code> is <code>null</code>
31
+ * @deprecated Use {@link #add(javax.jcr.Node)}, categories will be resolved from metadata.
32
+ */
33
+ export function add(bookmark: Node, categories: string): void;
34
+
35
+ /**
36
+ * Adds a bookmark for the current user. This operation is synchronized
37
+ *
38
+ * @param {Node} bookmark the node to be bookmarked must be a <code>sv:page</code>,
39
+ * <code>sv:sitePage</code> or an <code>sv:article</code>
40
+ * @throws IllegalArgumentException if bookmark is node of wrong type
41
+ * @throws NullPointerException if <code>bookmark</code> is <code>null</code>
42
+ */
43
+ export function add(bookmark: Node): void;
44
+
45
+ /**
46
+ * Removes a bookmark for the current user. This operation is synchronized
47
+ *
48
+ * @param {Node} bookmark the bookmark
49
+ * @throws NullPointerException if <code>bookmark</code> is <code>null</code>
50
+ */
51
+ export function remove(bookmark: Node): void;
52
+
53
+ /**
54
+ * Checks if the current user has the provided bookmark
55
+ *
56
+ * @param {Node} bookmark the bookmark
57
+ * @return if the user has provided bookmark
58
+ * @throws NullPointerException if <code>bookmark</code> is <code>null</code>
59
+ */
60
+ export function contains(bookmark: Node): boolean;
61
+
62
+ /**
63
+ * Accesses a <code>boolean</code> indicating if the current site has a limited number of bookmarks.
64
+ *
65
+ * To get the max number of bookmarks, use {@link #getMaxNofBookmarks()}.
66
+ *
67
+ * @return {boolean} a <code>boolean</code> indicating if the current site has a limited number of bookmarks
68
+ * @throws NullPointerException if current site is indeterminable
69
+ * @see #getMaxNofBookmarks()
70
+ * @since Sitevision 2.6.1_01
71
+ */
72
+ export function getLimitNofBookmarks(): boolean;
73
+
74
+ /**
75
+ * Accessor to max number of bookmarks for the current site.
76
+ *
77
+ * @return {number} max number of bookmarks for the current site
78
+ * @throws NullPointerException if current site is indeterminable
79
+ * @see #getLimitNofBookmarks()
80
+ * @since Sitevision 2.6.1_01
81
+ */
82
+ export function getMaxNofBookmarks(): number;
83
+
84
+ declare namespace bookmarkUtil {
85
+ export {
86
+ getBookmarks,
87
+ add,
88
+ remove,
89
+ contains,
90
+ getLimitNofBookmarks,
91
+ getMaxNofBookmarks,
92
+ };
93
+ }
94
+
95
+ export default bookmarkUtil;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _default = {
8
+ getBookmarks: function getBookmarks() {},
9
+ add: function add() {},
10
+ remove: function remove() {},
11
+ contains: function contains() {},
12
+ getLimitNofBookmarks: function getLimitNofBookmarks() {},
13
+ getMaxNofBookmarks: function getMaxNofBookmarks() {}
14
+ };
15
+ exports["default"] = _default;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Gets the Internet Protocol (IP) address of the client (or last proxy) that initiated currently executing request.
3
+ *
4
+ * @return {string} a <code>String</code> containing the IP address of the client that sent the request, or <code>null</code> if indeterminable
5
+ */
6
+ export function getClientAddress(): string;
7
+
8
+ declare namespace clientUtil {
9
+ export { getClientAddress };
10
+ }
11
+
12
+ export default clientUtil;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _default = {
8
+ getClientAddress: function getClientAddress() {}
9
+ };
10
+ exports["default"] = _default;
@@ -0,0 +1,44 @@
1
+ import Node from '../../builtins/Node';
2
+
3
+ /**
4
+ * Gets the color with a given name
5
+ *
6
+ * @param {string} aColorName the name of the font
7
+ * @return {Node} the first color with name aColorName, or <code>null</code> if no color matches
8
+ */
9
+ export function getColorByName(aColorName: string): Node;
10
+
11
+ /**
12
+ * Gets the color with a given name with a fallback value if no color matches
13
+ *
14
+ * @param {string} aColorName the name of the font
15
+ * @param {Node} aDefaultValue fallback value
16
+ * @return {Node} the first color with name aColorName, or aDefaultValue if no color matches
17
+ */
18
+ export function getColorByName(aColorName: string, aDefaultValue: Node): Node;
19
+
20
+ /**
21
+ * Gets the color with a given html hex value (i.e. a '#' followed by 6 characters [0-9,a-f,A-F]).
22
+ *
23
+ * @param {string} aHexString the hex string value of the font (starts with a '#' and ends with 6 characters [0-9,a-f,A-F])
24
+ * @return {Node} the first color with the corresponding hex string, or <code>null</code> if no color matches
25
+ */
26
+ export function getColorByHtmlHexValue(aHexString: string): Node;
27
+
28
+ /**
29
+ * Gets the color with a given html hex value (i.e. a '#' followed by 6 characters [0-9,a-f,A-F]) with a fallback value if no color matches.
30
+ *
31
+ * @param {string} aHexString the hex string value of the font (starts with a '#' and ends with 6 characters [0-9,a-f,A-F])
32
+ * @param {Node} aDefaultValue fallback value
33
+ * @return {Node} the first color with the corresponding hex string, or aDefaultValue if no color matches
34
+ */
35
+ export function getColorByHtmlHexValue(
36
+ aHexString: string,
37
+ aDefaultValue: Node
38
+ ): Node;
39
+
40
+ declare namespace colorUtil {
41
+ export { getColorByName, getColorByHtmlHexValue };
42
+ }
43
+
44
+ export default colorUtil;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _default = {
8
+ getColorByName: function getColorByName() {},
9
+ getColorByHtmlHexValue: function getColorByHtmlHexValue() {}
10
+ };
11
+ exports["default"] = _default;
@@ -0,0 +1,174 @@
1
+ import Node from '../../builtins/Node';
2
+ import List from '../../builtins/List';
3
+
4
+ /**
5
+ * Necessary Site cookies (sv:siteCookie) of current site.
6
+ *
7
+ * @return {List<Node>} the necessary site cookies of current site, or empty list if current site has no site cookies
8
+ */
9
+ export function getNecessarySiteCookies(): List<Node>;
10
+
11
+ /**
12
+ * Gets the necessary site cookies category title.
13
+ *
14
+ * @return {string} necessary site cookies category title
15
+ */
16
+ export function getNecessarySiteCookiesTitle(): string;
17
+
18
+ /**
19
+ * Gets the necessary site cookies category description.
20
+ *
21
+ * @return {string} necessary site cookies category description
22
+ */
23
+ export function getNecessarySiteCookiesDescription(): string;
24
+
25
+ /**
26
+ * Analytics Site cookies (sv:siteCookie) of current site.
27
+ *
28
+ * @return {List<Node>} the analytics site cookies of current site, or empty list if current site has no site cookies
29
+ */
30
+ export function getAnalyticsSiteCookies(): List<Node>;
31
+
32
+ /**
33
+ * Gets the analytics site cookies category title.
34
+ *
35
+ * @return {string} analytics site cookies category title
36
+ */
37
+ export function getAnalyticsSiteCookiesTitle(): string;
38
+
39
+ /**
40
+ * Gets the analytics site cookies category description.
41
+ *
42
+ * @return {string} analytics site cookies category description
43
+ */
44
+ export function getAnalyticsSiteCookiesDescription(): string;
45
+
46
+ /**
47
+ * Marketing Site cookies (sv:siteCookie) of current site.
48
+ *
49
+ * @return {List<Node>} the marketing site cookies of current site, or empty list if current site has no site cookies
50
+ */
51
+ export function getMarketingSiteCookies(): List<Node>;
52
+
53
+ /**
54
+ * Gets the marketing site cookies category title.
55
+ *
56
+ * @return {string} marketing site cookies category title
57
+ */
58
+ export function getMarketingSiteCookiesTitle(): string;
59
+
60
+ /**
61
+ * Gets the marketing site cookies category description.
62
+ *
63
+ * @return {string} marketing site cookies category description
64
+ */
65
+ export function getMarketingSiteCookiesDescription(): string;
66
+
67
+ /**
68
+ * Custom Site cookies (sv:siteCookie) of current site.
69
+ *
70
+ * @return {List<Node>} the custom site cookies of current site, or empty list if current site has no site cookies
71
+ */
72
+ export function getCustomSiteCookies(): List<Node>;
73
+
74
+ /**
75
+ * Gets the custom site cookies category title.
76
+ *
77
+ * @return {string} custom site cookies category title
78
+ */
79
+ export function getCustomSiteCookiesTitle(): string;
80
+
81
+ /**
82
+ * Gets the custom site cookies category description.
83
+ *
84
+ * @return {string} custom site cookies category description
85
+ */
86
+ export function getCustomSiteCookiesDescription(): string;
87
+
88
+ /**
89
+ * Convenience method that resolves a sv:siteCookie Node from a given cookie identifier.
90
+ *
91
+ * @param {string} aCookieIdentifier the site cookie identifier
92
+ * @return {Node} the sv:siteCookie Node with the "cookieIdentifier" property that matches aCookieIdentifier. Returns null if
93
+ * aCookieIdentifier is null, blank or indeterminable
94
+ */
95
+ export function resolveSiteCookieByIdentifier(aCookieIdentifier: string): Node;
96
+
97
+ /**
98
+ * Checks whether or not current user explicitly has accepted a specific site cookie.
99
+ *
100
+ * @param {Node} aSiteCookie the sv:siteCookie
101
+ * @return {boolean} true if current user has accepted aSiteCookie, false otherwise
102
+ */
103
+ export function checkUserConsent(aSiteCookie: Node);
104
+
105
+ /**
106
+ * Whether or not current user has explicitly accepted/rejected all "user selectable" site cookies.
107
+ *
108
+ * @return {boolean} true if there are site cookies that current user hasn't yet accepted/rejected, false otherwise
109
+ * @see #hasUserConsentCookie()
110
+ */
111
+ export function hasPendingUserConsents(): boolean;
112
+
113
+ /**
114
+ * Whether or not current user has a consent cookie.
115
+ *
116
+ * @return {boolean} true if current user has a consent cookie set, false otherwise
117
+ * @see #hasPendingUserConsents()
118
+ */
119
+ export function hasUserConsentCookie(): boolean;
120
+
121
+ /**
122
+ * The name of the cookie that contains data about site cookie consents.
123
+ *
124
+ * @return {string} the name of the cookie that contains data about site cookie consents
125
+ */
126
+ export function getUserConsentCookieName(): string;
127
+
128
+ /**
129
+ * Generates a consent string that can be saved as cookie value for the cookie named {@link #getUserConsentCookieName()}.
130
+ *
131
+ * <p>
132
+ * <em>Note!</em> All "user selectable" sv:siteCookie Nodes that are <em>not</em> present in <code>aAllowCookieIdList</code>
133
+ * will be treated as rejected.
134
+ * </p>
135
+ *
136
+ * @param {List<Node>} aAllowCookieIdList the list of sv:siteCookie accepted by current user
137
+ * @return {string} a string that represents the accept/reject status for current sv:siteCookie's
138
+ * @throws IllegalArgumentException if aAllowCookieIdList is null or contains other than sv:siteCookie Nodes
139
+ */
140
+ export function createUserConsentCookieValue(
141
+ aAllowCookieIdList: List<Node>
142
+ ): string;
143
+
144
+ /**
145
+ * Gets all sv:siteCookie nodes that current user has accepted.
146
+ *
147
+ * @return {List<Node>} the list of sv:siteCookie Nodes current user has accepted. Returns empty list if site has no site cookies or if current user hasn't
148
+ * accepted any sv:siteCookie
149
+ */
150
+ export function getUserConsents(): List<Node>;
151
+
152
+ declare namespace siteCookieUtil {
153
+ export {
154
+ getNecessarySiteCookies,
155
+ getNecessarySiteCookiesTitle,
156
+ getNecessarySiteCookiesDescription,
157
+ getAnalyticsSiteCookies,
158
+ getAnalyticsSiteCookiesTitle,
159
+ getAnalyticsSiteCookiesDescription,
160
+ getMarketingSiteCookies,
161
+ getMarketingSiteCookiesTitle,
162
+ getMarketingSiteCookiesDescription,
163
+ getCustomSiteCookies,
164
+ getCustomSiteCookiesTitle,
165
+ getCustomSiteCookiesDescription,
166
+ resolveSiteCookieByIdentifier,
167
+ checkUserConsent,
168
+ hasPendingUserConsents,
169
+ hasUserConsentCookie,
170
+ getUserConsentCookieName,
171
+ createUserConsentCookieValue,
172
+ getUserConsents,
173
+ };
174
+ }
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _default = {
8
+ getNecessarySiteCookies: function getNecessarySiteCookies() {},
9
+ getNecessarySiteCookiesTitle: function getNecessarySiteCookiesTitle() {},
10
+ getNecessarySiteCookiesDescription: function getNecessarySiteCookiesDescription() {},
11
+ getAnalyticsSiteCookies: function getAnalyticsSiteCookies() {},
12
+ getAnalyticsSiteCookiesTitle: function getAnalyticsSiteCookiesTitle() {},
13
+ getAnalyticsSiteCookiesDescription: function getAnalyticsSiteCookiesDescription() {},
14
+ getMarketingSiteCookies: function getMarketingSiteCookies() {},
15
+ getMarketingSiteCookiesTitle: function getMarketingSiteCookiesTitle() {},
16
+ getMarketingSiteCookiesDescription: function getMarketingSiteCookiesDescription() {},
17
+ getCustomSiteCookies: function getCustomSiteCookies() {},
18
+ getCustomSiteCookiesTitle: function getCustomSiteCookiesTitle() {},
19
+ getCustomSiteCookiesDescription: function getCustomSiteCookiesDescription() {},
20
+ resolveSiteCookieByIdentifier: function resolveSiteCookieByIdentifier() {},
21
+ checkUserConsent: function checkUserConsent() {},
22
+ hasPendingUserConsents: function hasPendingUserConsents() {},
23
+ hasUserConsentCookie: function hasUserConsentCookie() {},
24
+ getUserConsentCookieName: function getUserConsentCookieName() {},
25
+ createUserConsentCookieValue: function createUserConsentCookieValue() {},
26
+ getUserConsents: function getUserConsents() {}
27
+ };
28
+ exports["default"] = _default;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The offline version (i.e. the version used when editing in the Sitevision editor) marker
3
+ */
4
+ export const OFFLINE_VERSION: number;
5
+ /**
6
+ * The online version (i.e. the published version that visitors can access) marker
7
+ */
8
+ export const ONLINE_VERSION: number;
9
+
10
+ /**
11
+ * Gets current version
12
+ *
13
+ * @return {@link #OFFLINE_VERSION} or {@link #ONLINE_VERSION}. If current version is undeterminable, -1 is returned.
14
+ */
15
+ export function getCurrentVersion(): number;
16
+
17
+ declare namespace versionUtil {
18
+ export { OFFLINE_VERSION, ONLINE_VERSION, getCurrentVersion };
19
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _default = {
8
+ OFFLINE_VERSION: 0,
9
+ ONLINE_VERSION: 1,
10
+ getCurrentVersion: function getCurrentVersion() {}
11
+ };
12
+ exports["default"] = _default;
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Gets the default XSL template for cleanup of HTML sources.
3
+ *
4
+ * <p>
5
+ * The template strips all &lt;div&gt;'s, &lt;spans&gt;'s and removes all inline styling, classes and attributes
6
+ * that is not mandatory or needed for WCAG purposes.
7
+ * </p>
8
+ * <p>
9
+ * <em>Note!</em> The template supports a <em>sub-set</em> of HTML elements (the presumed most commonly used elements).
10
+ * All unsupported elements are completely discarded (i.e. they will not be included at all in the transformation result).
11
+ * </p>
12
+ *
13
+ * @return {string} the default cleanup template for HTML sources
14
+ */
15
+ export function getDefaultCleanHtmlTemplate(): string;
16
+
17
+ /**
18
+ * Transforms a HTML/XML source using a XSL template.
19
+ *
20
+ * <p>
21
+ * <em>Note!</em> The contents of the XSL Template is always handled as UTF-8.
22
+ * </p>
23
+ *
24
+ * @param {string} aSource the source that should be transformed, HTML, XHTML or XML. Must not be null
25
+ * @param {any} aXslTemplate the UTF-8 XSL template;
26
+ * a sv:file Node, a sv:temporaryFile Node, a sv:link Node that targets a sv:file, a char array or a CharSequence
27
+ * (typically a String). Must not be null
28
+ * @return {string} the transformation result
29
+ * @throws IOException if the transformation fails (e.g. the aSource is really bad/interpretable HTML or aXslTemplate is invalid XSL)
30
+ * @throws RepositoryException if aNode-operation on aXslTemplate fails
31
+ */
32
+ export function transform(aSource: string, aXslTemplate: any): string;
33
+
34
+ declare namespace xsltUtil {
35
+ export { getDefaultCleanHtmlTemplate, transform };
36
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _default = {
8
+ getDefaultCleanHtmlTemplate: function getDefaultCleanHtmlTemplate() {},
9
+ transform: function transform() {}
10
+ };
11
+ exports["default"] = _default;
@@ -0,0 +1,117 @@
1
+ import Node from '../builtins/Node';
2
+ import Collection from '../builtins/Collection';
3
+
4
+ interface XmlElement {
5
+ /**
6
+ * Gets the name of the element
7
+ *
8
+ * @return {string} the element name
9
+ */
10
+ getName(): string;
11
+
12
+ /**
13
+ * Gets the text content of the element.
14
+ *
15
+ * @return {string} the text content of the element or null if no text content is available.
16
+ */
17
+ getText(): string;
18
+
19
+ /**
20
+ * Gets an attribute value of the element.
21
+ *
22
+ * @param {string} aName the attribute name
23
+ * @return {string} the attribute value or null if no value is associated with attribute
24
+ */
25
+ getAttribute(aName: string): string;
26
+
27
+ /**
28
+ * Check if a sub element with a specific name is available in the element.
29
+ *
30
+ * @param {string} aName name of the sub element of this element, must be non-null.
31
+ * @return {boolean} true if one or more sub elements with the specific name is available
32
+ */
33
+ hasElement(aName: string): boolean;
34
+
35
+ /**
36
+ * Gets the first sub element with a specific name of the element.
37
+ *
38
+ * @param {string} aName name of the sub element of this element, must be non-null.
39
+ * @return {XmlElement} the sub element or null if no sub element is found.
40
+ */
41
+ getElement(aName: string): XmlElement;
42
+
43
+ /**
44
+ * Gets all sub element with a specific name of the element.
45
+ *
46
+ * @param {string} aName name of the sub element of this element, must be non-null.
47
+ * @return {Collection<XmlElement>}the sub elements or an empty collection if no sub elements are available
48
+ */
49
+ getElements(aName: string): Collection<XmlElement>;
50
+
51
+ /**
52
+ * Gets all sub elements of the element.
53
+ *
54
+ * @return {Collection<XmlElement>} a list of all sub elements
55
+ */
56
+ getElements(): Collection<XmlElement>;
57
+ }
58
+
59
+ interface XmlElementHandler {
60
+ /**
61
+ * Called when a element matching the selection has been parsed.
62
+ *
63
+ * @param {XmlElement} aXmlElement the element
64
+ */
65
+ handleElement(aXmlElement: XmlElement): void;
66
+ }
67
+
68
+ /**
69
+ * Parse a XML string.
70
+ *
71
+ * @param {string} aElementSelection the elements in the XML that should be passed to the XmlElementHandler
72
+ * @param {string} aXml the UTF-8 XML string
73
+ * @param {XmlElementHandler} aXmlElementHandler the XmlElementHandler
74
+ * @throws XmlParserException if an error occurs while parsing the XML
75
+ */
76
+ export function parse(
77
+ aElementSelection: string,
78
+ aXml: string,
79
+ aXmlElementHandler: XmlElementHandler
80
+ ): void;
81
+
82
+ /**
83
+ * Parse a file containing XML encoded using UTF-8.
84
+ *
85
+ * @param {string} aElementSelection the elements in the XML that should be passed to the XmlElementHandler
86
+ * @param {Node} aXmlFile the file containing XML encoded using UTF-8 (sv:file or sv:temporaryFile)
87
+ * @param {XmlElementHandler} aXmlElementHandler the XmlElementHandler
88
+ * @throws RepositoryException if an error occurs while accessing the file
89
+ * @throws XmlParserException if an error occurs while parsing the XML
90
+ */
91
+ export function parse(
92
+ aElementSelection: string,
93
+ aXmlFile: Node,
94
+ aXmlElementHandler: XmlElementHandler
95
+ ): void;
96
+
97
+ /**
98
+ * Parse a file containing XML encoded with the supplied charset.
99
+ *
100
+ * @param {string} aElementSelection the elements in the XML that should be passed to the XmlElementHandler
101
+ * @param {Node} aXmlFile the file containing XML encoded using supplied encoding (sv:file or sv:temporaryFile)
102
+ * @param {string} aCharset the character encoding of the the file content
103
+ * (an IllegalArgument will be thrown if aCharset can not be resolved as a java.nio.charset.Charset)
104
+ * @param {XmlElementHandler} aXmlElementHandler the XmlElementHandler
105
+ * @throws RepositoryException if an error occurs while accessing the file
106
+ * @throws XmlParserException if an error occurs while parsing the XML
107
+ */
108
+ export function parse(
109
+ aElementSelection: string,
110
+ aXmlFile: Node,
111
+ aCharset: string,
112
+ aXmlElementHandler: XmlElementHandler
113
+ ): void;
114
+
115
+ declare namespace xmlParserUtil {
116
+ export { parse };
117
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _default = {
8
+ parse: function parse() {}
9
+ };
10
+ exports["default"] = _default;