Skip to content

Commit

Permalink
Merge 39c38b0 into 0722788
Browse files Browse the repository at this point in the history
  • Loading branch information
lijiarui committed Sep 24, 2017
2 parents 0722788 + 39c38b0 commit 0ef3b15
Show file tree
Hide file tree
Showing 6 changed files with 153 additions and 5 deletions.
84 changes: 81 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

[![Wechaty](https://chatie.io/wechaty/images/wechaty-logo-en.png)](https://github.com/chatie/wechaty)

WECHATY
Expand Down Expand Up @@ -137,13 +138,91 @@ npm test

Get to know more about the tests from [Wiki:Test](https://github.com/chatie/wechaty/wiki/Test)

DOCUMATAION
API Reference
-------------

In order to sync the doc with the lastest code, we are using [jsdoc](http://usejsdoc.org/) to describe the API, and use [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown/wiki) to generate markdown format documents to the [docs](docs/index.md) directory.

See: [Official API Reference](https://chatie.github.io/wechaty/)


[comment]: # (JSDOC SYNC BEGIN)

* [Wechaty](http://chatie.io/wechaty/#Wechaty)
* [wechaty.init()](http://chatie.io/wechaty/#Wechaty+init) ⇒ <code>Promise.&lt;void&gt;</code>
* [wechaty.on(event, listener)](http://chatie.io/wechaty/#Wechaty+on)[<code>Wechaty</code>](http://chatie.io/wechaty/#Wechaty)
* [wechaty.quit()](http://chatie.io/wechaty/#Wechaty+quit) ⇒ <code>Promise.&lt;void&gt;</code>
* [wechaty.logout()](http://chatie.io/wechaty/#Wechaty+logout) ⇒ <code>Promise.&lt;void&gt;</code>
* [wechaty.self()](http://chatie.io/wechaty/#Wechaty+self)[<code>Contact</code>](http://chatie.io/wechaty/#Contact)
* [wechaty.say(content)](http://chatie.io/wechaty/#Wechaty+say) ⇒ <code>Promise.&lt;boolean&gt;</code>
* [Wechaty.instance()](http://chatie.io/wechaty/#Wechaty.instance)
* [Wechaty.version([forceNpm])](http://chatie.io/wechaty/#Wechaty.version) ⇒ <code>string</code>

* [Contact](http://chatie.io/wechaty/#Contact)
* [contact.say(textOrMedia)](http://chatie.io/wechaty/#Contact+say) ⇒ <code>Promise.&lt;boolean&gt;</code>
* [contact.name()](http://chatie.io/wechaty/#Contact+name) ⇒ <code>string</code>
* [contact.alias(newAlias)](http://chatie.io/wechaty/#Contact+alias) ⇒ <code>string</code> \| <code>null</code> \| <code>Promise.&lt;boolean&gt;</code>
* [contact.stranger()](http://chatie.io/wechaty/#Contact+stranger) ⇒ <code>boolean</code> \| <code>null</code>
* [contact.official()](http://chatie.io/wechaty/#Contact+official) ⇒ <code>boolean</code> \| <code>null</code>
* [contact.special()](http://chatie.io/wechaty/#Contact+special) ⇒ <code>boolean</code> \| <code>null</code>
* [contact.personal()](http://chatie.io/wechaty/#Contact+personal) ⇒ <code>boolean</code> \| <code>null</code>
* [contact.star()](http://chatie.io/wechaty/#Contact+star) ⇒ <code>boolean</code>
* [contact.gender()](http://chatie.io/wechaty/#Contact+gender) ⇒ <code>Gender.Male(2)</code> \| <code>Gender.Female(1)</code> \| <code>Gender.Unknown(0)</code>
* [contact.province()](http://chatie.io/wechaty/#Contact+province) ⇒ <code>string</code> \| <code>undefined</code>
* [contact.city()](http://chatie.io/wechaty/#Contact+city) ⇒ <code>string</code> \| <code>undefined</code>
* [contact.avatar()](http://chatie.io/wechaty/#Contact+avatar) ⇒ <code>Promise.&lt;NodeJS.ReadableStream&gt;</code>
* [contact.refresh()](http://chatie.io/wechaty/#Contact+refresh) ⇒ <code>Promise.&lt;this&gt;</code>
* [contact.self()](http://chatie.io/wechaty/#Contact+self) ⇒ <code>boolean</code>
* [Contact.find(query)](http://chatie.io/wechaty/#Contact.find) ⇒ <code>Promise.&lt;(Contact\|null)&gt;</code>
* [Contact.findAll([queryArg])](http://chatie.io/wechaty/#Contact.findAll) ⇒ <code>Promise.&lt;Array.&lt;Contact&gt;&gt;</code>


* [Room](http://chatie.io/wechaty/#Room)
* [room.say(textOrMedia, [replyTo])](http://chatie.io/wechaty/#Room+say) ⇒ <code>Promise.&lt;boolean&gt;</code>
* [room.on(event, listener)](http://chatie.io/wechaty/#Room+on) ⇒ <code>this</code>
* [room.add(contact)](http://chatie.io/wechaty/#Room+add) ⇒ <code>Promise.&lt;number&gt;</code>
* [room.del(contact)](http://chatie.io/wechaty/#Room+del) ⇒ <code>Promise.&lt;number&gt;</code>
* [room.topic([newTopic])](http://chatie.io/wechaty/#Room+topic) ⇒ <code>string</code> \| <code>void</code>
* [room.alias(contact)](http://chatie.io/wechaty/#Room+alias) ⇒ <code>string</code> \| <code>null</code>
* [room.roomAlias(contact)](http://chatie.io/wechaty/#Room+roomAlias) ⇒ <code>string</code> \| <code>null</code>
* [room.has(contact)](http://chatie.io/wechaty/#Room+has) ⇒ <code>boolean</code>
* [room.memberAll(queryArg)](http://chatie.io/wechaty/#Room+memberAll)[<code>Array.&lt;Contact&gt;</code>](http://chatie.io/wechaty/#Contact)
* [room.member(queryArg)](http://chatie.io/wechaty/#Room+member)[<code>Contact</code>](http://chatie.io/wechaty/#Contact) \| <code>null</code>
* [room.memberList()](http://chatie.io/wechaty/#Room+memberList)[<code>Array.&lt;Contact&gt;</code>](http://chatie.io/wechaty/#Contact)
* [room.refresh()](http://chatie.io/wechaty/#Room+refresh) ⇒ <code>Promise.&lt;void&gt;</code>
* [Room.create(contactList, [topic])](http://chatie.io/wechaty/#Room.create)[<code>Promise.&lt;Room&gt;</code>](http://chatie.io/wechaty/#Room)
* [Room.findAll([query])](http://chatie.io/wechaty/#Room.findAll) ⇒ <code>Promise.&lt;Array.&lt;Room&gt;&gt;</code>
* [Room.find(query)](http://chatie.io/wechaty/#Room.find) ⇒ <code>Promise.&lt;(Room\|null)&gt;</code>


* [Message](http://chatie.io/wechaty/#Message)
* [message.say(textOrMedia, [replyTo])](http://chatie.io/wechaty/#Message+say) ⇒ <code>Promise.&lt;any&gt;</code>
* [message.from()](http://chatie.io/wechaty/#Message+from)[<code>Contact</code>](http://chatie.io/wechaty/#Contact)
* [message.room()](http://chatie.io/wechaty/#Message+room)[<code>Room</code>](http://chatie.io/wechaty/#Room) \| <code>null</code>
* [message.content()](http://chatie.io/wechaty/#Message+content) ⇒ <code>string</code>
* [message.type()](http://chatie.io/wechaty/#Message+type)[<code>MsgType</code>](http://chatie.io/wechaty/#MsgType)
* [message.typeSub()](http://chatie.io/wechaty/#Message+typeSub)[<code>MsgType</code>](http://chatie.io/wechaty/#MsgType)
* [message.typeApp()](http://chatie.io/wechaty/#Message+typeApp)[<code>AppMsgType</code>](http://chatie.io/wechaty/#AppMsgType)
* [message.typeEx()](http://chatie.io/wechaty/#Message+typeEx)[<code>MsgType</code>](http://chatie.io/wechaty/#MsgType)
* [message.self()](http://chatie.io/wechaty/#Message+self) ⇒ <code>boolean</code>
* [message.mentioned()](http://chatie.io/wechaty/#Message+mentioned)[<code>Array.&lt;Contact&gt;</code>](http://chatie.io/wechaty/#Contact)
* [message.to()](http://chatie.io/wechaty/#Message+to)[<code>Contact</code>](http://chatie.io/wechaty/#Contact) \| <code>null</code>
* [message.readyStream()](http://chatie.io/wechaty/#Message+readyStream) ⇒ <code>Promise.&lt;Readable&gt;</code>
* [Message.find()](http://chatie.io/wechaty/#Message.find)
* [Message.findAll()](http://chatie.io/wechaty/#Message.findAll)

* [MediaMessage](http://chatie.io/wechaty/#MediaMessage)
* [mediaMessage.ext()](http://chatie.io/wechaty/#MediaMessage+ext) ⇒ <code>string</code>
* [mediaMessage.filename()](http://chatie.io/wechaty/#MediaMessage+filename) ⇒ <code>string</code>
* [mediaMessage.readyStream()](http://chatie.io/wechaty/#MediaMessage+readyStream)
* [mediaMessage.forward(sendTo)](http://chatie.io/wechaty/#MediaMessage+forward) ⇒ <code>Promise.&lt;boolean&gt;</code>

* [FriendRequest](http://chatie.io/wechaty/#FriendRequest)
* [friendRequest.send(contact, [hello])](http://chatie.io/wechaty/#FriendRequest+send) ⇒ <code>Promise.&lt;boolean&gt;</code>
* [friendRequest.accept()](http://chatie.io/wechaty/#FriendRequest+accept) ⇒ <code>Promise.&lt;boolean&gt;</code>

[comment]: # (JSDOC SYNC END)

RELEASE NOTES
-------------

Expand Down Expand Up @@ -263,5 +342,4 @@ COPYRIGHT & LICENSE
* Docs released under Creative Commons

[downloads-image]: http://img.shields.io/npm/dm/wechaty.svg?style=flat-square
[downloads-url]: https://npmjs.org/package/wechaty

[downloads-url]: https://npmjs.org/package/wechaty
25 changes: 25 additions & 0 deletions docs/config/link.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{! usage: link to="namepath" html=true/false caption="optional caption"~}}

{{~#if html~}}
<code>

{{~#link to~}}
{{#if url~}}
<a href="http://chatie.io/wechaty/{{{url}}}">{{#if ../../caption}}{{../../../caption}}{{else}}{{name}}{{/if}}</a>
{{~else~}}
{{#if ../../caption}}{{../../../caption}}{{else}}{{name}}{{/if~}}
{{/if~}}
{{/link~}}

</code>
{{~else~}}

{{#link to~}}
{{#if url~}}
[<code>{{#if ../../caption}}{{escape ../../../caption}}{{else}}{{escape name}}{{/if}}</code>](http://chatie.io/wechaty/{{{url}}})
{{~else~}}
<code>{{#if ../../caption}}{{escape ../../../caption}}{{else}}{{escape name}}{{/if~}}</code>
{{~/if~}}
{{/link~}}

{{/if~}}
13 changes: 13 additions & 0 deletions docs/config/sig-link-parent.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{#if name}}{{#sig~}}
{{{@depOpen}~}}
[{{{@codeOpen}~}}
{{#if @prefix}}{{@prefix}} {{/if~}}
{{#if (isClassMember)}}{{@parent~}}{{/if~}}
{{@accessSymbol}}{{#if (isEvent)}}"{{{name}}}"{{else}}{{{name}}}{{/if~}}
{{~#if @methodSign}}{{#if (isEvent)}} {{@methodSign}}{{else}}{{@methodSign}}{{/if}}{{/if~}}
{{{@codeClose}}}](http://chatie.io/wechaty/#{{{anchorName}}})
{{~#if @returnSymbol}} {{@returnSymbol}}{{/if~}}
{{#if @returnTypes}} {{>linked-type-list types=@returnTypes delimiter=" \| " }}{{/if~}}
{{#if @suffix}} {{@suffix}}{{/if~}}
{{{@depClose}~}}
{{~/sig}}{{/if~}}
28 changes: 28 additions & 0 deletions docs/doc-toc.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

{{#class name="Wechaty"~}}
{{>member-index-list~}}
{{/class}}

{{#class name="Contact"~}}
{{>member-index-list~}}
{{/class}}


{{#class name="Room"~}}
{{>member-index-list~}}
{{/class}}


{{#class name="Message"~}}
{{>member-index-list~}}
{{/class}}

{{#class name="MediaMessage"~}}
{{>member-index-list~}}
{{/class}}

{{#class name="FriendRequest"~}}
{{>member-index-list~}}
{{/class}}

[comment]: # (JSDOC SYNC END)
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Wechaty v0.8.227 Documentation
# Wechaty v0.8.231 Documentation

## Classes

Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
"ava": "ava --verbose --extension ts",
"ts-node": "ts-node",
"dist": "npm run clean && tsc && jq \"del (.files)\" < package.json > dist/package.json && shx cp src/puppet-web/*.js dist/src/puppet-web/",
"doc": "npm run dist && echo '# Wechaty v'$(jq -r .version package.json)' Documentation\n' > docs/index.md && jsdoc2md dist/src/{wechaty,room,contact,friend-request,message}.js dist/src/puppet-web/friend-request.js>> docs/index.md",
"doc": "npm run dist && echo '# Wechaty v'$(jq -r .version package.json)' Documentation\n' > docs/index.md && npm run doc:api && npm run doc:readme",
"doc:readme": "npm run doc:toc && mv README.md _README.md && gsed \"/JSDOC SYNC BEGIN/,/JSDOC SYNC END/ c [comment]: # (JSDOC SYNC BEGIN)\" _README.md > README.bak.md && gsed \"/JSDOC SYNC BEGIN/ r docs/doc-toc.md\" README.bak.md > README.md && npm run doc:clean",
"doc:toc": "jsdoc2md --partial docs/config/*.hbs --template docs/doc-toc.hbs dist/src/{wechaty,room,contact,friend-request,message}.js dist/src/puppet-web/friend-request.js>> docs/doc-toc.md",
"doc:api": "jsdoc2md dist/src/{wechaty,room,contact,friend-request,message}.js dist/src/puppet-web/friend-request.js>> docs/index.md",
"doc:clean": "shx rm -rf docs/doc-toc.md _README.md README.bak.md",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"changelog": "github_changelog_generator -u chatie -p wechaty && sed -i'.bak' /greenkeeper/d CHANGELOG.md",
"doctor": "npm run check-node-version && ts-node bin/doctor",
Expand Down

0 comments on commit 0ef3b15

Please sign in to comment.