@maccesar/titools 3.3.0 → 4.0.0

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.
Files changed (101) hide show
  1. package/README.md +27 -61
  2. package/lib/cleanup.js +29 -0
  3. package/lib/commands/agents.js +8 -7
  4. package/lib/commands/skills.js +118 -23
  5. package/lib/config.js +13 -15
  6. package/lib/installer.js +5 -3
  7. package/lib/utils.js +36 -0
  8. package/package.json +1 -1
  9. package/skills/alloy-guides/SKILL.md +188 -0
  10. package/skills/alloy-guides/references/CLI_TASKS.md +233 -0
  11. package/skills/alloy-guides/references/CONCEPTS.md +171 -0
  12. package/skills/alloy-guides/references/CONTROLLERS.md +279 -0
  13. package/skills/alloy-guides/references/MODELS.md +742 -0
  14. package/skills/alloy-guides/references/MODELS_ADVANCED.md +482 -0
  15. package/skills/alloy-guides/references/PURGETSS.md +57 -0
  16. package/skills/alloy-guides/references/VIEWS_DYNAMIC.md +235 -0
  17. package/skills/alloy-guides/references/VIEWS_STYLES.md +375 -0
  18. package/skills/alloy-guides/references/VIEWS_WITHOUT_CONTROLLERS.md +102 -0
  19. package/skills/alloy-guides/references/VIEWS_XML.md +581 -0
  20. package/skills/alloy-guides/references/WIDGETS.md +160 -0
  21. package/skills/alloy-howtos/SKILL.md +179 -0
  22. package/skills/alloy-howtos/references/best_practices.md +121 -0
  23. package/skills/alloy-howtos/references/cli_reference.md +230 -0
  24. package/skills/alloy-howtos/references/config_files.md +158 -0
  25. package/skills/alloy-howtos/references/custom_tags.md +148 -0
  26. package/skills/alloy-howtos/references/debugging_troubleshooting.md +78 -0
  27. package/skills/alloy-howtos/references/samples.md +156 -0
  28. package/skills/purgetss/SKILL.md +6 -3
  29. package/skills/purgetss/references/EXAMPLES.md +8 -6
  30. package/skills/purgetss/references/app-branding.md +5 -0
  31. package/skills/purgetss/references/apply-directive.md +1 -1
  32. package/skills/purgetss/references/class-categories.md +1 -1
  33. package/skills/purgetss/references/class-index-properties.md +618 -0
  34. package/skills/purgetss/references/class-index.md +4 -610
  35. package/skills/purgetss/references/cli-commands.md +15 -0
  36. package/skills/purgetss/references/custom-fonts.md +39 -36
  37. package/skills/purgetss/references/custom-rules.md +1 -1
  38. package/skills/purgetss/references/customization-deep-dive.md +64 -1
  39. package/skills/purgetss/references/icon-fonts.md +2 -0
  40. package/skills/purgetss/references/migration-guide.md +53 -1
  41. package/skills/purgetss/references/multi-density-images.md +53 -2
  42. package/skills/purgetss/references/svg-pipeline.md +249 -0
  43. package/skills/purgetss/references/tikit-components.md +2 -2
  44. package/skills/purgetss/references/titanium-resets.md +2 -2
  45. package/skills/purgetss/references/ui-ux-design.md +7 -5
  46. package/skills/purgetss/references/version-history.md +12 -0
  47. package/skills/ti-api/SKILL.md +128 -0
  48. package/skills/ti-api/references/api-android.md +675 -0
  49. package/skills/ti-api/references/api-app-platform.md +636 -0
  50. package/skills/ti-api/references/api-core.md +764 -0
  51. package/skills/ti-api/references/api-data-network.md +641 -0
  52. package/skills/ti-api/references/api-media.md +655 -0
  53. package/skills/ti-api/references/api-modules-ble-bluetooth.md +657 -0
  54. package/skills/ti-api/references/api-modules-coremotion-urlsession.md +411 -0
  55. package/skills/ti-api/references/api-modules-map.md +632 -0
  56. package/skills/ti-api/references/api-modules-nfc.md +725 -0
  57. package/skills/ti-api/references/api-modules-social-misc.md +526 -0
  58. package/skills/ti-api/references/api-services.md +700 -0
  59. package/skills/ti-api/references/api-ui-android.md +499 -0
  60. package/skills/ti-api/references/api-ui-extras.md +702 -0
  61. package/skills/ti-api/references/api-ui-ios-animator.md +378 -0
  62. package/skills/ti-api/references/api-ui-ios.md +756 -0
  63. package/skills/ti-api/references/api-ui-lists.md +581 -0
  64. package/skills/ti-api/references/api-ui-text-input.md +607 -0
  65. package/skills/ti-api/references/api-ui-views.md +572 -0
  66. package/skills/ti-api/references/api-ui-windows-navigation.md +676 -0
  67. package/skills/ti-api/references/api-xml-global.md +743 -0
  68. package/skills/ti-guides/SKILL.md +82 -0
  69. package/skills/ti-guides/references/advanced-data-and-images.md +155 -0
  70. package/skills/ti-guides/references/android-manifest.md +97 -0
  71. package/skills/ti-guides/references/app-distribution.md +373 -0
  72. package/skills/ti-guides/references/application-frameworks.md +366 -0
  73. package/skills/ti-guides/references/cli-reference.md +700 -0
  74. package/skills/ti-guides/references/coding-best-practices.md +150 -0
  75. package/skills/ti-guides/references/commonjs-advanced.md +279 -0
  76. package/skills/ti-guides/references/hello-world.md +99 -0
  77. package/skills/ti-guides/references/hyperloop-native-access.md +458 -0
  78. package/skills/ti-guides/references/javascript-primer.md +402 -0
  79. package/skills/ti-guides/references/reserved-words.md +36 -0
  80. package/skills/ti-guides/references/resources.md +172 -0
  81. package/skills/ti-guides/references/style-and-conventions.md +104 -0
  82. package/skills/ti-guides/references/tiapp-config.md +655 -0
  83. package/skills/ti-howtos/SKILL.md +131 -0
  84. package/skills/ti-howtos/references/android-platform-deep-dives.md +609 -0
  85. package/skills/ti-howtos/references/automation-fastlane-appium.md +96 -0
  86. package/skills/ti-howtos/references/buffer-codec-streams.md +162 -0
  87. package/skills/ti-howtos/references/cross-platform-development.md +358 -0
  88. package/skills/ti-howtos/references/debugging-profiling.md +473 -0
  89. package/skills/ti-howtos/references/extending-titanium.md +684 -0
  90. package/skills/ti-howtos/references/google-maps-v2.md +172 -0
  91. package/skills/ti-howtos/references/ios-map-kit.md +149 -0
  92. package/skills/ti-howtos/references/ios-platform-deep-dives.md +595 -0
  93. package/skills/ti-howtos/references/local-data-sources.md +310 -0
  94. package/skills/ti-howtos/references/location-and-maps.md +267 -0
  95. package/skills/ti-howtos/references/media-apis.md +268 -0
  96. package/skills/ti-howtos/references/notification-services.md +539 -0
  97. package/skills/ti-howtos/references/remote-data-sources.md +339 -0
  98. package/skills/ti-howtos/references/tutorials.md +552 -0
  99. package/skills/ti-howtos/references/using-modules.md +182 -0
  100. package/skills/ti-howtos/references/web-content-integration.md +288 -0
  101. package/skills/ti-howtos/references/webpack-build-pipeline.md +125 -0
@@ -0,0 +1,743 @@
1
+ # Ti.XML & Global API Reference
2
+
3
+ ## Ti.XML
4
+ > The top level XML module. The XML module is used for parsing and processing XML-based content.
5
+ > Extends Ti.Module
6
+ > Platforms: both
7
+ > Type: module
8
+
9
+ The API for this module is based on the W3C DOM specification.
10
+
11
+ Android and iOS implement the [DOM Level 2](https://www.w3.org/TR/DOM-Level-2-Core/core.html) specification
12
+ with some non-standard extensions, which are documented in the appropriate places.
13
+
14
+ Both iOS and Android lack DTD support.
15
+
16
+
17
+ ### Methods (2)
18
+ | Method | Returns | Platform | Description |
19
+ |--------|---------|----------|-------------|
20
+ | parseString(xml) | Ti.XML.Document | both | Parses an XML string into a <Titanium.XML.Document> object. |
21
+ | serializeToString(node) | String | both | Serializes a [Node](Titanium.XML.Node) object into a string. |
22
+
23
+
24
+ ---
25
+
26
+ ## Ti.XML.Attr
27
+ > Represents an attribute of an [Element](Titanium.XML.Element).
28
+ > Extends Ti.XML.Node
29
+ > Platforms: both
30
+
31
+ Implements the [DOM Level 2 API](https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-637646024) on
32
+ Android and iOS.
33
+
34
+ ### Properties (unique: 4/35)
35
+ | Property | Type | Default | Platform | Description |
36
+ |----------|------|---------|----------|-------------|
37
+ | name | String | — | both | Attribute name |
38
+ | ownerElement | Ti.XML.Element | — | both | The <Titanium.XML.Element> to which the attribute belongs. |
39
+ | specified | Boolean | — | both | True if this attribute was explicitly given a value in the instance document, f… |
40
+ | value | String | — | both | The attribute value as a string. |
41
+
42
+
43
+
44
+
45
+ ---
46
+
47
+ ## Ti.XML.CDATASection
48
+ > Used to include blocks of literal text containing characters that would otherwise need to be escaped.
49
+ > Extends Ti.XML.Text
50
+ > Platforms: both
51
+
52
+ Implements the [DOM Level 2 API](https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-667469212) on
53
+ Android and iOS with some non-standard extensions.
54
+
55
+
56
+
57
+
58
+ ---
59
+
60
+ ## Ti.XML.CharacterData
61
+ > An interface extending <Titanium.XML.Node> with a set of attributes and methods for accessing character data in the DOM. Implements the [DOM Level 2 API](https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-FF21A306) on Android and iOS. For reasons of compatibility with the JavaScript engine, text is represented by UTF-8 instead of UTF-16 on Android and iOS.
62
+ > Extends Ti.XML.Node
63
+ > Platforms: both
64
+
65
+ ### Properties (unique: 2/33)
66
+ | Property | Type | Default | Platform | Description |
67
+ |----------|------|---------|----------|-------------|
68
+ | data | String | — | both | The character data of the node that implements this interface. Throws an except… |
69
+ | length | Number | — | both | The number of characters that are available through data and the substringData … |
70
+
71
+
72
+ ### Methods (5)
73
+ | Method | Returns | Platform | Description |
74
+ |--------|---------|----------|-------------|
75
+ | appendData(arg) | void | both | Append the string to the end of the character data of the node. Upon success, d… |
76
+ | deleteData(offset, count) | void | both | Remove a range of characters from the node. Upon success, data and length refle… |
77
+ | insertData(offset, arg) | void | both | Insert a string at the specified offset. Throws an exception if this node is re… |
78
+ | replaceData(offset, count, arg) | void | both | Replace the characters starting at the specified offset with the specified stri… |
79
+ | substringData(offset, count) | String | both | Extracts a range of data from the node. Throws an exception if offset is negati… |
80
+
81
+
82
+ ---
83
+
84
+ ## Ti.XML.Comment
85
+ > Represents the contents of an XML comment.
86
+ > Extends Ti.XML.CharacterData
87
+ > Platforms: both
88
+
89
+ Implements the [DOM Level 2 API](https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1728279322) on
90
+ Android and iOS with some non-standard extensions.
91
+
92
+
93
+
94
+
95
+ ---
96
+
97
+ ## Ti.XML.DOMImplementation
98
+ > The <Titanium.XML.DOMImplementation> interface provides a number of methods for performing operations that are independent of any particular instance of the document object model.Implements the [DOM Level 2 API](https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-102161490) on Android and iOS.
99
+ > Extends Ti.Proxy
100
+ > Platforms: both
101
+
102
+
103
+ ### Methods (3)
104
+ | Method | Returns | Platform | Description |
105
+ |--------|---------|----------|-------------|
106
+ | createDocument(namespaceURI, qualifiedName, doctype) | Ti.XML.Document | both | Creates an <Titanium.XML.Document> object of the specified type with its docume… |
107
+ | createDocumentType(qualifiedName, publicId, systemId) | Ti.XML.DocumentType | both | Creates an empty <Titanium.XML.DocumentType> node. Entity declarations and nota… |
108
+ | hasFeature(feature, version) | Boolean | both | Test if the <Titanium.XML.DOMImplementation> implements a specific feature. |
109
+
110
+
111
+ ---
112
+
113
+ ## Ti.XML.Document
114
+ > The DOM Document returned from <Titanium.XML.parseString>.
115
+ > Extends Ti.XML.Node
116
+ > Platforms: both
117
+
118
+ Implements the [DOM Level 2 API](https://www.w3.org/TR/DOM-Level-2-Core/core.html#i-Document) on
119
+ Android and iOS.
120
+
121
+ As of version 3.1, Android does not truly support DTDs. A document with a DTD can be
122
+ parsed, however it is not validated, its default attributes are not be automatically
123
+ added into the DOM tree, and so on.
124
+
125
+ This has been reported as [Android Issue #7395](http://code.google.com/p/android/issues/detail?id=7395).
126
+
127
+ ### Properties (unique: 3/34)
128
+ | Property | Type | Default | Platform | Description |
129
+ |----------|------|---------|----------|-------------|
130
+ | doctype | Ti.XML.DocumentType | — | both | An interface to the list of entities that are defined for the document, such as… |
131
+ | documentElement | Ti.XML.Element | — | both | Root element of this document. |
132
+ | implementation | Ti.XML.DOMImplementation | — | both | [DOMImplementation](Titanium.XML.DOMImplementation) object associated with this… |
133
+
134
+
135
+ ### Methods (14)
136
+ | Method | Returns | Platform | Description |
137
+ |--------|---------|----------|-------------|
138
+ | createAttribute(name) | Ti.XML.Attr | both | Creates an attribute with the given name. |
139
+ | createAttributeNS(namespaceURI, name) | Ti.XML.Attr | both | Creates an attribute with the given name and namespace. |
140
+ | createCDATASection(data) | Ti.XML.CDATASection | both | Creates and returns a [CDATASection](Titanium.XML.CDATASection). |
141
+ | createComment(data) | Ti.XML.Comment | both | Creates a [Comment](Titanium.XML.Comment) with the supplied string data. |
142
+ | createDocumentFragment(—) | Ti.XML.DocumentFragment | both | Creates an empty [DocumentFragment](Titanium.XML.DocumentFragment). |
143
+ | createElement(tagName) | Ti.XML.Element | both | Creates an element with the given tag name. |
144
+ | createElementNS(namespaceURI, name) | Ti.XML.Element | both | Create a new element with the given namespace and name. |
145
+ | createEntityReference(name) | Ti.XML.EntityReference | both | Creates an [EntityReference](Titanium.XML.EntityReference) with the given name. |
146
+ | createProcessingInstruction(target, data) | Ti.XML.ProcessingInstruction | both | Creates a processing instruction for inserting into the DOM tree. |
147
+ | createTextNode(data) | Ti.XML.Text | both | Creates a text node. |
148
+ | getElementById(elementId) | Ti.XML.Element | both | Returns an [Element](Titanium.XML.Element) that has an ID attribute with the gi… |
149
+ | getElementsByTagName(tagname) | Ti.XML.NodeList | both | Returns a node list of elements in the document which have the given tag. |
150
+ | getElementsByTagNameNS(namespaceURI, localname) | Ti.XML.NodeList | both | Returns a node list of elements in the document which belong to the given names… |
151
+ | importNode(importedNode, deep) | Ti.XML.Node | both | Imports a node from another document to this document, without altering or remo… |
152
+
153
+
154
+ ---
155
+
156
+ ## Ti.XML.DocumentFragment
157
+ > A lightweight document object used as a container for a group of nodes.
158
+ > Extends Ti.XML.Node
159
+ > Platforms: both
160
+
161
+ When a `DocumentFragment` is inserted into a DOM tree, children of the `DocumentFragment` are
162
+ added, not the `DocumentFragment` itself.
163
+
164
+ Implements the [DOM Level 2 API](https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-B63ED1A3) on
165
+ Android and iOS with some non-standard extensions.
166
+
167
+
168
+
169
+
170
+ ---
171
+
172
+ ## Ti.XML.DocumentType
173
+ > Each <Titanium.XML.Document> has a `doctype` attribute whose value is either 'null' or a <Titanium.XML.DocumentType> object.
174
+ > Extends Ti.XML.Node
175
+ > Platforms: both
176
+
177
+ This provides an interface to the list of entities that are defined for the document. Implements the
178
+ [DOM Level 2 API](https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-412266927) on Android and iOS.
179
+
180
+ As of version 3.1, Android still does not truly support DTDs. A document with a DTD can be
181
+ parsed, however it is not validated, none of its default attributes will automatically be put
182
+ into the tree, etc. [Google is aware of the issue](http://code.google.com/p/android/issues/detail?id=7395).
183
+
184
+ ### Properties (unique: 6/37)
185
+ | Property | Type | Default | Platform | Description |
186
+ |----------|------|---------|----------|-------------|
187
+ | entities | Ti.XML.NamedNodeMap | — | both | A <Titanium.XML.NamedNodeMap> containing the general entities, both external an… |
188
+ | internalSubset | String | — | both | The internal subset as a string. |
189
+ | name | String | — | both | The name of DTD; i.e., the name immediately following the `DOCTYPE` keyword. |
190
+ | notations | Ti.XML.NamedNodeMap | — | both | A <Titanium.XML.NamedNodeMap> containing the notations declared in the DTD. Dup… |
191
+ | publicId | String | — | both | The public identifier of the external subset. |
192
+ | systemId | String | — | both | The system identifier of the external subset. |
193
+
194
+
195
+
196
+
197
+ ---
198
+
199
+ ## Ti.XML.Element
200
+ > Represents an element in a DOM document, a <Titanium.XML.Node> defined by a start-tag and end-tag (or an empty tag). Elements may have [attributes](Titanium.XML.Attr) associated with them. Implements the [DOM Level 2 API](https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-745549614) on Android and iOS with some non-standard extensions.
201
+ > Extends Ti.XML.Node
202
+ > Platforms: both
203
+
204
+ ### Properties (unique: 3/32)
205
+ | Property | Type | Default | Platform | Description |
206
+ |----------|------|---------|----------|-------------|
207
+ | textContent | String | — | both | Content (value) of all text nodes within this node. |
208
+ | text | String | — | both | Content (value) of all text nodes within this node. |
209
+ | tagName | String | — | both | The name of the element, as defined by its tag. |
210
+
211
+
212
+ ### Methods (15)
213
+ | Method | Returns | Platform | Description |
214
+ |--------|---------|----------|-------------|
215
+ | getAttribute(name) | String | both | Retrieves an attribute value by name, returning it as a string. |
216
+ | setAttribute(name, value) | void | both | Adds a new attribute. Any attribute with the same name is replaced. Throws an e… |
217
+ | removeAttribute(name) | void | both | Removes an attribute by name. If the attribute has a default value, it is immed… |
218
+ | getAttributeNode(name) | Ti.XML.Attr | both | Retrieves an attribute value by name, returning it as a <Titanium.XML.Attr> obj… |
219
+ | setAttributeNode(newAttr) | Ti.XML.Attr | both | Adds a new attribute. Any attribute with the same `nodeName` as the argument is… |
220
+ | removeAttributeNode(oldAttr) | void | both | Removes the specified attribute node. If the removed attribute has a default va… |
221
+ | getElementsByTagName(name) | Ti.XML.NodeList | both | Retrieves a <Titanium.XML.NodeList> of all descendant elements with a given tag… |
222
+ | getAttributeNS(namespaceURI, localName) | String | both | Retrieves an attribute value by local name and namespace URI, returning it as a… |
223
+ | setAttributeNS(namespaceURI, qualifiedName, value) | void | both | Adds a new attribute. Any attribute with the same local name and namespace URI … |
224
+ | removeAttributeNS(namespaceURI, localName) | void | both | Removes an attribute by local name and namespace URI. If the attribute has a de… |
225
+ | getAttributeNodeNS(namespaceURI, localName) | Ti.XML.Attr | both | Retrieves an attribute value by local name and namespace URI, returning it as a… |
226
+ | setAttributeNodeNS(newAttr) | Ti.XML.Attr | both | Adds a new attribute. Any attribute with the same local name and namespace URI … |
227
+ | getElementsByTagNameNS(namespaceURI, localName) | Ti.XML.NodeList | both | Retrieves a <Titanium.XML.NodeList> of all descendant elements with a given loc… |
228
+ | hasAttribute(name) | Boolean | both | Determines whether or not an attribute with the given name is available in the … |
229
+ | hasAttributeNS(namespaceURI, localName) | Boolean | both | Determines whether or not an attribute with the given name is available in the … |
230
+
231
+
232
+ ---
233
+
234
+ ## Ti.XML.Entity
235
+ > This interface represents an entity, either parsed or unparsed, in an XML document. Note that this models the entity itself not the entity declaration. The nodeName attribute that is inherited from Node contains the name of the entity. An Entity node does not have any parent. Implements the [DOM Level 2 API](https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-527DCFF2) on Android and iOS.
236
+ > Extends Ti.XML.Node
237
+ > Platforms: both
238
+
239
+ ### Properties (unique: 3/34)
240
+ | Property | Type | Default | Platform | Description |
241
+ |----------|------|---------|----------|-------------|
242
+ | notationName | String | — | both | For unparsed entities, the name of the notation for the entity. For parsed enti… |
243
+ | publicId | String | — | both | The public identifier associated with the entity, if specified. If the public i… |
244
+ | systemId | String | — | both | The system identifier associated with the entity, if specified. If the system i… |
245
+
246
+
247
+
248
+
249
+ ---
250
+
251
+ ## Ti.XML.EntityReference
252
+ > Represents an XML entity reference.
253
+ > Extends Ti.XML.Node
254
+ > Platforms: both
255
+
256
+ Implements the [DOM Level 2 API](https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-11C98490)
257
+ on Android and iOS.
258
+
259
+
260
+
261
+
262
+ ---
263
+
264
+ ## Ti.XML.NamedNodeMap
265
+ > A key-value paired map that maps String objects to <Titanium.XML.Node> objects. Implements the [DOM Level 2 API](https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1780488922) on Android and iOS.
266
+ > Extends Ti.Proxy
267
+ > Platforms: both
268
+
269
+ ### Properties (unique: 1/4)
270
+ | Property | Type | Default | Platform | Description |
271
+ |----------|------|---------|----------|-------------|
272
+ | length | Number | — | both | The number of nodes in the map. The valid range of child node indices is 0-`len… |
273
+
274
+
275
+ ### Methods (7)
276
+ | Method | Returns | Platform | Description |
277
+ |--------|---------|----------|-------------|
278
+ | getNamedItem(name) | Ti.XML.Node | both | Retrieves a node specified by name. |
279
+ | setNamedItem(node) | Ti.XML.Node | both | Adds a node using its `nodeName` attribute. If a node with that name is already… |
280
+ | removeNamedItem(name) | Ti.XML.Node | both | Removes a node from the map specified by name. When this map contains attribute… |
281
+ | item(index) | Ti.XML.Node | both | Retrieves the node at the specified index of the map. Note that NamedNodeMaps a… |
282
+ | getNamedItemNS(namespaceURI, localName) | Ti.XML.Node | both | Retrieves a node specified by name and namespace. Returns `null` if no matching… |
283
+ | setNamedItemNS(node) | Ti.XML.Node | both | Adds a node using its `namespaceURI` and `localName` attributes. If a node with… |
284
+ | removeNamedItemNS(namespaceURI, localName) | Ti.XML.Node | both | Removes a node from the map specified by local name and namespace URI. When thi… |
285
+
286
+
287
+ ---
288
+
289
+ ## Ti.XML.Node
290
+ > A single node in the [Document](Titanium.XML.Document) tree.
291
+ > Extends Ti.Proxy
292
+ > Platforms: both
293
+
294
+ Implements the [DOM Level 2 API](https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1950641247)
295
+ on Android and iOS.
296
+
297
+ Note that on iOS, only [Element](Titanium.XML.Element) nodes are mutable. This means
298
+ that the methods `appendChild`, `insertBefore`, `removeChild`, and
299
+ `replaceChild` only work on `Element` objects. If one of these methods is called on
300
+ another type of node, it throws an exception.
301
+
302
+ ### Properties (unique: 16/31)
303
+ | Property | Type | Default | Platform | Description |
304
+ |----------|------|---------|----------|-------------|
305
+ | nodeName | String | — | both | Name of this node. |
306
+ | nodeValue | String | — | both | Content (value) of this node. |
307
+ | textContent | String | — | ios | Content (value) of all text nodes within this node. |
308
+ | text | String | — | ios | Content (value) of all text nodes within this node. |
309
+ | nodeType | Number | — | both | This node's type. One of `ELEMENT_NODE`, `ATTRIBUTE_NODE`, `TEXT_NODE`, `CDATA_… |
310
+ | parentNode | Ti.XML.Node | — | both | This node's parent node. |
311
+ | childNodes | Ti.XML.NodeList | — | both | A <Titanium.XML.NodeList> of this node's children. |
312
+ | firstChild | Ti.XML.Node | — | both | This node's first child. |
313
+ | lastChild | Ti.XML.Node | — | both | This node's last child. |
314
+ | previousSibling | Ti.XML.Node | — | both | This node's previous sibling. |
315
+ | nextSibling | Ti.XML.Node | — | both | This node's next sibling. |
316
+ | attributes | Ti.XML.NamedNodeMap | — | both | A map of this node's attributes. |
317
+ | ownerDocument | Ti.XML.Document | — | both | This node's owning document. |
318
+ | namespaceURI | String | — | both | Namespace URI of this node. |
319
+ | prefix | String | — | both | Namespace prefix of this node. |
320
+ | localName | String | — | both | Local part of the qualified name of this node. |
321
+
322
+ ### Constants (12)
323
+ - **ATTRIBUTE_\***: ATTRIBUTE_NODE
324
+ - **CDATA_SECTION_\***: CDATA_SECTION_NODE
325
+ - **COMMENT_\***: COMMENT_NODE
326
+ - **DOCUMENT_\***: DOCUMENT_NODE
327
+ - **DOCUMENT_FRAGMENT_\***: DOCUMENT_FRAGMENT_NODE
328
+ - **DOCUMENT_TYPE_\***: DOCUMENT_TYPE_NODE
329
+ - **ELEMENT_\***: ELEMENT_NODE
330
+ - **ENTITY_\***: ENTITY_NODE
331
+ - **ENTITY_REFERENCE_\***: ENTITY_REFERENCE_NODE
332
+ - **NOTATION_\***: NOTATION_NODE
333
+ - **PROCESSING_INSTRUCTION_\***: PROCESSING_INSTRUCTION_NODE
334
+ - **TEXT_\***: TEXT_NODE
335
+
336
+
337
+ ### Methods (9)
338
+ | Method | Returns | Platform | Description |
339
+ |--------|---------|----------|-------------|
340
+ | appendChild(newChild) | Ti.XML.Node | both | Appends the node `newChild` as a child of this node. |
341
+ | cloneNode(deep) | Ti.XML.Node | both | Returns a duplicate of this node. |
342
+ | hasAttributes(—) | Boolean | both | Returns `true` if this node has attributes. |
343
+ | hasChildNodes(—) | Boolean | both | Returns `true` if this node has child nodes. |
344
+ | insertBefore(newChild, refChild) | Ti.XML.Node | both | Inserts the node `newChild` before the node `refChild`. |
345
+ | isSupported(feature, version) | Boolean | both | Tests whether the DOM implementation supports a specific feature. |
346
+ | normalize(—) | void | android | Normalizes text and attribute nodes in this node's child hierarchy. |
347
+ | removeChild(oldChild) | Ti.XML.Node | both | Removes a child node from this node. |
348
+ | replaceChild(newChild, oldChild) | Ti.XML.Node | both | Replaces the node `oldChild` with the node `newChild`. |
349
+
350
+
351
+ ---
352
+
353
+ ## Ti.XML.NodeList
354
+ > A list of <Titanium.XML.Node> objects. Implements the [DOM Level 2 API](https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-536297177) on Android and iOS.
355
+ > Extends Ti.Proxy
356
+ > Platforms: both
357
+
358
+ ### Properties (unique: 1/4)
359
+ | Property | Type | Default | Platform | Description |
360
+ |----------|------|---------|----------|-------------|
361
+ | length | Number | — | both | The length of the node list. |
362
+
363
+
364
+ ### Methods (1)
365
+ | Method | Returns | Platform | Description |
366
+ |--------|---------|----------|-------------|
367
+ | item(index) | Ti.XML.Node | both | Returns the <Titanium.XML.Node> object at the specified index. |
368
+
369
+
370
+ ---
371
+
372
+ ## Ti.XML.Notation
373
+ > Represents a notation declared in the DTD. Implements the [DOM Level 2 API](https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-5431D1B9) on Android and iOS.
374
+ > Extends Ti.Proxy
375
+ > Platforms: both
376
+
377
+ ### Properties (unique: 2/5)
378
+ | Property | Type | Default | Platform | Description |
379
+ |----------|------|---------|----------|-------------|
380
+ | publicId | String | — | both | The public identifier of this notation. If the public identifier was not specif… |
381
+ | systemId | String | — | both | The system identifier of this notation. If the system identifier was not specif… |
382
+
383
+
384
+
385
+
386
+ ---
387
+
388
+ ## Ti.XML.ProcessingInstruction
389
+ > A way to keep processor-specific information in the text of the document. Implements the [DOM Level 2 API](https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1004215813) on Android and iOS.
390
+ > Extends Ti.Proxy
391
+ > Platforms: both
392
+
393
+ ### Properties (unique: 2/5)
394
+ | Property | Type | Default | Platform | Description |
395
+ |----------|------|---------|----------|-------------|
396
+ | data | String | — | both | Retrieve the content of this processing instruction. This from the first non wh… |
397
+ | target | String | — | both | Retrieve the target of this processing instruction. XML defines this as being t… |
398
+
399
+
400
+
401
+
402
+ ---
403
+
404
+ ## Ti.XML.Text
405
+ > Represents the textual content of an <Titanium.XML.Element> or <Titanium.XML.Attr> Implements the [DOM Level 2 API](https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1312295772) on Android and iOS.
406
+ > Extends Ti.XML.CharacterData
407
+ > Platforms: both
408
+
409
+ ### Properties (unique: 1/33)
410
+ | Property | Type | Default | Platform | Description |
411
+ |----------|------|---------|----------|-------------|
412
+ | textContent | String | — | both | Content (value) of all text nodes within this node. |
413
+
414
+
415
+ ### Methods (1)
416
+ | Method | Returns | Platform | Description |
417
+ |--------|---------|----------|-------------|
418
+ | splitText(offset) | Ti.XML.Text | both | Breaks this node into two nodes at the specified by offset, and returns a new n… |
419
+
420
+
421
+ ---
422
+
423
+ ## Global
424
+ > The APIs that reside in the global scope, which may be called without a namespace prefix.
425
+ > Extends Object
426
+ > Platforms: both
427
+ > Type: module
428
+
429
+ Titanium provides a number of global built-in objects, detailed below.
430
+
431
+ ### String Utilities
432
+
433
+ Titanium includes several extra utility functions for formatting text, attached to the
434
+ global [String](Global.String) object.
435
+
436
+ ### console
437
+
438
+ Titanium provides [console](Global.Console) support familiar to many JavaScript developers
439
+ for logging at the toplevel, in addition to the [Titanium](Titanium.API) logging facilities.
440
+
441
+ ### Timers
442
+
443
+ Titanium has built-in support for one-off and repeating timers:
444
+
445
+ *(See full overview in titanium-docs)*
446
+
447
+ ### Properties (unique: 4/16)
448
+ | Property | Type | Default | Platform | Description |
449
+ |----------|------|---------|----------|-------------|
450
+ | console | Global.Console | — | both | Console logging facilities. |
451
+ | global | Global | — | both | Reference to the global object itself. |
452
+ | Buffer | buffer.Buffer | — | both | a global reference to the [Buffer](buffer.Buffer) class. |
453
+ | process | process | — | both | Reference to the global `process` object. |
454
+
455
+ ### Constants (12)
456
+ - **DIST_\***: DIST_ADHOC, DIST_STORE
457
+ - **ENV_\***: ENV_DEV, ENV_DEVELOPMENT, ENV_PROD, ENV_PRODUCTION, ENV_TEST
458
+ - **OS_\***: OS_ANDROID, OS_IOS
459
+ - **OS_VERSION_\***: OS_VERSION_MAJOR, OS_VERSION_MINOR, OS_VERSION_PATCH
460
+
461
+
462
+ ### Methods (9)
463
+ | Method | Returns | Platform | Description |
464
+ |--------|---------|----------|-------------|
465
+ | alert(message) | void | both | Displays a pop-up alert dialog with the passed in `message`. |
466
+ | clearInterval(timerId) | void | both | Cancels an interval timer. |
467
+ | clearTimeout(timerId) | void | both | Cancels a one-time timer. |
468
+ | decodeURIComponent(encodedURI) | String | both | Replaces each escape sequence in the specified string, created using the `encod… |
469
+ | encodeURIComponent(string) | String | both | Replaces each special character in the specified string with the equivalent URI… |
470
+ | L(key, hint) | String | both | An alias for [Titanium.Locale.getString](Titanium.Locale.getString). |
471
+ | require(moduleId) | any | both | Loads either a native Titanium module or a CommonJS module. |
472
+ | setInterval(function, delay) | Number | both | Executes a function repeatedly with a fixed time delay between each call to tha… |
473
+ | setTimeout(function, delay) | Number | both | Executes code or a function after a delay. |
474
+
475
+
476
+ ### Related Types
477
+
478
+ #### buffer.Buffer
479
+ > The `Buffer` class is a global type for dealing with binary data directly. It can be constructed in a variety of ways.
480
+
481
+ | Property | Type | Description |
482
+ |----------|------|-------------|
483
+ | buffer | ArrayBuffer | The underlying `ArrayBuffer` object based on which this `Buffer` object is crea… |
484
+ | byteOffset | Number | The `byteOffset` of the `Buffer`s underlying `ArrayBuffer` object. |
485
+ | length | Number | Returns the number of bytes in buf. |
486
+
487
+ #### process
488
+ > A Node.js-compatible implementation of the core `process` module
489
+
490
+ | Property | Type | Description |
491
+ |----------|------|-------------|
492
+ | arch | String | Returns the operating system CPU architecture for which the binary was compiled… |
493
+ | argv | Array<String> | The `process.argv` property returns an array containing the command-line argume… |
494
+ | argv0 | String | The `process.argv0` property stores a read-only copy of the original value of `… |
495
+ | channel | Object | Always `undefined` in Titanium. |
496
+ | config | Object | Always `{}` in Titanium. |
497
+ | connected | Boolean | Always `false` in Titanium. |
498
+ | debugPort | Number | The port used by the debugger when enabled. |
499
+ | env | Object | This is an object whose keys are environment variable names and whose values ar… |
500
+ | execArgv | Array<String> | Always `[]` in Titanium. |
501
+ | execPath | String | Always `''` in Titanium. |
502
+ | exitCode | Number | Unused in Titanium. |
503
+ | noDeprecation | Boolean | The `process.noDeprecation` property indicates whether the `--no-deprecation` f… |
504
+ | pid | Number | The `process.pid` property returns the PID of the process. Always returns `0` i… |
505
+ | platform | String | Equivalent to <Titanium.Platform.osname> |
506
+ | ppid | Number | The `process.ppid` property returns the PID of the parent of the current proces… |
507
+ | stderr | Object | The `process.stderr` property returns a stream connected to `stderr`. |
508
+ | stdout | Object | The `process.stdout` property returns a stream connected to `stdout`. |
509
+ | title | String | Equivalent to <Titanium.App.name> |
510
+ | throwDeprecation | Boolean | The initial value of `process.throwDeprecation` indicates whether the `--throw-… |
511
+ | traceDeprecation | Boolean | The `process.traceDeprecation` property indicates whether the `--trace-deprecat… |
512
+ | version | String | Equivalent to <Titanium.version> |
513
+ | versions | Object | An object containing version information for included dependencies |
514
+
515
+ ---
516
+
517
+ ## Global.Console
518
+ > Console logging facilities.
519
+ > Extends Object
520
+ > Platforms: both
521
+ > Type: module
522
+
523
+ The toplevel `console` support is intended to supplement <Titanium.API>
524
+ and make it easier for developers to port existing JavaScript code
525
+ (especially CommonJS modules) to Titanium.
526
+
527
+ Note that `console` does not currently implement the complete
528
+ [Console](https://developer.mozilla.org/de/docs/Web/API/Console) specification.
529
+ See the following supported methods for details and submit a pull request to add more!
530
+
531
+
532
+ ### Methods (15)
533
+ | Method | Returns | Platform | Description |
534
+ |--------|---------|----------|-------------|
535
+ | log(message) | void | both | Log a message at the `info` level. |
536
+ | info(message) | void | both | Log a message at the `info` level. |
537
+ | warn(message) | void | both | Log a message at the `warn` level. |
538
+ | error(message) | void | both | Log a message at the `error` level. |
539
+ | debug(message) | void | both | Log a message at the `debug` level. |
540
+ | time(label) | void | both | Start a timer to track duration of an operation. |
541
+ | timeEnd(label) | void | both | Stop a timer that was previously started. |
542
+ | timeLog(label, data) | void | both | Log duration taken so far for an operation. |
543
+ | trace(message) | void | both | Log a message at the `trace` level. |
544
+ | count(label) | void | both | Maintains an internal counter specific to `label` and outputs to stdout the num… |
545
+ | countReset(label) | void | both | Resets the internal counter specific to `label`. |
546
+ | assert(value, message) | void | both | A simple assertion test that verifies whether value is truthy. If it is not, As… |
547
+ | group(label) | void | both | Increases indentation of subsequent lines by spaces for `groupIndentation` leng… |
548
+ | groupCollapsed(label) | void | both | Alias for `group()` |
549
+ | groupEnd(—) | void | both | Decreases indentation of subsequent lines by spaces for `groupIndentation` leng… |
550
+
551
+
552
+ ---
553
+
554
+ ## Global.Intl
555
+ > Namespace providing JavaScript's standard internationalization APIs.
556
+ > Extends Object
557
+ > Platforms: both
558
+ > Type: module
559
+
560
+ Provides support for localized number formatting, date/time formatting,
561
+ and language sensitive string comparisons.
562
+
563
+ For more detail, see the MDN website about
564
+ [Intl](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl).
565
+
566
+
567
+ ### Methods (1)
568
+ | Method | Returns | Platform | Description |
569
+ |--------|---------|----------|-------------|
570
+ | getCanonicalLocales(locales) | Array<String> | both | Gets canonical locale identifiers matching given BCP 47 locale identifiers. |
571
+
572
+
573
+ ---
574
+
575
+ ## Global.Intl.Collator
576
+ > Immutable object used to perform language sensitive string comparisons.
577
+ > Extends Object
578
+ > Platforms: both
579
+ > Type: module
580
+
581
+ A collator is used to perform a localized string compare or sort using a given language locale.
582
+
583
+ For more detail, see the MDN website about
584
+ [Intl.Collator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator).
585
+
586
+ ### Properties (unique: 1/1)
587
+ | Property | Type | Default | Platform | Description |
588
+ |----------|------|---------|----------|-------------|
589
+ | constructor | Global.Intl.Collator | — | both | Creates a new `Intl.Collator` object with the given locale and comparison optio… |
590
+
591
+
592
+ ### Methods (3)
593
+ | Method | Returns | Platform | Description |
594
+ |--------|---------|----------|-------------|
595
+ | compare(string1, string2) | Number | both | Determines the sort order of the given strings or if they match. |
596
+ | resolvedOptions(—) | CollatorOptions | both | Gets the object's collation options. |
597
+ | supportedLocalesOf(locales) | Array<String> | both | Static method indicating what locales are supported by collators from the given… |
598
+
599
+
600
+ ### Related Types
601
+
602
+ #### CollatorOptions
603
+ > Options to be passed into the <Global.Intl.Collator.constructor> method.
604
+
605
+ | Property | Type | Description |
606
+ |----------|------|-------------|
607
+ | localeMatcher | String | The locale matching algorithm to use. |
608
+ | usage | String | Indicates if the comparison is for sorting or searching when matching strings. |
609
+ | sensitivity | String | Indicates how characters should be compared. |
610
+ | ignorePunctuation | Boolean | Indicates if punctuation characters should be ignored during the compare. |
611
+ | numeric | Boolean | Indicates if numbers in string should be compared as integers. |
612
+ | caseFirst | String | Indicates if upper case or lower case characters should sort first. |
613
+
614
+ ---
615
+
616
+ ## Global.Intl.DateTimeFormat
617
+ > Immutable object used to generate localized date and time formatted strings.
618
+ > Extends Object
619
+ > Platforms: both
620
+ > Type: module
621
+
622
+ A `DateTimeFormat` object is used to format a `Date` object to a localized date and/or time string.
623
+ This will respect the system's current language setting when outputting a full month or weekday name.
624
+ It will also respect the current locale's date component ordering such as Month/Day/Year,
625
+ Day/Month/Year, and Year/Month/Day.
626
+
627
+ For more detail, see the MDN website about
628
+ [Intl.DateTimeFormat](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat).
629
+
630
+ ### Properties (unique: 1/1)
631
+ | Property | Type | Default | Platform | Description |
632
+ |----------|------|---------|----------|-------------|
633
+ | constructor | Global.Intl.DateTimeFormat | — | both | Creates a new `Intl.DateTimeFormat` object with the given locale and formatting… |
634
+
635
+
636
+ ### Methods (4)
637
+ | Method | Returns | Platform | Description |
638
+ |--------|---------|----------|-------------|
639
+ | format(date) | String | both | Formats the given date object to a localized date and/or time string. |
640
+ | formatToParts(date) | Array<DateTimeFormattedPart> | both | Formats given date to an array of components describing what the formatted stri… |
641
+ | resolvedOptions(—) | DateTimeFormatOptions | both | Gets the object's formatting options. |
642
+ | supportedLocalesOf(locales) | Array<String> | both | Static method indicating what locales are supported by `DateTimeFormat` from th… |
643
+
644
+
645
+ ### Related Types
646
+
647
+ #### DateTimeFormatOptions
648
+ > Options to be passed into the <Global.Intl.DateTimeFormat.constructor> method.
649
+
650
+ | Property | Type | Description |
651
+ |----------|------|-------------|
652
+ | dateStyle | String | Specifies the locale's built-in month, day, and year formatting styles. |
653
+ | timeStyle | String | Specifies the locale's built-in hour, minute, and second formatting styles. |
654
+ | fractionalSecondDigits | Number | Number of millisecond digits to show. Valid values are 0-3. |
655
+ | dayPeriod | String | Indicates how the AM/PM time component should be shown. |
656
+ | timeZone | String | The time zone the `Date` object's value should be converted to when formatted. |
657
+ | hour12 | Boolean | Indicates if formatter should output to either 12-hour or 24-hour time. |
658
+ | hourCycle | String | Indicates how the hour should be formatted. |
659
+ | localeMatcher | String | The locale matching algorithm to use. |
660
+ | formatMatcher | String | The format matching algorithm to use. |
661
+ | weekday | String | Indicates how a weekday name should be shown. |
662
+ | era | String | Indicates how the era name, such as AD or BC, should be shown. |
663
+ | year | String | Indicates how the year should be formatted. |
664
+ | month | String | Indicates how the month should be formatted. |
665
+ | day | String | Indicates how the numeric day should be formatted. |
666
+ | hour | String | Indicates how the hour should be formatted. |
667
+ | minute | String | Indicates how minutes should be formatted. |
668
+ | second | String | Indicates how seconds should be formatted. |
669
+ | timeZoneName | String | Indicates how the time zone should be shown. |
670
+
671
+ ---
672
+
673
+ ## Global.Intl.NumberFormat
674
+ > Immutable object used to convert numbers to localized numeric strings.
675
+ > Extends Object
676
+ > Platforms: both
677
+ > Type: module
678
+
679
+ A `NumberFormat` object is used to convert a `Number` value to a localized numeric string.
680
+ It provides various formatting options controlling the number of integer and fractional digits
681
+ to be displayed. It can also output currency values, percentage based values, and
682
+ scientific notation.
683
+
684
+ For more detail, see the MDN website about
685
+ [Intl.NumberFormat](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat).
686
+
687
+ ### Properties (unique: 1/1)
688
+ | Property | Type | Default | Platform | Description |
689
+ |----------|------|---------|----------|-------------|
690
+ | constructor | Global.Intl.NumberFormat | — | both | Creates a new `Intl.NumberFormat` object with the given locale and formatting o… |
691
+
692
+
693
+ ### Methods (4)
694
+ | Method | Returns | Platform | Description |
695
+ |--------|---------|----------|-------------|
696
+ | format(value) | String | both | Formats the given number to a localized numeric string. |
697
+ | formatToParts(value) | Array<NumberFormattedPart> | both | Formats given number to an array of components describing what the formatted st… |
698
+ | resolvedOptions(—) | NumberFormatOptions | both | Gets the object's formatting options. |
699
+ | supportedLocalesOf(locales) | Array<String> | both | Static method indicating what locales are supported by `NumberFormat` from the … |
700
+
701
+
702
+ ### Related Types
703
+
704
+ #### NumberFormatOptions
705
+ > Options to be passed into the <Global.Intl.NumberFormat.constructor> method.
706
+
707
+ | Property | Type | Description |
708
+ |----------|------|-------------|
709
+ | style | String | Specifies the format style such as decimal, currency, or percentage. |
710
+ | localeMatcher | String | The locale matching algorithm to use. |
711
+ | currency | String | Set to the ISO 4217 currency code to use when formatting with the currency styl… |
712
+ | currencyDisplay | String | Indicates how the currency symbol or name should be shown. |
713
+ | useGrouping | Boolean | Indicates if grouping separators should be displayed. |
714
+ | minimumIntegerDigits | Number | Applies leading zeros to the integer portion of the formatted number. |
715
+ | minimumFractionDigits | Number | Applies trailing zeros in fractional portion of the formatted number. |
716
+ | maximumFractionDigits | Number | Max number of fractional digits to be shown. Will round at this max digit. |
717
+ | maximumSignificantDigits | Number | Max number of significant digits to be shown. Will round at this max digit. |
718
+ | notation | String | Indicates if number should be formatted to scientific or engineering notation. |
719
+
720
+ ---
721
+
722
+ ## Global.String
723
+ > The JavaScript built-in String type.
724
+ > Extends Object
725
+ > Platforms: both
726
+ > Type: module
727
+
728
+ This module contains Titanium-only extensions for formatting data into locale-specific strings.
729
+ The target locale is configured by the user in the device's system Settings.
730
+
731
+
732
+ ### Methods (5)
733
+ | Method | Returns | Platform | Description |
734
+ |--------|---------|----------|-------------|
735
+ | format(formatString, value) | String | both | Formats a string using `printf`-style substitution. |
736
+ | formatCurrency(value) | String | both | Formats a number into the currency format, including currency symbol, of the lo… |
737
+ | formatDate(date, format) | String | both | Formats a date into the date format of the locale configured for the system. |
738
+ | formatDecimal(value, locale, pattern) | String | both | Formats a number into the decimal format, including decimal symbol, of the loca… |
739
+ | formatTime(date, format) | String | both | Formats a date into the time format of the locale configured for the system. |
740
+
741
+
742
+ ---
743
+