Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_46011646
wechaty
提交
4733439c
W
wechaty
项目概览
weixin_46011646
/
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,体验更适合开发者的 AI 搜索 >>
提交
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/
...
@@ -52,3 +52,4 @@ t/
t.*
t.*
.DS_Store
.DS_Store
/dev.js
/dev.js
/dist/
src/io-client.ts
浏览文件 @
4733439c
...
@@ -80,7 +80,7 @@ class IoClient {
...
@@ -80,7 +80,7 @@ class IoClient {
this
.
targetState
(
'
connected
'
)
this
.
targetState
(
'
connected
'
)
this
.
currentState
(
'
connecting
'
)
this
.
currentState
(
'
connecting
'
)
this
.
wechaty
=
new
Wechaty
({
this
.
wechaty
=
Wechaty
.
instance
({
profile
:
Config
.
DEFAULT_PROFILE
profile
:
Config
.
DEFAULT_PROFILE
})
})
...
@@ -165,7 +165,7 @@ class IoClient {
...
@@ -165,7 +165,7 @@ class IoClient {
res
.
send
(
'
Wechaty IO Bot Alive!
'
)
res
.
send
(
'
Wechaty IO Bot Alive!
'
)
})
})
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
)
=>
{
app
.
listen
(
port
,
()
=>
{
app
.
listen
(
port
,
()
=>
{
this
.
log
.
verbose
(
'
IoClient
'
,
'
initWeb() Wechaty IO Bot listening on port
'
+
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'
...
@@ -17,9 +17,9 @@ import Message from './message'
import
Room
from
'
./room
'
import
Room
from
'
./room
'
import
log
from
'
./brolog-env
'
import
log
from
'
./brolog-env
'
type
ContactGetterFunc
=
{
//
type ContactGetterFunc = {
(
id
:
string
):
Promise
<
any
>
//
(id: string): Promise<any>
}
//
}
abstract
class
Puppet
extends
EventEmitter
{
abstract
class
Puppet
extends
EventEmitter
{
public
user
:
Contact
public
user
:
Contact
...
...
src/wechaty.ts
浏览文件 @
4733439c
...
@@ -44,6 +44,16 @@ class Wechaty extends EventEmitter {
...
@@ -44,6 +44,16 @@ class Wechaty extends EventEmitter {
public
uuid
:
string
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
)
{
private
constructor
(
private
setting
:
WechatySetting
)
{
super
()
super
()
log
.
verbose
(
'
Wechaty
'
,
'
contructor()
'
)
log
.
verbose
(
'
Wechaty
'
,
'
contructor()
'
)
...
@@ -72,13 +82,6 @@ class Wechaty extends EventEmitter {
...
@@ -72,13 +82,6 @@ class Wechaty extends EventEmitter {
// Wechaty._instance = this
// 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
toString
()
{
return
'
Class Wechaty(
'
+
this
.
setting
.
type
+
'
)
'
}
public
version
(
forceNpm
=
false
)
{
public
version
(
forceNpm
=
false
)
{
...
...
tsconfig.json
浏览文件 @
4733439c
{
{
"compilerOptions"
:
{
"compilerOptions"
:
{
"target"
:
"es6"
"target"
:
"es6"
,
"module"
:
"amd"
,
"moduleResolution"
:
"node"
,
"moduleResolution"
:
"node"
,
"outDir"
:
"dist"
,
"outDir"
:
"dist"
,
"
noImplicitAny"
:
false
,
"
outFile"
:
"dist/wechaty.lib.js"
,
"strictNullChecks"
:
true
,
"sourceMap"
:
true
,
"sourceMap"
:
true
,
"noUnusedLocals"
:
true
,
"noUnusedParameters"
:
false
,
"strictNullChecks"
:
false
,
"noImplicitAny"
:
false
,
"noImplicitThis"
:
false
,
"noImplicitReturns"
:
false
,
"noFallthroughCasesInSwitch"
:
false
}
}
,
"exclude"
:
[
,
"exclude"
:
[
"node_modules"
"node_modules"
,
"dist"
,
"dist"
,
"**/*.spec.ts"
]
]
,
"
files
"
:
[
,
"
include
"
:
[
"src/*.ts"
"src/*
*/*
.ts"
,
"bin/*.ts"
//
,
"bin/*.ts"
,
"example/*.ts"
//
,
"example/*.ts"
//
,
"test/*.ts"
//
,
"test/*.ts"
]
]
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录