Skip to content

Commit

Permalink
feat: checkout from auto-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ZakaryCode authored and iChengbo committed Dec 17, 2019
1 parent b4dab8e commit acb9623
Show file tree
Hide file tree
Showing 30 changed files with 3,471 additions and 2,544 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"bootstrap": "npm-run-all clear-all bootstrap:lerna",
"build": "lerna run build",
"build:docs": "node ./build/docs.js",
"build:docs-api": "ts-node --project ./scripts/tsconfig.json ./scripts/docs-api.ts --verbose",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
"release:lerna": "lerna publish --force-publish=* --exact --skip-temp-tag",
"release:beta": "lerna publish --force-publish=* --exact --skip-temp-tag --preid=beta --npm-tag=beta",
Expand Down
3 changes: 1 addition & 2 deletions packages/taro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
],
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "rollup -c rollup.config.js",
"docs": "ts-node ./scripts/docs-api.ts"
"build": "rollup -c rollup.config.js"
},
"repository": {
"type": "git",
Expand Down
25 changes: 0 additions & 25 deletions packages/taro/scripts/parser/index.ts

This file was deleted.

37 changes: 35 additions & 2 deletions packages/taro/types/api/framework/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,45 @@
declare namespace Taro {
/** 注册小程序中的一个页面。接受一个 `Object` 类型参数,其指定页面的初始数据、生命周期回调、事件处理函数等。 */
interface Page {
/**
* 当前页面的路径
*/
route: string

/** @ignore */
[k: string]: any
}
/** 获取当前页面栈。数组中第一个元素为首页,最后一个元素为当前页面。
* __注意:__
* - __不要尝试修改页面栈,会导致路由以及页面状态错误。__
* - 不要在 `App.onLaunch` 的时候调用 `getCurrentPages()`,此时 `page` 还没有生成。
* @supported weapp, h5
* @example
* ```tsx
* Taro.getCurrentPages().length
* ```
* @see https://developers.weixin.qq.com/miniprogram/dev/reference/api/getCurrentPages.html
*/
function getCurrentPages(): Page[]
function getApp(): any

/** 获取到小程序全局唯一的 App 实例。
* @supported weapp
* @see https://developers.weixin.qq.com/miniprogram/dev/reference/api/getApp.html
*/
function getApp<T = General.IAnyObject>(opts?: getApp.Option): getApp.Instance<T>

namespace getApp {
interface Option {
/** 在 `App` 未定义时返回默认实现。当App被调用时,默认实现中定义的属性会被覆盖合并到App中。一般用于独立分包 */
allowDefault?: boolean
}
type Instance<T extends App> = Option & T
}

/** 注册小程序。接受一个 `Object` 参数,其指定小程序的生命周期回调等。
* @ignore
*/
interface App extends General.IAnyObject {
/** @ignore */
[key: string]: any
}
}
Loading

0 comments on commit acb9623

Please sign in to comment.