Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Removed broken Github links per TIDOC-3191
Contents

Table of Contents
maxLevel5
minLevel2

Overview

This is a brief description of the JSCA file format. This JSON-based format is used to define content assist metadata for the Javascript Content Assist (CA) system. The structure of JSCA is described by another JSON-based format called JFF (JSON File Format). While reading this document, it may be useful to view the JSCA JFF file.

Please note, that in general, properties on a JSON object may occur in any order; however, in order to simplify processing of JSCA files, it is required that any JSON objects having a "name" property must list that property before all others.

Short Example

Code Block
javascript
linenumbersjavascripttrue
languagejs
{
  "types": [
    {
      "name": "Titanium.Android.NotificationManager", 
      "examples": [], 
      "functions": [
        {
          "name": "addEventListener", 
          "parameters": [
            {
              "name": "name", 
              "usage": "", 
              "type": "String", 
              "description": "name of the event"
            }, 
            {
              "name": "callback", 
              "usage": "", 
              "type": "Function", 
              "description": "callback function to invoke when the event is fired"
            }
          ], 
          "userAgents": [
            {
              "platform": "android"
            }
          ], 
          "since": [
            {
              "version": "1.5", 
              "name": "Titanium Mobile SDK"
            }
          ], 
          "isConstructor": false, 
          "isClassProperty": false, 
          "examples": [], 
          "isInternal": false, 
          "exceptions": [], 
          "references": [], 
          "isMethod": true, 
          "isInstanceProperty": true, 
          "description": "add an event listener for the instance to receive view triggered events"
        }
      ], 
      "events": [], 
      "userAgents": [
        {
          "platform": "android"
        }
      ], 
      "remarks": [
        "<p>The constants above are taken from other docs</p>"
      ], 
      "deprecated": false, 
      "since": [
        {
          "version": "1.5", 
          "name": "Titanium Mobile SDK"
        }
      ], 
      "properties": [
        {
          "name": "DEFAULT_ALL", 
          "isInternal": false, 
          "isInstanceProperty": false, 
          "since": [
            {
              "version": "1.5", 
              "name": "Titanium Mobile SDK"
            }
          ], 
          "examples": [], 
          "userAgents": [
            {
              "platform": "android"
            }
          ], 
          "type": "Number", 
          "isClassProperty": true, 
          "description": "<p>Use all default values (where applicable).</p>"
        }
      ], 
      "description": "<p>Module to notify users of events that happen.</p>"
    }
  ], 
  "aliases": [
    {
      "type": "Titanium", 
      "name": "Ti"
    }
  ],
  "version": "1.0"
  "build": "1.7.0-201103300900"
}

...

The JSCA file format consists of a single top-level object with the following properties: version, build, aliases, and types. Below is a description of each of these properties

Code Block
javascript
linenumbersjavascripttrue
languagejs
{
  "version": "http://url-to-version-spec",
  "aliases": [],
  "types": []
}

...

The aliases property allows for the definition of shortcuts to deeply nested types. This property consists of an array of Alias types. This property is optional.

Code Block
javascript
linenumbersjavascripttrue
languagejs
  "aliases": [
    {
      "type": "Titanium", 
      "name": "Ti"
    }
  ]

...

This is perhaps the most important top-level property. This property contains a list of Type types used to defined the types in the JSCA file. This property is optional.

Code Block
javascript
linenumbersjavascripttrue
languagejs
{
  "types": [
    {
      "name": "Titanium.Android.NotificationManager", 
      "examples": [], 
      "functions": [], 
      "events": [], 
      "userAgents": [], 
      "remarks": [], 
      "deprecated": false, 
      "since": [], 
      "properties": [], 
      "description": "<p>Module to notify users of events that happen.</p>"
    },
    ...
  ],
  ... 
}

...