Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
.www.
wechaty
提交
4733439c
W
wechaty
项目概览
.www.
/
wechaty
与 Fork 源项目一致
Fork自
wechaty / wechaty
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
W
wechaty
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4733439c
编写于
10月 11, 2016
作者:
Huan (李卓桓)
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#40 typescript compile success!
上级
f5d4afd7
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
32 addition
and
18 deletion
+32
-18
.gitignore
.gitignore
+1
-0
src/io-client.ts
src/io-client.ts
+2
-2
src/puppet.ts
src/puppet.ts
+3
-3
src/wechaty.ts
src/wechaty.ts
+10
-7
tsconfig.json
tsconfig.json
+16
-6
未找到文件。
.gitignore
浏览文件 @
4733439c
...
...
@@ -52,3 +52,4 @@ t/
t.*
.DS_Store
/dev.js
/dist/
src/io-client.ts
浏览文件 @
4733439c
...
...
@@ -80,7 +80,7 @@ class IoClient {
this
.
targetState
(
'
connected
'
)
this
.
currentState
(
'
connecting
'
)
this
.
wechaty
=
new
Wechaty
({
this
.
wechaty
=
Wechaty
.
instance
({
profile
:
Config
.
DEFAULT_PROFILE
})
...
...
@@ -165,7 +165,7 @@ class IoClient {
res
.
send
(
'
Wechaty IO Bot Alive!
'
)
})
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
)
=>
{
app
.
listen
(
port
,
()
=>
{
this
.
log
.
verbose
(
'
IoClient
'
,
'
initWeb() Wechaty IO Bot listening on port
'
+
port
+
'
!
'
)
...
...
src/puppet.ts
浏览文件 @
4733439c
...
...
@@ -17,9 +17,9 @@ import Message from './message'
import
Room
from
'
./room
'
import
log
from
'
./brolog-env
'
type
ContactGetterFunc
=
{
(
id
:
string
):
Promise
<
any
>
}
//
type ContactGetterFunc = {
//
(id: string): Promise<any>
//
}
abstract
class
Puppet
extends
EventEmitter
{
public
user
:
Contact
...
...
src/wechaty.ts
浏览文件 @
4733439c
...
...
@@ -44,6 +44,16 @@ class Wechaty extends EventEmitter {
public
uuid
:
string
public
static
instance
(
setting
?:
WechatySetting
)
{
if
(
setting
&&
this
.
_instance
)
{
throw
new
Error
(
'
there has already a instance. no params allowed any more
'
)
}
if
(
!
this
.
_instance
)
{
this
.
_instance
=
new
Wechaty
(
setting
)
}
return
this
.
_instance
}
private
constructor
(
private
setting
:
WechatySetting
)
{
super
()
log
.
verbose
(
'
Wechaty
'
,
'
contructor()
'
)
...
...
@@ -72,13 +82,6 @@ class Wechaty extends EventEmitter {
// Wechaty._instance = this
}
public
static
instance
(
setting
:
WechatySetting
)
{
if
(
!
this
.
_instance
)
{
this
.
_instance
=
new
Wechaty
(
setting
)
}
return
this
.
_instance
}
public
toString
()
{
return
'
Class Wechaty(
'
+
this
.
setting
.
type
+
'
)
'
}
public
version
(
forceNpm
=
false
)
{
...
...
tsconfig.json
浏览文件 @
4733439c
{
"compilerOptions"
:
{
"target"
:
"es6"
,
"module"
:
"amd"
,
"moduleResolution"
:
"node"
,
"outDir"
:
"dist"
,
"
noImplicitAny"
:
false
,
"strictNullChecks"
:
true
,
"
outFile"
:
"dist/wechaty.lib.js"
,
"sourceMap"
:
true
,
"noUnusedLocals"
:
true
,
"noUnusedParameters"
:
false
,
"strictNullChecks"
:
false
,
"noImplicitAny"
:
false
,
"noImplicitThis"
:
false
,
"noImplicitReturns"
:
false
,
"noFallthroughCasesInSwitch"
:
false
}
,
"exclude"
:
[
"node_modules"
,
"dist"
,
"**/*.spec.ts"
]
,
"
files
"
:
[
"src/*.ts"
,
"bin/*.ts"
,
"example/*.ts"
,
"
include
"
:
[
"src/*
*/*
.ts"
//
,
"bin/*.ts"
//
,
"example/*.ts"
//
,
"test/*.ts"
]
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录