"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/first-mate/api.json" (7 Feb 2017, 15411 Bytes) of archive /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) JSON source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 {
    2   "classes": {
    3     "GrammarRegistry": {
    4       "name": "GrammarRegistry",
    5       "filename": "src/grammar-registry.coffee",
    6       "srcUrl": "https://github.com/atom/first-mate/blob/v5.1.1/src/grammar-registry.coffee#L11",
    7       "sections": [
    8         {
    9           "name": "Event Subscription",
   10           "description": ""
   11         },
   12         {
   13           "name": "Managing Grammars",
   14           "description": ""
   15         }
   16       ],
   17       "classMethods": [],
   18       "instanceMethods": [
   19         {
   20           "name": "onDidAddGrammar",
   21           "sectionName": "Event Subscription",
   22           "srcUrl": "https://github.com/atom/first-mate/blob/v5.1.1/src/grammar-registry.coffee#L38",
   23           "visibility": "Public",
   24           "summary": "Invoke the given callback when a grammar is added to the registry.",
   25           "description": "Invoke the given callback when a grammar is added to the registry.",
   26           "arguments": [
   27             {
   28               "children": [
   29                 {
   30                   "name": "grammar",
   31                   "description": "{Grammar} that was added.",
   32                   "type": "Grammar",
   33                   "isOptional": false
   34                 }
   35               ],
   36               "name": "callback",
   37               "description": "{Function} to call when a grammar is added.",
   38               "type": "Function",
   39               "isOptional": false
   40             }
   41           ],
   42           "returnValues": [
   43             {
   44               "type": "Disposable",
   45               "description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
   46             }
   47           ]
   48         },
   49         {
   50           "name": "onDidUpdateGrammar",
   51           "sectionName": "Event Subscription",
   52           "srcUrl": "https://github.com/atom/first-mate/blob/v5.1.1/src/grammar-registry.coffee#L48",
   53           "visibility": "Public",
   54           "summary": "Invoke the given callback when a grammar is updated due to a grammar\nit depends on being added or removed from the registry.",
   55           "description": "Invoke the given callback when a grammar is updated due to a grammar\nit depends on being added or removed from the registry.",
   56           "arguments": [
   57             {
   58               "children": [
   59                 {
   60                   "name": "grammar",
   61                   "description": "{Grammar} that was updated.",
   62                   "type": "Grammar",
   63                   "isOptional": false
   64                 }
   65               ],
   66               "name": "callback",
   67               "description": "{Function} to call when a grammar is updated.",
   68               "type": "Function",
   69               "isOptional": false
   70             }
   71           ],
   72           "returnValues": [
   73             {
   74               "type": "Disposable",
   75               "description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
   76             }
   77           ]
   78         },
   79         {
   80           "name": "getGrammars",
   81           "sectionName": "Managing Grammars",
   82           "srcUrl": "https://github.com/atom/first-mate/blob/v5.1.1/src/grammar-registry.coffee#L58",
   83           "visibility": "Public",
   84           "summary": "Get all the grammars in this registry.",
   85           "description": "Get all the grammars in this registry.",
   86           "returnValues": [
   87             {
   88               "type": "Array",
   89               "description": "Returns a non-empty {Array} of {Grammar} instances."
   90             }
   91           ]
   92         },
   93         {
   94           "name": "grammarForScopeName",
   95           "sectionName": "Managing Grammars",
   96           "srcUrl": "https://github.com/atom/first-mate/blob/v5.1.1/src/grammar-registry.coffee#L66",
   97           "visibility": "Public",
   98           "summary": "Get a grammar with the given scope name.",
   99           "description": "Get a grammar with the given scope name.",
  100           "arguments": [
  101             {
  102               "name": "scopeName",
  103               "description": "A {String} such as `\"source.js\"`.",
  104               "type": "String",
  105               "isOptional": false
  106             }
  107           ],
  108           "returnValues": [
  109             {
  110               "type": "Grammar",
  111               "description": "Returns a {Grammar} or ."
  112             }
  113           ]
  114         },
  115         {
  116           "name": "addGrammar",
  117           "sectionName": "Managing Grammars",
  118           "srcUrl": "https://github.com/atom/first-mate/blob/v5.1.1/src/grammar-registry.coffee#L78",
  119           "visibility": "Public",
  120           "summary": "Add a grammar to this registry.",
  121           "description": "Add a grammar to this registry.\n\nA 'grammar-added' event is emitted after the grammar is added.",
  122           "arguments": [
  123             {
  124               "name": "grammar",
  125               "description": "The {Grammar} to add. This should be a value previously returned from {::readGrammar} or {::readGrammarSync}.",
  126               "type": "Grammar",
  127               "isOptional": false
  128             }
  129           ],
  130           "returnValues": [
  131             {
  132               "type": "Disposable",
  133               "description": "Returns a {Disposable} on which `.dispose()` can be called to remove the\ngrammar."
  134             }
  135           ]
  136         },
  137         {
  138           "name": "removeGrammarForScopeName",
  139           "sectionName": "Managing Grammars",
  140           "srcUrl": "https://github.com/atom/first-mate/blob/v5.1.1/src/grammar-registry.coffee#L99",
  141           "visibility": "Public",
  142           "summary": "Remove the grammar with the given scope name.",
  143           "description": "Remove the grammar with the given scope name.",
  144           "arguments": [
  145             {
  146               "name": "scopeName",
  147               "description": "A {String} such as `\"source.js\"`.",
  148               "type": "String",
  149               "isOptional": false
  150             }
  151           ],
  152           "returnValues": [
  153             {
  154               "type": "Grammar",
  155               "description": "Returns the removed {Grammar} or ."
  156             }
  157           ]
  158         },
  159         {
  160           "name": "readGrammarSync",
  161           "sectionName": "Managing Grammars",
  162           "srcUrl": "https://github.com/atom/first-mate/blob/v5.1.1/src/grammar-registry.coffee#L109",
  163           "visibility": "Public",
  164           "summary": "Read a grammar synchronously but don't add it to the registry.",
  165           "description": "Read a grammar synchronously but don't add it to the registry.",
  166           "arguments": [
  167             {
  168               "name": "grammarPath",
  169               "description": "A {String} absolute file path to a grammar file.",
  170               "type": "String",
  171               "isOptional": false
  172             }
  173           ],
  174           "returnValues": [
  175             {
  176               "type": "Grammar",
  177               "description": "Returns a {Grammar}."
  178             }
  179           ]
  180         },
  181         {
  182           "name": "readGrammar",
  183           "sectionName": "Managing Grammars",
  184           "srcUrl": "https://github.com/atom/first-mate/blob/v5.1.1/src/grammar-registry.coffee#L124",
  185           "visibility": "Public",
  186           "summary": "Read a grammar asynchronously but don't add it to the registry.",
  187           "description": "Read a grammar asynchronously but don't add it to the registry.",
  188           "arguments": [
  189             {
  190               "name": "grammarPath",
  191               "description": "A {String} absolute file path to a grammar file.",
  192               "type": "String",
  193               "isOptional": false
  194             },
  195             {
  196               "children": [
  197                 {
  198                   "name": "error",
  199                   "description": "An {Error}, may be null.",
  200                   "type": "Error",
  201                   "isOptional": false
  202                 },
  203                 {
  204                   "name": "grammar",
  205                   "description": "A {Grammar} or null if an error occured.",
  206                   "type": "Grammar",
  207                   "isOptional": false
  208                 }
  209               ],
  210               "name": "callback",
  211               "description": "A {Function} to call when read with the following arguments:",
  212               "type": "Function",
  213               "isOptional": false
  214             }
  215           ],
  216           "returnValues": [
  217             {
  218               "type": null,
  219               "description": "Returns ."
  220             }
  221           ]
  222         },
  223         {
  224           "name": "loadGrammarSync",
  225           "sectionName": "Managing Grammars",
  226           "srcUrl": "https://github.com/atom/first-mate/blob/v5.1.1/src/grammar-registry.coffee#L141",
  227           "visibility": "Public",
  228           "summary": "Read a grammar synchronously and add it to this registry.",
  229           "description": "Read a grammar synchronously and add it to this registry.",
  230           "arguments": [
  231             {
  232               "name": "grammarPath",
  233               "description": "A {String} absolute file path to a grammar file.",
  234               "type": "String",
  235               "isOptional": false
  236             }
  237           ],
  238           "returnValues": [
  239             {
  240               "type": "Grammar",
  241               "description": "Returns a {Grammar}."
  242             }
  243           ]
  244         },
  245         {
  246           "name": "loadGrammar",
  247           "sectionName": "Managing Grammars",
  248           "srcUrl": "https://github.com/atom/first-mate/blob/v5.1.1/src/grammar-registry.coffee#L154",
  249           "visibility": "Public",
  250           "summary": "Read a grammar asynchronously and add it to the registry.",
  251           "description": "Read a grammar asynchronously and add it to the registry.",
  252           "arguments": [
  253             {
  254               "name": "grammarPath",
  255               "description": "A {String} absolute file path to a grammar file.",
  256               "type": "String",
  257               "isOptional": false
  258             },
  259             {
  260               "children": [
  261                 {
  262                   "name": "error",
  263                   "description": "An {Error}, may be null.",
  264                   "type": "Error",
  265                   "isOptional": false
  266                 },
  267                 {
  268                   "name": "grammar",
  269                   "description": "A {Grammar} or null if an error occured.",
  270                   "type": "Grammar",
  271                   "isOptional": false
  272                 }
  273               ],
  274               "name": "callback",
  275               "description": "A {Function} to call when loaded with the following arguments:",
  276               "type": "Function",
  277               "isOptional": false
  278             }
  279           ],
  280           "returnValues": [
  281             {
  282               "type": null,
  283               "description": "Returns ."
  284             }
  285           ]
  286         }
  287       ],
  288       "classProperties": [],
  289       "instanceProperties": [],
  290       "visibility": "Extended",
  291       "summary": "Registry containing one or more grammars. ",
  292       "description": "Registry containing one or more grammars. "
  293     },
  294     "Grammar": {
  295       "name": "Grammar",
  296       "filename": "src/grammar.coffee",
  297       "srcUrl": "https://github.com/atom/first-mate/blob/v5.1.1/src/grammar.coffee#L19",
  298       "sections": [
  299         {
  300           "name": "Event Subscription",
  301           "description": ""
  302         },
  303         {
  304           "name": "Tokenizing",
  305           "description": ""
  306         }
  307       ],
  308       "classMethods": [],
  309       "instanceMethods": [
  310         {
  311           "name": "onDidUpdate",
  312           "sectionName": "Event Subscription",
  313           "srcUrl": "https://github.com/atom/first-mate/blob/v5.1.1/src/grammar.coffee#L59",
  314           "visibility": "Public",
  315           "summary": "Invoke the given callback when this grammar is updated due to a\ngrammar it depends on being added or removed from the registry.",
  316           "description": "Invoke the given callback when this grammar is updated due to a\ngrammar it depends on being added or removed from the registry.",
  317           "arguments": [
  318             {
  319               "name": "callback",
  320               "description": "{Function} to call when this grammar is updated.",
  321               "type": "Function",
  322               "isOptional": false
  323             }
  324           ],
  325           "returnValues": [
  326             {
  327               "type": "Disposable",
  328               "description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
  329             }
  330           ]
  331         },
  332         {
  333           "name": "tokenizeLines",
  334           "sectionName": "Tokenizing",
  335           "srcUrl": "https://github.com/atom/first-mate/blob/v5.1.1/src/grammar.coffee#L71",
  336           "visibility": "Public",
  337           "summary": "Tokenize all lines in the given text.",
  338           "description": "Tokenize all lines in the given text.",
  339           "arguments": [
  340             {
  341               "name": "text",
  342               "description": "A {String} containing one or more lines.",
  343               "type": "String",
  344               "isOptional": false
  345             }
  346           ],
  347           "returnValues": [
  348             {
  349               "type": "Array",
  350               "description": "Returns an {Array} of token arrays for each line tokenized."
  351             }
  352           ]
  353         },
  354         {
  355           "name": "tokenizeLine",
  356           "sectionName": "Tokenizing",
  357           "srcUrl": "https://github.com/atom/first-mate/blob/v5.1.1/src/grammar.coffee#L101",
  358           "visibility": "Public",
  359           "summary": "Tokenize the line of text.",
  360           "description": "Tokenize the line of text.",
  361           "arguments": [
  362             {
  363               "name": "line",
  364               "description": "A {String} of text to tokenize.",
  365               "type": "String",
  366               "isOptional": false
  367             },
  368             {
  369               "name": "ruleStack",
  370               "description": "An optional {Array} of rules previously returned from this method. This should be null when tokenizing the first line in the file.",
  371               "type": "Array",
  372               "isOptional": false
  373             },
  374             {
  375               "name": "firstLine",
  376               "description": "A optional {Boolean} denoting whether this is the first line in the file which defaults to `false`. This should be `true` when tokenizing the first line in the file.",
  377               "type": "Boolean",
  378               "isOptional": false
  379             }
  380           ],
  381           "returnValues": [
  382             {
  383               "type": "Object",
  384               "description": "Returns an {Object} containing the following properties:\n\n* `line` The {String} of text that was tokenized.\n* `tags` An {Array} of integer scope ids and strings. Positive ids\n  indicate the beginning of a scope, and negative tags indicate the end.\n  To resolve ids to scope names, call {GrammarRegistry::scopeForId} with the\n  absolute value of the id.\n* `tokens` This is a dynamic property. Invoking it will incur additional\n  overhead, but will automatically translate the `tags` into token objects\n  with `value` and `scopes` properties.\n* `ruleStack` An {Array} of rules representing the tokenized state at the\n  end of the line. These should be passed back into this method when\n  tokenizing the next line in the file."
  385             }
  386           ]
  387         }
  388       ],
  389       "classProperties": [],
  390       "instanceProperties": [],
  391       "visibility": "Extended",
  392       "summary": "Grammar that tokenizes lines of text.",
  393       "description": "Grammar that tokenizes lines of text.\n\nThis class should not be instantiated directly but instead obtained from\na {GrammarRegistry} by calling {GrammarRegistry::loadGrammar}. "
  394     }
  395   }
  396 }