@maccesar/titools 4.3.0 → 4.4.2
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.
- package/README.md +15 -12
- package/package.json +1 -1
- package/skills/purgetss/SKILL.md +4 -9
- package/skills/ti-api/references/api-core.md +24 -69
- package/skills/ti-api/references/api-data-network.md +18 -63
- package/skills/ti-api/references/api-media.md +15 -49
- package/skills/ti-api/references/api-modules-coremotion-urlsession.md +6 -20
- package/skills/ti-api/references/api-modules-map.md +17 -40
- package/skills/ti-api/references/api-modules-nfc.md +23 -56
- package/skills/ti-api/references/api-ui-android.md +16 -37
- package/skills/ti-api/references/api-ui-extras.md +28 -72
- package/skills/ti-api/references/api-ui-lists.md +14 -35
- package/skills/ti-api/references/api-ui-text-input.md +13 -39
- package/skills/ti-api/references/api-ui-windows-navigation.md +17 -43
- package/skills/ti-api/references/api-xml-global.md +25 -60
- package/skills/ti-expert/SKILL.md +35 -5
- package/skills/ti-expert/references/adaptive-layouts.md +15 -43
- package/skills/ti-expert/references/alloy-builtins.md +8 -22
- package/skills/ti-expert/references/alloy-structure.md +34 -18
- package/skills/ti-expert/references/anti-patterns.md +18 -39
- package/skills/ti-expert/references/code-conventions.md +5 -3
- package/skills/ti-expert/references/controller-patterns.md +31 -26
- package/skills/ti-expert/references/examples.md +41 -21
- package/skills/ti-expert/references/feedback-migration.md +143 -0
- package/skills/ti-expert/references/feedback-surfaces.md +111 -0
- package/skills/ti-expert/references/feedback-widget-contracts.md +175 -0
- package/skills/ti-expert/references/file-type-association.md +265 -0
- package/skills/ti-expert/references/migration-patterns.md +37 -25
- package/skills/ti-expert/references/security-device.md +58 -56
- package/skills/ti-expert/references/sharing.md +227 -0
- package/skills/ti-expert/references/state-management.md +5 -5
- package/skills/ti-expert/references/theming.md +109 -392
- package/skills/ti-guides/references/coding-best-practices.md +1 -2
- package/skills/ti-guides/references/style-and-conventions.md +1 -2
- package/skills/ti-howtos/references/debugging-profiling.md +1 -2
- package/skills/ti-howtos/references/location-and-maps.md +1 -2
- package/skills/ti-howtos/references/using-modules.md +1 -2
- package/skills/ti-howtos/references/web-content-integration.md +1 -2
- package/skills/ti-howtos/references/webpack-build-pipeline.md +1 -2
- package/skills/ti-ui/references/listviews-and-performance.md +5 -10
- package/skills/ti-ui/references/orientation.md +1 -2
package/README.md
CHANGED
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
4
|
|
|
5
|
-

|
|
6
|
-

|
|
7
|
-

|
|
5
|
+
  
|
|
8
6
|
|
|
9
7
|
</div>
|
|
10
8
|
|
|
@@ -95,9 +93,7 @@ Why NPM?
|
|
|
95
93
|
| **Slash commands** | `/ti-check`, `/ti-new-screen`, `/ti-audit` | Same three (`~/.claude/commands/`) |
|
|
96
94
|
| **Session hook** | Auto-detects Titanium projects | Auto-update only |
|
|
97
95
|
|
|
98
|
-
Having both installed is fine: the CLI detects an enabled marketplace plugin and skips
|
|
99
|
-
its own skill symlinks and command copies, so nothing shows up twice. `titools doctor`
|
|
100
|
-
reports which channel is serving Claude Code.
|
|
96
|
+
Having both installed is fine: the CLI detects an enabled marketplace plugin and skips its own skill symlinks and command copies, so nothing shows up twice. `titools doctor` reports which channel is serving Claude Code.
|
|
101
97
|
|
|
102
98
|
Use **Option A** if you only use Claude Code. Use **Option B** if you use multiple AI assistants or want the Knowledge Index feature.
|
|
103
99
|
|
|
@@ -238,10 +234,7 @@ Key difference:
|
|
|
238
234
|
|
|
239
235
|
## Slash Commands (Claude Code)
|
|
240
236
|
|
|
241
|
-
TiTools provides slash commands for common tasks. Both channels ship them: the
|
|
242
|
-
plugin serves them from its own cache, and `titools install` copies them into
|
|
243
|
-
`~/.claude/commands/`. If you have both, the CLI detects the plugin and skips its
|
|
244
|
-
own copy so the command does not appear twice in the autocomplete.
|
|
237
|
+
TiTools provides slash commands for common tasks. Both channels ship them: the plugin serves them from its own cache, and `titools install` copies them into `~/.claude/commands/`. If you have both, the CLI detects the plugin and skips its own copy so the command does not appear twice in the autocomplete.
|
|
245
238
|
|
|
246
239
|
| Command | Description |
|
|
247
240
|
| ----------------------- | ----------------------------------------------------------------------------------- |
|
|
@@ -333,6 +326,12 @@ When it activates:
|
|
|
333
326
|
- Choosing data strategies (Models vs Collections)
|
|
334
327
|
- Writing clean ES6+ code
|
|
335
328
|
- Memory management and cleanup patterns
|
|
329
|
+
- Choosing a feedback surface (Snackbar, Dialog, Bottom Sheet) and deciding what stays native
|
|
330
|
+
- Designing reusable Alloy Widgets and their lifecycle contracts
|
|
331
|
+
- Adaptive layouts for tablets, foldables, and large screens
|
|
332
|
+
- Associating a custom file type with the app so tapping a document opens it
|
|
333
|
+
- Sharing a link or a file out through the iOS share sheet or the Android intent chooser
|
|
334
|
+
- Theming and dark mode
|
|
336
335
|
- Performance optimization
|
|
337
336
|
- Security patterns
|
|
338
337
|
- Migrating legacy apps
|
|
@@ -343,13 +342,17 @@ Example prompts:
|
|
|
343
342
|
"Create a user service that fetches data from an API."
|
|
344
343
|
"What's the best pattern for navigation between screens?"
|
|
345
344
|
"Prevent memory leaks in my controllers."
|
|
345
|
+
"Every confirmation in my app is an alertDialog — what should each one actually be?"
|
|
346
|
+
"Should this be a Widget or just a <Require>?"
|
|
347
|
+
"Tapping my .backup file in iOS Files previews it instead of opening my app."
|
|
348
|
+
"My Share button works on Android but does nothing on iOS, with no error."
|
|
346
349
|
"Migrate classic Titanium code to modern Alloy patterns."
|
|
347
350
|
"What's a clean way to organize services in an Alloy app?"
|
|
348
351
|
```
|
|
349
352
|
|
|
350
353
|
Key features:
|
|
351
354
|
- Quick decision matrix for common questions
|
|
352
|
-
-
|
|
355
|
+
- 26 reference guides for deep dives
|
|
353
356
|
- Delegates to specialized skills when needed
|
|
354
357
|
|
|
355
358
|
---
|
|
@@ -718,7 +721,7 @@ This pattern is documented across three TiTools skills: `ti-ui`, `ti-expert`, an
|
|
|
718
721
|
|
|
719
722
|
| Skill | SKILL.md | References |
|
|
720
723
|
| --------- | ----------------------------- | ----------------------------------------------------- |
|
|
721
|
-
| ti-expert | Architecture + Implementation |
|
|
724
|
+
| ti-expert | Architecture + Implementation | 26 files (patterns, feedback surfaces, file type association, sharing, testing, security, etc.) |
|
|
722
725
|
| purgetss | Setup + Critical Rules | 33 files (grid, animations, icons, class-index, SVG pipeline, etc.) |
|
|
723
726
|
| ti-ui | UI Rules + Platform Diffs | 14 files (layouts, lists, gestures, etc.) |
|
|
724
727
|
|
package/package.json
CHANGED
package/skills/purgetss/SKILL.md
CHANGED
|
@@ -11,9 +11,7 @@ Utility-first styling toolkit for Titanium/Alloy mobile apps.
|
|
|
11
11
|
|
|
12
12
|
## Required workflow (read before responding)
|
|
13
13
|
|
|
14
|
-
The SKILL.md alone is an **index** of references. The detail you need
|
|
15
|
-
to give accurate answers lives in the reference files. **Reading this
|
|
16
|
-
SKILL.md is not enough.**
|
|
14
|
+
The SKILL.md alone is an **index** of references. The detail you need to give accurate answers lives in the reference files. **Reading this SKILL.md is not enough.**
|
|
17
15
|
|
|
18
16
|
### Step 1 — Open the relevant reference files
|
|
19
17
|
|
|
@@ -31,8 +29,7 @@ SKILL.md is not enough.**
|
|
|
31
29
|
|
|
32
30
|
### Step 2 — Output contract
|
|
33
31
|
|
|
34
|
-
Every utility class you suggest and every styling pattern you describe
|
|
35
|
-
MUST be backed by a citation in the form:
|
|
32
|
+
Every utility class you suggest and every styling pattern you describe MUST be backed by a citation in the form:
|
|
36
33
|
|
|
37
34
|
`[source: references/<file>.md]`
|
|
38
35
|
|
|
@@ -40,8 +37,7 @@ Example: *"Use `wh-12` to set width and height to 48px [source: references/class
|
|
|
40
37
|
|
|
41
38
|
### Step 3 — If you must answer from memory
|
|
42
39
|
|
|
43
|
-
If you write a claim without having read the reference that backs it,
|
|
44
|
-
prepend `FROM_MEMORY (unverified):` to that claim. Do not hide it.
|
|
40
|
+
If you write a claim without having read the reference that backs it, prepend `FROM_MEMORY (unverified):` to that claim. Do not hide it.
|
|
45
41
|
|
|
46
42
|
### Banned behaviors
|
|
47
43
|
|
|
@@ -352,8 +348,7 @@ const view = $.UI.create('View', {
|
|
|
352
348
|
> **🚨 CRITICAL: VERIFY CLASSES BEFORE SUGGESTING**
|
|
353
349
|
> **NEVER guess or hallucinate classes based on other CSS Frameworks knowledge!**
|
|
354
350
|
|
|
355
|
-
PurgeTSS shares naming with some CSS Frameworks but has DIFFERENT classes for Titanium.
|
|
356
|
-
Always verify a class exists before suggesting it.
|
|
351
|
+
PurgeTSS shares naming with some CSS Frameworks but has DIFFERENT classes for Titanium. Always verify a class exists before suggesting it.
|
|
357
352
|
|
|
358
353
|
### Verification Steps
|
|
359
354
|
|
|
@@ -28,14 +28,11 @@
|
|
|
28
28
|
> Platforms: both
|
|
29
29
|
> Type: module
|
|
30
30
|
|
|
31
|
-
The Titanium module provides the Titanium Mobile API, allowing developers to access native
|
|
32
|
-
features of each target environment. Currently, the Android and iOSenvironments are supported.
|
|
31
|
+
The Titanium module provides the Titanium Mobile API, allowing developers to access native features of each target environment. Currently, the Android and iOSenvironments are supported.
|
|
33
32
|
|
|
34
33
|
### Titanium Namespace
|
|
35
34
|
|
|
36
|
-
The complete Titanium API is accessible from the `Titanium` namespace but, for convenience and
|
|
37
|
-
brevity, the alias `Ti` is also provided. As the `Titanium` namespace is functionally-identical
|
|
38
|
-
to its `Ti` alias, it is always recommended to use `Ti` in your code.
|
|
35
|
+
The complete Titanium API is accessible from the `Titanium` namespace but, for convenience and brevity, the alias `Ti` is also provided. As the `Titanium` namespace is functionally-identical to its `Ti` alias, it is always recommended to use `Ti` in your code.
|
|
39
36
|
|
|
40
37
|
For example, the following pairs of Titanium calls behave exactly the same.
|
|
41
38
|
|
|
@@ -82,21 +79,13 @@ Ti.API.info('Hello Titanium!');
|
|
|
82
79
|
> Platforms: both
|
|
83
80
|
> Type: module
|
|
84
81
|
|
|
85
|
-
The UI module is responsible for native user-interface components and interaction inside
|
|
86
|
-
Titanium. The goal of the UI module is to provide a native experience along with native
|
|
87
|
-
performance by compiling Javascript code into their native counterparts as part of the
|
|
88
|
-
build process.
|
|
82
|
+
The UI module is responsible for native user-interface components and interaction inside Titanium. The goal of the UI module is to provide a native experience along with native performance by compiling Javascript code into their native counterparts as part of the build process.
|
|
89
83
|
|
|
90
84
|
### Design
|
|
91
85
|
|
|
92
86
|
The UI module is broken down into 3 major area:
|
|
93
87
|
|
|
94
|
-
* **Views** - [Views](Titanium.UI.View) are containers that host visual elements such as
|
|
95
|
-
controls or other views. Views can have their properties customized, such as their border color
|
|
96
|
-
and radius, can fire events such as swipe events or touches, and can optionally contain a
|
|
97
|
-
hierarchy or other views as children. In Titanium, most views are specialized to perform both a
|
|
98
|
-
visual function and set of interaction behaviors such as [Table View](Titanium.UI.TableView) or
|
|
99
|
-
[Coverflow View](Titanium.UI.iOS.CoverFlowView). Views are always named with the suffix `View`.
|
|
88
|
+
* **Views** - [Views](Titanium.UI.View) are containers that host visual elements such as controls or other views. Views can have their properties customized, such as their border color and radius, can fire events such as swipe events or touches, and can optionally contain a hierarchy or other views as children. In Titanium, most views are specialized to perform both a visual function and set of interaction behaviors such as [Table View](Titanium.UI.TableView) or [Coverflow View](Titanium.UI.iOS.CoverFlowView). Views are always named with the suffix `View`.
|
|
100
89
|
|
|
101
90
|
*(See full overview in titanium-docs)*
|
|
102
91
|
|
|
@@ -350,16 +339,11 @@ visual function and set of interaction behaviors such as [Table View](Titanium.U
|
|
|
350
339
|
> Platforms: both
|
|
351
340
|
> Type: module
|
|
352
341
|
|
|
353
|
-
An accelerometer is a hardware unit integrated into a mobile device, that detects when the
|
|
354
|
-
device has moved, and returns its new orientation in a three-dimensional space. With its
|
|
355
|
-
single `update` event, this module provides an interface to access the output positional data.
|
|
342
|
+
An accelerometer is a hardware unit integrated into a mobile device, that detects when the device has moved, and returns its new orientation in a three-dimensional space. With its single `update` event, this module provides an interface to access the output positional data.
|
|
356
343
|
|
|
357
|
-
An accelerometer needs to be switched on in order for it to report to the operating system,
|
|
358
|
-
which consumes a lot of power that will deplete the battery over time. This is why it is
|
|
359
|
-
recommended that the accelerometer is switched off when not in use.
|
|
344
|
+
An accelerometer needs to be switched on in order for it to report to the operating system, which consumes a lot of power that will deplete the battery over time. This is why it is recommended that the accelerometer is switched off when not in use.
|
|
360
345
|
|
|
361
|
-
The accelerometer may be switched on and off by simply adding and removing the `update`
|
|
362
|
-
event listener function. See the example for a demonstration.
|
|
346
|
+
The accelerometer may be switched on and off by simply adding and removing the `update` event listener function. See the example for a demonstration.
|
|
363
347
|
|
|
364
348
|
|
|
365
349
|
|
|
@@ -375,21 +359,15 @@ event listener function. See the example for a demonstration.
|
|
|
375
359
|
> Extends Ti.Proxy
|
|
376
360
|
> Platforms: both
|
|
377
361
|
|
|
378
|
-
A `Blob` represents a chunk of binary information, often obtained through
|
|
379
|
-
an [HTTPClient](Titanium.Network.HTTPClient) or by reading a [File](Titanium.Filesystem.File).
|
|
362
|
+
A `Blob` represents a chunk of binary information, often obtained through an [HTTPClient](Titanium.Network.HTTPClient) or by reading a [File](Titanium.Filesystem.File).
|
|
380
363
|
|
|
381
|
-
Blobs are often used to store text or image data.
|
|
382
|
-
The `Blob` object includes a number of properties and methods specific to image blobs.
|
|
364
|
+
Blobs are often used to store text or image data. The `Blob` object includes a number of properties and methods specific to image blobs.
|
|
383
365
|
|
|
384
|
-
Android supports an [append](Titanium.Blob.append) method, but
|
|
385
|
-
otherwise blobs are immutable.
|
|
366
|
+
Android supports an [append](Titanium.Blob.append) method, but otherwise blobs are immutable.
|
|
386
367
|
|
|
387
|
-
The <Titanium.Utils> module provides several utility methods for working with
|
|
388
|
-
blobs, including methods for converting between blobs and Base64-encoded strings,
|
|
389
|
-
and methods for generating SHA-1 and SHA-256 hashes and MD5 digests from blob data.
|
|
368
|
+
The <Titanium.Utils> module provides several utility methods for working with blobs, including methods for converting between blobs and Base64-encoded strings, and methods for generating SHA-1 and SHA-256 hashes and MD5 digests from blob data.
|
|
390
369
|
|
|
391
|
-
The [Buffer](Titanium.Buffer) object can also contain binary data, and is
|
|
392
|
-
more easily mutable. Extracting blob data to a buffer is somewhat roundabout:
|
|
370
|
+
The [Buffer](Titanium.Buffer) object can also contain binary data, and is more easily mutable. Extracting blob data to a buffer is somewhat roundabout:
|
|
393
371
|
|
|
394
372
|
*(See full overview in titanium-docs)*
|
|
395
373
|
|
|
@@ -444,8 +422,7 @@ more easily mutable. Extracting blob data to a buffer is somewhat roundabout:
|
|
|
444
422
|
> Extends Ti.IOStream
|
|
445
423
|
> Platforms: both
|
|
446
424
|
|
|
447
|
-
Use the <Titanium.Stream.createStream> method to create a `BlobStream` instance from a
|
|
448
|
-
`Blob`.
|
|
425
|
+
Use the <Titanium.Stream.createStream> method to create a `BlobStream` instance from a `Blob`.
|
|
449
426
|
|
|
450
427
|
|
|
451
428
|
|
|
@@ -491,8 +468,7 @@ Use the <Titanium.createBuffer> method to create a buffer.
|
|
|
491
468
|
> Extends Ti.IOStream
|
|
492
469
|
> Platforms: both
|
|
493
470
|
|
|
494
|
-
Use the <Titanium.Stream.createStream> method to create a `BufferStream` instance from a
|
|
495
|
-
`Buffer`.
|
|
471
|
+
Use the <Titanium.Stream.createStream> method to create a `BufferStream` instance from a `Buffer`.
|
|
496
472
|
|
|
497
473
|
|
|
498
474
|
|
|
@@ -505,18 +481,13 @@ Use the <Titanium.Stream.createStream> method to create a `BufferStream` instanc
|
|
|
505
481
|
> Platforms: both
|
|
506
482
|
> Type: module
|
|
507
483
|
|
|
508
|
-
The `Codec` module can be used for encoding strings and numbers into [Buffer](Titanium.Buffer)
|
|
509
|
-
objects, and decoding primitive types from buffers.
|
|
484
|
+
The `Codec` module can be used for encoding strings and numbers into [Buffer](Titanium.Buffer) objects, and decoding primitive types from buffers.
|
|
510
485
|
|
|
511
486
|
### Byte Order
|
|
512
487
|
|
|
513
|
-
Multi-byte data can be stored in two different byte orders: big-endian or
|
|
514
|
-
little-endian. In big-endian byte order, the most significant or highest-value
|
|
515
|
-
byte is stored first. For example, the 4-byte integer 0xFEDCBA98 is made up of the
|
|
516
|
-
bytes 0xFE, 0xDC, 0xBA and 0x98, from most-significant to least-significant.
|
|
488
|
+
Multi-byte data can be stored in two different byte orders: big-endian or little-endian. In big-endian byte order, the most significant or highest-value byte is stored first. For example, the 4-byte integer 0xFEDCBA98 is made up of the bytes 0xFE, 0xDC, 0xBA and 0x98, from most-significant to least-significant.
|
|
517
489
|
|
|
518
|
-
If we represent a buffer as an array of byte values, a big-endian encoding of
|
|
519
|
-
0xFEDCBA98 would look like this:
|
|
490
|
+
If we represent a buffer as an array of byte values, a big-endian encoding of 0xFEDCBA98 would look like this:
|
|
520
491
|
|
|
521
492
|
``` js
|
|
522
493
|
[ 0xFE, 0xDC, 0xBA, 0x98 ]
|
|
@@ -609,8 +580,7 @@ If we represent a buffer as an array of byte values, a big-endian encoding of
|
|
|
609
580
|
> Extends Ti.Proxy
|
|
610
581
|
> Platforms: both
|
|
611
582
|
|
|
612
|
-
See the <Titanium.Stream> module for related utility methods that support asynchronous
|
|
613
|
-
I/O.
|
|
583
|
+
See the <Titanium.Stream> module for related utility methods that support asynchronous I/O.
|
|
614
584
|
|
|
615
585
|
|
|
616
586
|
### Methods (5)
|
|
@@ -631,10 +601,7 @@ I/O.
|
|
|
631
601
|
> Platforms: both
|
|
632
602
|
> Type: module
|
|
633
603
|
|
|
634
|
-
The `Locale` module works with localization files to which are generated during compilation
|
|
635
|
-
into the operating system specific localization formats. The `Locale` module provides
|
|
636
|
-
locale-specific strings which can be referenced at runtime. Additionally, the module
|
|
637
|
-
contains a few methods and properties for querying device locale information.
|
|
604
|
+
The `Locale` module works with localization files to which are generated during compilation into the operating system specific localization formats. The `Locale` module provides locale-specific strings which can be referenced at runtime. Additionally, the module contains a few methods and properties for querying device locale information.
|
|
638
605
|
|
|
639
606
|
The macro `L` can be used as an alias for the <Titanium.Locale.getString> method.
|
|
640
607
|
|
|
@@ -670,11 +637,7 @@ The macro `L` can be used as an alias for the <Titanium.Locale.getString> method
|
|
|
670
637
|
> Platforms: both
|
|
671
638
|
> Type: module
|
|
672
639
|
|
|
673
|
-
This module provides a set of methods for interacting with
|
|
674
|
-
[IOStream](Titanium.IOStream) objects, including asynchronous versions of the
|
|
675
|
-
`read` and `write` methods offered by all stream objects. These
|
|
676
|
-
methods should be used in any place where reading from or writing
|
|
677
|
-
to a stream might block.
|
|
640
|
+
This module provides a set of methods for interacting with [IOStream](Titanium.IOStream) objects, including asynchronous versions of the `read` and `write` methods offered by all stream objects. These methods should be used in any place where reading from or writing to a stream might block.
|
|
678
641
|
|
|
679
642
|
See also:
|
|
680
643
|
|
|
@@ -735,14 +698,9 @@ See also:
|
|
|
735
698
|
> Extends Object
|
|
736
699
|
> Platforms: both
|
|
737
700
|
|
|
738
|
-
On platforms that use native code (Android and iOS), the `Proxy` type represents a
|
|
739
|
-
JavaScript wrapper or _proxy_ around a native object. Setting or getting a property
|
|
740
|
-
on a proxy object results in a method invocation on the native object. Likewise,
|
|
741
|
-
calling a method on the proxy object results in a method invocation on the native
|
|
742
|
-
object.
|
|
701
|
+
On platforms that use native code (Android and iOS), the `Proxy` type represents a JavaScript wrapper or _proxy_ around a native object. Setting or getting a property on a proxy object results in a method invocation on the native object. Likewise, calling a method on the proxy object results in a method invocation on the native object.
|
|
743
702
|
|
|
744
|
-
Some Titanium objects are _createable_: new instances of these objects can be created using
|
|
745
|
-
factory methods. For example, a [Window](Titanium.UI.Window) object can be created using the
|
|
703
|
+
Some Titanium objects are _createable_: new instances of these objects can be created using factory methods. For example, a [Window](Titanium.UI.Window) object can be created using the
|
|
746
704
|
|
|
747
705
|
### Properties (unique: 3/3)
|
|
748
706
|
| Property | Type | Default | Platform | Description |
|
|
@@ -774,12 +732,9 @@ factory methods. For example, a [Window](Titanium.UI.Window) object can be creat
|
|
|
774
732
|
> Platforms: both
|
|
775
733
|
> Type: module
|
|
776
734
|
|
|
777
|
-
A Titanium module is a non-createable Titanium object that is exposed through the
|
|
778
|
-
global Titanium object.
|
|
735
|
+
A Titanium module is a non-createable Titanium object that is exposed through the global Titanium object.
|
|
779
736
|
|
|
780
|
-
For example, the <Titanium.UI> module provides constants and factory methods related
|
|
781
|
-
to UI objects, as well as a few UI-related properties that are not related to a
|
|
782
|
-
specific object.
|
|
737
|
+
For example, the <Titanium.UI> module provides constants and factory methods related to UI objects, as well as a few UI-related properties that are not related to a specific object.
|
|
783
738
|
|
|
784
739
|
|
|
785
740
|
|
|
@@ -73,17 +73,11 @@
|
|
|
73
73
|
|
|
74
74
|
A result set represents the results returned by a database query.
|
|
75
75
|
|
|
76
|
-
The [rowCount](Titanium.Database.ResultSet.rowCount) property identifies the number of
|
|
77
|
-
rows in the result set. The `ResultSet` object maintains an internal record of the
|
|
78
|
-
current row. As shown in the example, you can use the
|
|
79
|
-
[next](Titanium.Database.ResultSet.next) method to iterate through the rows in the set.
|
|
76
|
+
The [rowCount](Titanium.Database.ResultSet.rowCount) property identifies the number of rows in the result set. The `ResultSet` object maintains an internal record of the current row. As shown in the example, you can use the [next](Titanium.Database.ResultSet.next) method to iterate through the rows in the set.
|
|
80
77
|
|
|
81
|
-
Use the [field](Titanium.Database.ResultSet.field) or
|
|
82
|
-
[fieldByName](Titanium.Database.ResultSet.fieldByName) methods to query the fields for
|
|
83
|
-
the current row.
|
|
78
|
+
Use the [field](Titanium.Database.ResultSet.field) or [fieldByName](Titanium.Database.ResultSet.fieldByName) methods to query the fields for the current row.
|
|
84
79
|
|
|
85
|
-
On the iOS platform, closing the database also closes the result set, that is,
|
|
86
|
-
you can only access the result set if the database is currently open.
|
|
80
|
+
On the iOS platform, closing the database also closes the result set, that is, you can only access the result set if the database is currently open.
|
|
87
81
|
|
|
88
82
|
### Properties (unique: 3/6)
|
|
89
83
|
| Property | Type | Default | Platform | Description |
|
|
@@ -113,9 +107,7 @@ you can only access the result set if the database is currently open.
|
|
|
113
107
|
> Platforms: both
|
|
114
108
|
> Type: module
|
|
115
109
|
|
|
116
|
-
For examples of using the Filesystem APIs, refer to the
|
|
117
|
-
[Filesystem Access and Storage guide](https://titaniumsdk.com/guide/Titanium_SDK/Titanium_SDK_How-tos/Working_with_Local_Data_Sources/Filesystem_Access_and_Storage.html)
|
|
118
|
-
as well as the other Filesystem submodule API documentation.
|
|
110
|
+
For examples of using the Filesystem APIs, refer to the [Filesystem Access and Storage guide](https://titaniumsdk.com/guide/Titanium_SDK/Titanium_SDK_How-tos/Working_with_Local_Data_Sources/Filesystem_Access_and_Storage.html) as well as the other Filesystem submodule API documentation.
|
|
119
111
|
|
|
120
112
|
### Properties (unique: 11/21)
|
|
121
113
|
| Property | Type | Default | Platform | Description |
|
|
@@ -160,20 +152,13 @@ as well as the other Filesystem submodule API documentation.
|
|
|
160
152
|
> Extends Ti.Proxy
|
|
161
153
|
> Platforms: both
|
|
162
154
|
|
|
163
|
-
Use the <Titanium.Filesystem.getFile> method to get a handle to a `File` object,
|
|
164
|
-
which represents a given path. There does not need to be an existing file or directory
|
|
165
|
-
does not need to exist before `getFile` is called. If the file doesn't exist, and
|
|
166
|
-
the file path identifies a file in a writable directory, writing to the file
|
|
167
|
-
creates the file implicitly.
|
|
155
|
+
Use the <Titanium.Filesystem.getFile> method to get a handle to a `File` object, which represents a given path. There does not need to be an existing file or directory does not need to exist before `getFile` is called. If the file doesn't exist, and the file path identifies a file in a writable directory, writing to the file creates the file implicitly.
|
|
168
156
|
|
|
169
157
|
See <Titanium.Filesystem> for constants identifying commonly-used device directories.
|
|
170
158
|
|
|
171
159
|
Use the [exists](Titanium.Filesystem.File.exists) method to test whether the file exists.
|
|
172
160
|
|
|
173
|
-
A file object can point to an ordinary file, a directory or a symbolic link.
|
|
174
|
-
Use [createDirectory](Titanium.Filesystem.File.createDirectory) to create a directory.
|
|
175
|
-
Use the [getDirectoryListing](Titanium.Filesystem.File.getDirectoryListing) method to
|
|
176
|
-
retrieve a list of the directory's contents.
|
|
161
|
+
A file object can point to an ordinary file, a directory or a symbolic link. Use [createDirectory](Titanium.Filesystem.File.createDirectory) to create a directory. Use the [getDirectoryListing](Titanium.Filesystem.File.getDirectoryListing) method to retrieve a list of the directory's contents.
|
|
177
162
|
|
|
178
163
|
|
|
179
164
|
*(See full overview in titanium-docs)*
|
|
@@ -249,16 +234,13 @@ The `Network` module is used to access networking related functionality.
|
|
|
249
234
|
|
|
250
235
|
For TCP sockets, see <Titanium.Network.Socket.TCP>.
|
|
251
236
|
|
|
252
|
-
The legacy <Titanium.Network.TCPSocket> object is still required
|
|
253
|
-
by the [BonjourBrowser](Titanium.Network.BonjourBrowser) and
|
|
254
|
-
[BonjourService](Titanium.Network.BonjourService) objects.
|
|
237
|
+
The legacy <Titanium.Network.TCPSocket> object is still required by the [BonjourBrowser](Titanium.Network.BonjourBrowser) and [BonjourService](Titanium.Network.BonjourService) objects.
|
|
255
238
|
|
|
256
239
|
For all other socket needs, use <Titanium.Network.Socket.TCP>.
|
|
257
240
|
|
|
258
241
|
### App Transport Security
|
|
259
242
|
|
|
260
|
-
Starting with iOS 9, Apple introduced new security and compatibility guidelines for networking
|
|
261
|
-
and connectivity, which include:
|
|
243
|
+
Starting with iOS 9, Apple introduced new security and compatibility guidelines for networking and connectivity, which include:
|
|
262
244
|
|
|
263
245
|
|
|
264
246
|
*(See full overview in titanium-docs)*
|
|
@@ -330,16 +312,7 @@ and connectivity, which include:
|
|
|
330
312
|
|
|
331
313
|
Use the <Titanium.Network.createBonjourBrowser> method to create a `BonjourBrowser` instance.
|
|
332
314
|
|
|
333
|
-
If your application publishes Bonjour services itself, that service will be discovered
|
|
334
|
-
by the browser if necessary; be prepared to perform a check if you do not want to list
|
|
335
|
-
local services as available. Bonjour service browsing is an asynchronous operation,
|
|
336
|
-
meaning that you should be extremely careful when caching values from the `services`
|
|
337
|
-
property returned by the `updatedservices` event. In particular, if you maintain a
|
|
338
|
-
local copy of available services and a user tries to connect to one, you should be prepared
|
|
339
|
-
to handle failures gracefully; the next `updatedservices` event should provide the new
|
|
340
|
-
services list, but you should not rely on it being delivered before user input. When
|
|
341
|
-
a window which uses Bonjour browsing is closed, if you do not want to continue searching,
|
|
342
|
-
you must call the stop() method.
|
|
315
|
+
If your application publishes Bonjour services itself, that service will be discovered by the browser if necessary; be prepared to perform a check if you do not want to list local services as available. Bonjour service browsing is an asynchronous operation, meaning that you should be extremely careful when caching values from the `services` property returned by the `updatedservices` event. In particular, if you maintain a local copy of available services and a user tries to connect to one, you should be prepared to handle failures gracefully; the next `updatedservices` event should provide the new services list, but you should not rely on it being delivered before user input. When a window which uses Bonjour browsing is closed, if you do not want to continue searching, you must call the stop() method.
|
|
343
316
|
|
|
344
317
|
In iOS 14.0+, to browse services add key `NSLocalNetworkUsageDescription` and `NSBonjourServices` to the `ios plist` section of the tiapp.xml file.
|
|
345
318
|
|
|
@@ -372,16 +345,9 @@ In iOS 14.0+, to browse services add key `NSLocalNetworkUsageDescription` and `N
|
|
|
372
345
|
> Extends Ti.Proxy
|
|
373
346
|
> Platforms: ios
|
|
374
347
|
|
|
375
|
-
You can obtain a `BonjourService` instance by calling <Titanium.Network.createBonjourService>
|
|
376
|
-
or from the `service` list from a [BonjourBrowser](Titanium.Network.BonjourBrowser)
|
|
377
|
-
`updatedservices` event.
|
|
348
|
+
You can obtain a `BonjourService` instance by calling <Titanium.Network.createBonjourService> or from the `service` list from a [BonjourBrowser](Titanium.Network.BonjourBrowser) `updatedservices` event.
|
|
378
349
|
|
|
379
|
-
You can only publish Bonjour services attached to a socket which is currently listening;
|
|
380
|
-
you cannot publish a service for a remotely connected socket. If you stop the Bonjour
|
|
381
|
-
service and wish to close the socket it uses, it is strongly recommended that you stop
|
|
382
|
-
the service first. When a window which publishes a Bonjour service is closed, you must
|
|
383
|
-
stop the service if the associated socket is also to be closed, or if it is no longer
|
|
384
|
-
necessary to publish. Bonjour service resolution and publishing is asynchronous.
|
|
350
|
+
You can only publish Bonjour services attached to a socket which is currently listening; you cannot publish a service for a remotely connected socket. If you stop the Bonjour service and wish to close the socket it uses, it is strongly recommended that you stop the service first. When a window which publishes a Bonjour service is closed, you must stop the service if the associated socket is also to be closed, or if it is no longer necessary to publish. Bonjour service resolution and publishing is asynchronous.
|
|
385
351
|
|
|
386
352
|
In iOS 14.0+, to publish service add key `NSLocalNetworkUsageDescription` and `NSBonjourServices` in tiapp.xml file.
|
|
387
353
|
|
|
@@ -421,8 +387,7 @@ Example:
|
|
|
421
387
|
> Extends Ti.Proxy
|
|
422
388
|
> Platforms: both
|
|
423
389
|
|
|
424
|
-
Use <Titanium.Network.createCookie> to create a new `Cookie` object.
|
|
425
|
-
The following is an example of how to setup and read a cookie on a web view:
|
|
390
|
+
Use <Titanium.Network.createCookie> to create a new `Cookie` object. The following is an example of how to setup and read a cookie on a web view:
|
|
426
391
|
|
|
427
392
|
``` js
|
|
428
393
|
if (!Date.prototype.toISOString) {
|
|
@@ -471,8 +436,7 @@ if (!Date.prototype.toISOString) {
|
|
|
471
436
|
|
|
472
437
|
Use <Titanium.Network.createHTTPClient> to create a new `HTTPClient` object.
|
|
473
438
|
|
|
474
|
-
An `HTTPClient` object is intended to be used for a single request. It may be
|
|
475
|
-
possible to re-use an `HTTPClient` object, but this use case is not tested.
|
|
439
|
+
An `HTTPClient` object is intended to be used for a single request. It may be possible to re-use an `HTTPClient` object, but this use case is not tested.
|
|
476
440
|
|
|
477
441
|
There are three steps in making a typical HTTP request:
|
|
478
442
|
|
|
@@ -480,8 +444,7 @@ There are three steps in making a typical HTTP request:
|
|
|
480
444
|
* Opening the `HTTPClient` object.
|
|
481
445
|
* Sending the request.
|
|
482
446
|
|
|
483
|
-
Before opening the request, you must define one or more callbacks to handle
|
|
484
|
-
the HTTP response, as well as errors, progress updates, and other conditions.
|
|
447
|
+
Before opening the request, you must define one or more callbacks to handle the HTTP response, as well as errors, progress updates, and other conditions.
|
|
485
448
|
|
|
486
449
|
The `HTTPClient` callbacks operate somewhat differently from other
|
|
487
450
|
|
|
@@ -573,21 +536,13 @@ The `HTTPClient` callbacks operate somewhat differently from other
|
|
|
573
536
|
> Extends Ti.IOStream
|
|
574
537
|
> Platforms: both
|
|
575
538
|
|
|
576
|
-
Most socket operations are asynchronous. When you create a socket, you can define
|
|
577
|
-
callback functions to receive the results of API calls, as well as to handle incoming
|
|
578
|
-
data.
|
|
539
|
+
Most socket operations are asynchronous. When you create a socket, you can define callback functions to receive the results of API calls, as well as to handle incoming data.
|
|
579
540
|
|
|
580
|
-
For example, for a client-side socket, you define
|
|
581
|
-
[connected](Titanium.Network.Socket.TCP.connected) and
|
|
582
|
-
[error](Titanium.Network.Socket.TCP.error) callback functions.
|
|
541
|
+
For example, for a client-side socket, you define [connected](Titanium.Network.Socket.TCP.connected) and [error](Titanium.Network.Socket.TCP.error) callback functions.
|
|
583
542
|
|
|
584
|
-
To connect to a remote host, call the socket's
|
|
585
|
-
[connect](Titanium.Network.Socket.TCP.connect) method. If the socket connects
|
|
586
|
-
successfully, your `connected` callback is invoked, and you can send and receive data
|
|
587
|
-
on the socket. If the socket connection fails, your `error` callback is invoked.
|
|
543
|
+
To connect to a remote host, call the socket's [connect](Titanium.Network.Socket.TCP.connect) method. If the socket connects successfully, your `connected` callback is invoked, and you can send and receive data on the socket. If the socket connection fails, your `error` callback is invoked.
|
|
588
544
|
|
|
589
|
-
After a socket is connected, you can access it like any other <Titanium.IOStream>.
|
|
590
|
-
Note that the socket's `read` and `write` methods may block, so in most cases
|
|
545
|
+
After a socket is connected, you can access it like any other <Titanium.IOStream>. Note that the socket's `read` and `write` methods may block, so in most cases
|
|
591
546
|
|
|
592
547
|
*(See full overview in titanium-docs)*
|
|
593
548
|
|
|
@@ -21,17 +21,7 @@
|
|
|
21
21
|
> Platforms: both
|
|
22
22
|
> Type: module
|
|
23
23
|
|
|
24
|
-
The Media module is used to access the device's media-related functionality, such
|
|
25
|
-
as using the device's camera and photo gallery, playing media files, or recording
|
|
26
|
-
audio or video.
|
|
27
|
-
For examples of using the Media APIs, refer to the
|
|
28
|
-
[Working with Media APIs guide](https://titaniumsdk.com/guide/Titanium_SDK/Titanium_SDK_How-tos/Working_with_Media_APIs/)
|
|
29
|
-
in addition to the other media submodule API documentation.
|
|
30
|
-
**Note**: Some third party Android camera apps may choose to ignore video recording quality
|
|
31
|
-
settings. If you wish to specifically set the video quality, don't assume
|
|
32
|
-
`EXTRA_VIDEO_QUALITY` intent will be respected by the camera app and use Titanium's built-in
|
|
33
|
-
camera window which can be used to assign the `overlay` property when calling the
|
|
34
|
-
`showCamera()` method.
|
|
24
|
+
The Media module is used to access the device's media-related functionality, such as using the device's camera and photo gallery, playing media files, or recording audio or video. For examples of using the Media APIs, refer to the [Working with Media APIs guide](https://titaniumsdk.com/guide/Titanium_SDK/Titanium_SDK_How-tos/Working_with_Media_APIs/) in addition to the other media submodule API documentation. **Note**: Some third party Android camera apps may choose to ignore video recording quality settings. If you wish to specifically set the video quality, don't assume `EXTRA_VIDEO_QUALITY` intent will be respected by the camera app and use Titanium's built-in camera window which can be used to assign the `overlay` property when calling the `showCamera()` method.
|
|
35
25
|
|
|
36
26
|
### Properties (unique: 28/178)
|
|
37
27
|
| Property | Type | Default | Platform | Description |
|
|
@@ -263,16 +253,9 @@ camera window which can be used to assign the `overlay` property when calling th
|
|
|
263
253
|
> Extends Ti.Proxy
|
|
264
254
|
> Platforms: both
|
|
265
255
|
|
|
266
|
-
On Android, when you are done playing a given audio file, you must call the
|
|
267
|
-
[release](Titanium.Media.AudioPlayer.release) method to stop buffering audio data and
|
|
268
|
-
release associated system resources. Since 7.5.0, this method is available on iOS as well
|
|
269
|
-
and will release all audio-player related resources. After this method has been called,
|
|
270
|
-
the object should not be accessed anymore.
|
|
256
|
+
On Android, when you are done playing a given audio file, you must call the [release](Titanium.Media.AudioPlayer.release) method to stop buffering audio data and release associated system resources. Since 7.5.0, this method is available on iOS as well and will release all audio-player related resources. After this method has been called, the object should not be accessed anymore.
|
|
271
257
|
|
|
272
|
-
On iOS, you can control how the audio stream interacts with other system sounds
|
|
273
|
-
by setting <Titanium.Media.audioSessionCategory>. Since Titanium 7.5.0, this API
|
|
274
|
-
uses the [AVPlayer API](https://developer.apple.com/documentation/avfoundation/avplayer) for a more modern
|
|
275
|
-
and performant audio playback.
|
|
258
|
+
On iOS, you can control how the audio stream interacts with other system sounds by setting <Titanium.Media.audioSessionCategory>. Since Titanium 7.5.0, this API uses the [AVPlayer API](https://developer.apple.com/documentation/avfoundation/avplayer) for a more modern and performant audio playback.
|
|
276
259
|
|
|
277
260
|
Use the <Titanium.Media.createAudioPlayer> method to create an audio player.
|
|
278
261
|
|
|
@@ -343,13 +326,9 @@ Use the <Titanium.Media.createAudioPlayer> method to create an audio player.
|
|
|
343
326
|
|
|
344
327
|
Use the <Titanium.Media.createAudioRecorder> method to create an audio recorder.
|
|
345
328
|
|
|
346
|
-
Ensure to request the permissions for audio-recording before starting a new record-session.
|
|
347
|
-
This can be done by using <Titanium.Media.hasAudioRecorderPermissions> to check whether
|
|
348
|
-
audio-permissions are granted and <Titanium.Media.requestAudioRecorderPermissions> to
|
|
349
|
-
request audio-permissions.
|
|
329
|
+
Ensure to request the permissions for audio-recording before starting a new record-session. This can be done by using <Titanium.Media.hasAudioRecorderPermissions> to check whether audio-permissions are granted and <Titanium.Media.requestAudioRecorderPermissions> to request audio-permissions.
|
|
350
330
|
|
|
351
|
-
**Android Platform Note**: On Android, you also need to include the following permission
|
|
352
|
-
into the `<android>` section of the tiapp.xml:
|
|
331
|
+
**Android Platform Note**: On Android, you also need to include the following permission into the `<android>` section of the tiapp.xml:
|
|
353
332
|
|
|
354
333
|
|
|
355
334
|
### Properties (unique: 5/8)
|
|
@@ -378,13 +357,9 @@ into the `<android>` section of the tiapp.xml:
|
|
|
378
357
|
> Extends Ti.Proxy
|
|
379
358
|
> Platforms: ios
|
|
380
359
|
|
|
381
|
-
This is a read-only object that describes a single media item, not a playlist.
|
|
382
|
-
Titanium does not support access to playlists.
|
|
360
|
+
This is a read-only object that describes a single media item, not a playlist. Titanium does not support access to playlists.
|
|
383
361
|
|
|
384
|
-
`Item` objects cannot be created explicitly. The
|
|
385
|
-
[openMusicLibrary](Titanium.Media.openMusicLibrary) returns `Item` objects in its
|
|
386
|
-
`success` callback function, while [queryMusicLibrary](Titanium.Media.queryMusicLibrary)
|
|
387
|
-
returns an array of `Item` objects.
|
|
362
|
+
`Item` objects cannot be created explicitly. The [openMusicLibrary](Titanium.Media.openMusicLibrary) returns `Item` objects in its `success` callback function, while [queryMusicLibrary](Titanium.Media.queryMusicLibrary) returns an array of `Item` objects.
|
|
388
363
|
|
|
389
364
|
### Properties (unique: 36/38)
|
|
390
365
|
| Property | Type | Default | Platform | Description |
|
|
@@ -477,14 +452,11 @@ To retrieve an instance of a MusicPlayer object, use either the
|
|
|
477
452
|
> Extends Ti.Proxy
|
|
478
453
|
> Platforms: both
|
|
479
454
|
|
|
480
|
-
The `Sound` object loads the entire media resource in memory before playing. If you need to
|
|
481
|
-
support streaming, use the [AudioPlayer](Titanium.Media.AudioPlayer) API.
|
|
455
|
+
The `Sound` object loads the entire media resource in memory before playing. If you need to support streaming, use the [AudioPlayer](Titanium.Media.AudioPlayer) API.
|
|
482
456
|
|
|
483
|
-
You can control how the sound interacts with other system sounds
|
|
484
|
-
by setting <Titanium.Media.audioSessionCategory>.
|
|
457
|
+
You can control how the sound interacts with other system sounds by setting <Titanium.Media.audioSessionCategory>.
|
|
485
458
|
|
|
486
|
-
Use the <Titanium.Media.createSound> method to create a `Sound` object. You can play audio
|
|
487
|
-
in any format supported by the target platform(s), as described in the following documents:
|
|
459
|
+
Use the <Titanium.Media.createSound> method to create a `Sound` object. You can play audio in any format supported by the target platform(s), as described in the following documents:
|
|
488
460
|
|
|
489
461
|
* [Android](https://developer.android.com/guide/topics/media/media-formats#core)
|
|
490
462
|
* [iOS](https://developer.apple.com/audio/)
|
|
@@ -538,10 +510,9 @@ in any format supported by the target platform(s), as described in the following
|
|
|
538
510
|
> Extends Ti.Proxy
|
|
539
511
|
> Platforms: ios
|
|
540
512
|
|
|
541
|
-
You can use this module to provide audible system alerts.
|
|
513
|
+
You can use this module to provide audible system alerts.
|
|
542
514
|
|
|
543
|
-
You can use it to play short (30 seconds or shorter) sounds. The interface does not provide level, positioning,
|
|
544
|
-
looping, or timing control, and does not support simultaneous playback: You can play only one sound at a time.
|
|
515
|
+
You can use it to play short (30 seconds or shorter) sounds. The interface does not provide level, positioning, looping, or timing control, and does not support simultaneous playback: You can play only one sound at a time.
|
|
545
516
|
|
|
546
517
|
This module differs from the Sound module because it honors the ringtone volume, not the Music volume.
|
|
547
518
|
|
|
@@ -568,20 +539,15 @@ Know more about [System Sound Services](https://developer.apple.com/reference/au
|
|
|
568
539
|
> Extends Ti.UI.View
|
|
569
540
|
> Platforms: both
|
|
570
541
|
|
|
571
|
-
The video player is a native view that can be used to play videos, either stored
|
|
572
|
-
locally or streamed from a web server. The player can occupy the full screen, or can
|
|
573
|
-
be used as a view that can be added to other views.
|
|
542
|
+
The video player is a native view that can be used to play videos, either stored locally or streamed from a web server. The player can occupy the full screen, or can be used as a view that can be added to other views.
|
|
574
543
|
|
|
575
544
|
Use the <Titanium.Media.createVideoPlayer> method to create a video player.
|
|
576
545
|
|
|
577
|
-
All platforms support specifying the video content as a URL, either to a local file or
|
|
578
|
-
a remote stream. This is done by setting the [url](Titanium.Media.VideoPlayer.url) property.
|
|
546
|
+
All platforms support specifying the video content as a URL, either to a local file or a remote stream. This is done by setting the [url](Titanium.Media.VideoPlayer.url) property.
|
|
579
547
|
|
|
580
548
|
### iOS Implementation Notes
|
|
581
549
|
|
|
582
|
-
On iOS, video content can also be specified as a [Blob](Titanium.Blob) or
|
|
583
|
-
[File](Titanium.Filesystem.File) object using the
|
|
584
|
-
[media](Titanium.Media.VideoPlayer.media) property.
|
|
550
|
+
On iOS, video content can also be specified as a [Blob](Titanium.Blob) or [File](Titanium.Filesystem.File) object using the [media](Titanium.Media.VideoPlayer.media) property.
|
|
585
551
|
|
|
586
552
|
|
|
587
553
|
*(See full overview in titanium-docs)*
|