Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Maiz committed Jun 30, 2019
2 parents d1553b7 + 4840a8f commit 1b26c6a
Show file tree
Hide file tree
Showing 14 changed files with 458 additions and 60 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
English | [简体中文](./CHANGELOG_CN.md)

#### V3.3.1 (2019-06-30)

- [FEATURE] Add TypeScript definition file. (by by @jas0ncn)
- [FIX] Fix switch button position issue. (by @rexschuang)
- [FIX] Avoid scrolling to bottom when away from bottom edge. (by @ele828)
- [FIX] Fix a few minor issues. (by @stenders)


#### V3.3.0 (2019-02-02)

- [FEATURE] Add the ability to collapse the same log.
Expand Down
10 changes: 9 additions & 1 deletion CHANGELOG_CN.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
[English](./CHANGELOG.md) | 简体中文

#### V3.3.1 (2019-06-30)

- 【特性】增加 TypeScript 声明文件。(by @jas0ncn
- 【修复】修复开关按钮拖动后位置不对的问题。(by @rexschuang
- 【修复】不在列表底部时避免自动滚动。(by @ele828
- 【修复】修复若干小问题。(by @stenders


#### V3.3.0 (2019-02-02)

-特效】新增自动合并相同日志的能力。频繁输出相同日志时不再会被刷屏。
-特性】新增自动合并相同日志的能力。频繁输出相同日志时不再会被刷屏。
- 【修复】修复格式化日志(如 `console.log('[foo]', 'bar')`)无法显示到 Log 面板的问题。


Expand Down
115 changes: 115 additions & 0 deletions dist/vconsole.min.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
/**
* VConsole type definitions
* @see https://github.com/Tencent/vConsole
*/

declare module 'vconsole' {
// VConsole configs
export interface VConsoleConfig {
defaultPlugins?: string[]
onReady?: () => void
onClearLog?: () => void
maxLogNumber?: number
disableLogScrolling?: boolean
}

/**
* VConsole
* @see https://github.com/Tencent/vConsole/blob/dev/doc/public_properties_methods.md
*/
export class VConsoleInstance {
constructor (config?: VConsoleConfig)

// properties
readonly version: string
option: VConsoleConfig
readonly activedTab: string
readonly tabList: string[]
readonly $dom: HTMLDivElement

// methods
setOption (config: VConsoleConfig): void;
setOption <TKey extends keyof VConsoleConfig>(key: TKey, value: VConsoleConfig[TKey]): void
destroy (): void
addPlugin (plugin: VConsolePluginInstance): boolean
removePlugin (pluginId: string): boolean
showTab (pluginId: string): void
show (): void
hide (): void
showSwitch (): void
hideSwitch (): void
}

/**
* VConsole Plugin Event List
* @see https://github.com/Tencent/vConsole/blob/dev/doc/plugin_event_list.md
*/
export interface VConsolePluginEventMap {
init (): void

renderTab (
callback: <AnyElement extends { appendTo: () => void }>(html: string | HTMLElement | AnyElement) => void
): void

addTopBar (
callback: (
btnList: {
name: string
data?: { [key: string]: string | number }
className?: string
onClick (e: MouseEvent | TouchEvent): void | boolean
}[]
) => void
): void

addTool (
callback: (
toolList: {
name: string
global?: boolean
onClick (e: MouseEvent | TouchEvent): void | boolean
}[]
) => void
): void

ready (): void

remove (): void

show (): void

hide (): void

showConsole (): void

hideConsole (): void

updateOption (): void
}

/**
* VConsole Plugin
* @see https://github.com/Tencent/vConsole/blob/dev/doc/plugin_getting_started.md
*/
export class VConsolePluginInstance {
constructor (id: string, name?: string)

// properties
id: string
name: string
vConsole: VConsoleInstance

// methods
on<EventName extends keyof VConsolePluginEventMap> (
eventName: EventName,
callback: VConsolePluginEventMap[EventName]
): VConsolePluginInstance
trigger<T = any> (eventName: keyof VConsolePluginEventMap, data: T): VConsolePluginInstance
}

export class VConsole extends VConsoleInstance {
static VConsolePlugin: VConsolePluginInstance
}

export default VConsole
}
4 changes: 2 additions & 2 deletions dist/vconsole.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion doc/plugin_event_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ myPlugin.on('show', function() {
```


## Hide
## hide

Trigger when a tab is hidden. Only the plugin binded with `renderTab` will receive this event.

Expand Down
2 changes: 1 addition & 1 deletion doc/plugin_event_list_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ myPlugin.on('show', function() {
```


## Hide
## hide

当插件的 tab 被隐藏时触发。只有绑定了 `renderTab` 事件的插件才会收到此事件。

Expand Down
Loading

0 comments on commit 1b26c6a

Please sign in to comment.