Skip to content

Commit

Permalink
Review the api documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
enricostara committed Aug 22, 2015
1 parent f7d298c commit 4cd0bbe
Show file tree
Hide file tree
Showing 13 changed files with 762 additions and 137 deletions.
34 changes: 19 additions & 15 deletions doc/updates.html → doc/api/account.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

<html>
<head>
<title>updates.js</title>
<title>account.js</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<link rel="stylesheet" media="all" href="docco.css" />
<link rel="stylesheet" media="all" href="../docco.css" />
</head>
<body>
<div id="container">
Expand All @@ -15,7 +15,7 @@

<li id="title">
<div class="annotation">
<h1>updates.js</h1>
<h1>account.js</h1>
</div>
</li>

Expand Down Expand Up @@ -47,8 +47,8 @@ <h1>updates.js</h1>

</div>

<div class="content"><div class='highlight'><pre><span class="hljs-keyword">var</span> api = <span class="hljs-built_in">require</span>(<span class="hljs-string">'./api'</span>);
<span class="hljs-keyword">var</span> utility = <span class="hljs-built_in">require</span>(<span class="hljs-string">'./utility'</span>);</pre></div></div>
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">var</span> api = <span class="hljs-built_in">require</span>(<span class="hljs-string">'../api'</span>);
<span class="hljs-keyword">var</span> utility = <span class="hljs-built_in">require</span>(<span class="hljs-string">'../utility'</span>);</pre></div></div>

</li>

Expand All @@ -72,7 +72,7 @@ <h1>updates.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-4">&#182;</a>
</div>
<p>This module wraps API methods required to manage the session updates</p>
<p>This module wraps API methods required to manage notifications and settings</p>

</div>

Expand All @@ -85,7 +85,7 @@ <h1>updates.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-5">&#182;</a>
</div>
<p>See <a href="https://core.telegram.org/methods#working-with-updates">Api Methods</a></p>
<p>See <a href="https://core.telegram.org/methods#working-with-notifications-settings">Api Methods</a></p>

</div>

Expand All @@ -98,12 +98,12 @@ <h1>updates.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-6">&#182;</a>
</div>
<p>Access only via Client object and <code>updates</code> instance property</p>
<p>Access only via Client object and <code>account</code> instance property</p>

</div>

<div class="content"><div class='highlight'><pre>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">Updates</span>(<span class="hljs-params">client</span>) </span>{
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">Account</span>(<span class="hljs-params">client</span>) </span>{
<span class="hljs-keyword">this</span>.client = client;
}</pre></div></div>

Expand Down Expand Up @@ -156,7 +156,7 @@ <h1>updates.js</h1>
<a class="pilcrow" href="#section-10">&#182;</a>
</div>
<hr>
<p>updates.<strong>getState([callback])</strong></p>
<p>account.<strong>updateStatus(offline, [callback])</strong></p>

</div>

Expand All @@ -169,7 +169,7 @@ <h1>updates.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-11">&#182;</a>
</div>
<p>Returns a Promise for get the current state of updates.</p>
<p>Return a Promise to update the online user status..</p>

</div>

Expand All @@ -182,7 +182,7 @@ <h1>updates.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-12">&#182;</a>
</div>
<p><a href="https://core.telegram.org/method/updates.getState">Click here for more details</a></p>
<p><a href="https://core.telegram.org/method/account.updateStatus">Click here for more details</a></p>

</div>

Expand All @@ -199,8 +199,12 @@ <h1>updates.js</h1>

</div>

<div class="content"><div class='highlight'><pre>Updates.prototype.getState = <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">callback</span>) </span>{
<span class="hljs-keyword">return</span> utility.callService(api.service.updates.getState, <span class="hljs-keyword">this</span>.client, <span class="hljs-keyword">this</span>.client._channel, callback, <span class="hljs-built_in">arguments</span>);
<div class="content"><div class='highlight'><pre>Account.prototype.updateStatus = <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">offline, callback</span>) </span>{

offline = offline === <span class="hljs-literal">false</span> ? <span class="hljs-keyword">new</span> api.type.BoolFalse() :
( offline === <span class="hljs-literal">true</span> ? <span class="hljs-keyword">new</span> api.type.BoolTrue() : offline);

<span class="hljs-keyword">return</span> utility.callService(api.service.account.updateStatus, <span class="hljs-keyword">this</span>.client, <span class="hljs-keyword">this</span>.client._channel, callback, <span class="hljs-built_in">arguments</span>);
};</pre></div></div>

</li>
Expand All @@ -216,7 +220,7 @@ <h1>updates.js</h1>

</div>

<div class="content"><div class='highlight'><pre><span class="hljs-built_in">module</span>.exports = exports = Updates;</pre></div></div>
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">module</span>.exports = exports = Account;</pre></div></div>

</li>

Expand Down
22 changes: 10 additions & 12 deletions doc/auth.html → doc/api/auth.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title>auth.js</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<link rel="stylesheet" media="all" href="docco.css" />
<link rel="stylesheet" media="all" href="../docco.css" />
</head>
<body>
<div id="container">
Expand Down Expand Up @@ -47,8 +47,8 @@ <h1>auth.js</h1>

</div>

<div class="content"><div class='highlight'><pre><span class="hljs-keyword">var</span> api = <span class="hljs-built_in">require</span>(<span class="hljs-string">'./api'</span>);
<span class="hljs-keyword">var</span> utility = <span class="hljs-built_in">require</span>(<span class="hljs-string">'./utility'</span>);</pre></div></div>
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">var</span> api = <span class="hljs-built_in">require</span>(<span class="hljs-string">'../api'</span>);
<span class="hljs-keyword">var</span> utility = <span class="hljs-built_in">require</span>(<span class="hljs-string">'../utility'</span>);</pre></div></div>

</li>

Expand Down Expand Up @@ -170,7 +170,7 @@ <h1>auth.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-11">&#182;</a>
</div>
<p>Sends a text message with the confirmation code required for registration to the given phone number.</p>
<p>Send a text message with the confirmation code required for registration to the given phone number.</p>

</div>

Expand Down Expand Up @@ -247,8 +247,8 @@ <h1>auth.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-15">&#182;</a>
</div>
<p>Makes a voice call to the passed phone number. A robot will repeat the confirmation code from a previously sent SMS message.
Returns a Promise.</p>
<p>Return a Promise to make a voice call to the passed phone number.
A robot will repeat the confirmation code from a previously sent SMS message.</p>

</div>

Expand Down Expand Up @@ -305,8 +305,7 @@ <h1>auth.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-19">&#182;</a>
</div>
<p>Signs in a user with a validated phone number.
Returns a Promise.</p>
<p>Return a Promise to sign in a user with a validated phone number.</p>

</div>

Expand Down Expand Up @@ -363,8 +362,7 @@ <h1>auth.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-23">&#182;</a>
</div>
<p>Registers a validated phone number in the system.
Returns a Promise.</p>
<p>Return a Promise to register a validated phone number in the system.</p>

</div>

Expand Down Expand Up @@ -421,7 +419,7 @@ <h1>auth.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-27">&#182;</a>
</div>
<p>Returns a Promise for get the information on whether the passed phone number was registered.</p>
<p>Return a Promise to get the information on whether the passed phone number was registered.</p>

</div>

Expand Down Expand Up @@ -464,7 +462,7 @@ <h1>auth.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-30">&#182;</a>
</div>
<p>Exports the class.</p>
<p>Export the class.</p>

</div>

Expand Down
10 changes: 5 additions & 5 deletions doc/contacts.html → doc/api/contacts.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title>contacts.js</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<link rel="stylesheet" media="all" href="docco.css" />
<link rel="stylesheet" media="all" href="../docco.css" />
</head>
<body>
<div id="container">
Expand Down Expand Up @@ -47,8 +47,8 @@ <h1>contacts.js</h1>

</div>

<div class="content"><div class='highlight'><pre><span class="hljs-keyword">var</span> api = <span class="hljs-built_in">require</span>(<span class="hljs-string">'./api'</span>);
<span class="hljs-keyword">var</span> utility = <span class="hljs-built_in">require</span>(<span class="hljs-string">'./utility'</span>);</pre></div></div>
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">var</span> api = <span class="hljs-built_in">require</span>(<span class="hljs-string">'../api'</span>);
<span class="hljs-keyword">var</span> utility = <span class="hljs-built_in">require</span>(<span class="hljs-string">'../utility'</span>);</pre></div></div>

</li>

Expand Down Expand Up @@ -169,7 +169,7 @@ <h1>contacts.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-11">&#182;</a>
</div>
<p>Returns a Promise for get the current user’s contact list.</p>
<p>Return a Promise to get the current user’s contact list.</p>

</div>

Expand Down Expand Up @@ -212,7 +212,7 @@ <h1>contacts.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-14">&#182;</a>
</div>
<p>Exports the class</p>
<p>Export the class</p>

</div>

Expand Down
Loading

0 comments on commit 4cd0bbe

Please sign in to comment.