Skip to content

Commit

Permalink
fix(types): alipay
Browse files Browse the repository at this point in the history
  • Loading branch information
ZakaryCode committed Nov 7, 2019
1 parent 7713e52 commit da6840b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
14 changes: 14 additions & 0 deletions docs/apis/alipay/getOpenUserInfo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: Taro.getOpenUserInfo()
sidebar_label: getOpenUserInfo
---

此接口可获取支付宝会员的基础信息

> 最低版本: 10.1.35(支付宝小程序)
## 类型

```typescript
() => Promise<string>
```
10 changes: 6 additions & 4 deletions packages/taro/scripts/docs-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,10 @@ export function writeDoc (routepath: string, doc: DocEntry[]) {
''
]
e.documentation && md.push(e.documentation, '')
e.type && md.push('## 类型', '```typescript', e.type, '```', '')
parameters.length && md.push('## 参数')
const since = tags.find(tag => tag.name === 'since')
since && md.push(`> 最低版本: ${since.text || ''}`, '')
e.type && md.push('## 类型', '', '```typescript', e.type, '```', '')
parameters.length && md.push('## 参数', '')
parameters.map(p => {
const arr = p.members || p.exports || []
const hasType = arr.some(v => !!v.type && v.type !== p.name)
Expand Down Expand Up @@ -144,10 +146,10 @@ export function writeDoc (routepath: string, doc: DocEntry[]) {
example && md.push('## 示例代码', '', example.text || '', '')
const supported = tags.find(tag => tag.name === 'supported')
const apis = getAPI(name, supported && supported.text)
apis && md.push('## API 支持度', ...apis,
apis.length > 0 && md.push('## API 支持度', '', ...apis,
'')
const see = tags.find(tag => tag.name === 'see')
see && md.push('', `> [参考文档](${see.text || ''})`, '')
see && md.push(`> [参考文档](${see.text || ''})`, '')
// md.push(JSON.stringify(e, undefined, 2))

fs.writeFileSync(
Expand Down
2 changes: 1 addition & 1 deletion packages/taro/types/api/alipay/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
declare namespace Taro {
/**
* 此接口可获取支付宝会员的基础信息
* @since 10.1.35
* @since 10.1.35(支付宝小程序)
*/
function getOpenUserInfo(): Promise<string>
}

0 comments on commit da6840b

Please sign in to comment.