Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wjy_0214
driver.js
提交
22bd475a
D
driver.js
项目概览
wjy_0214
/
driver.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
driver.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
22bd475a
编写于
3月 18, 2018
作者:
K
Kamran Ahmed
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update types
上级
7bf84553
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
50 addition
and
47 deletion
+50
-47
package.json
package.json
+1
-0
types/index.d.ts
types/index.d.ts
+49
-47
未找到文件。
package.json
浏览文件 @
22bd475a
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
"version"
:
"0.3.2"
,
"version"
:
"0.3.2"
,
"description"
:
"A light-weight, no-dependency, vanilla JavaScript library to drive the user's focus across the page"
,
"description"
:
"A light-weight, no-dependency, vanilla JavaScript library to drive the user's focus across the page"
,
"main"
:
"dist/driver.min.js"
,
"main"
:
"dist/driver.min.js"
,
"types"
:
"types/index.d.ts"
,
"scripts"
:
{
"scripts"
:
{
"start"
:
"node server.js"
,
"start"
:
"node server.js"
,
"build"
:
"webpack --config webpack.config.prod.js"
"build"
:
"webpack --config webpack.config.prod.js"
...
...
types/index.d.ts
.todo
→
types/index.d.ts
浏览文件 @
22bd475a
declare
module
'
driver.js
'
{
declare
module
'
driver.js
'
{
export
class Driver {
class
Driver
{
/**
/**
* Refers to the global document object
* Refers to the global document object
*/
*/
...
@@ -38,38 +38,38 @@ declare module 'driver.js' {
...
@@ -38,38 +38,38 @@ declare module 'driver.js' {
/**
/**
* Does the required bindings for DOM Events
* Does the required bindings for DOM Events
*/
*/
private bind();
private
bind
()
:
void
;
/**
/**
* Listener for the click event, to decide if
* Listener for the click event, to decide if
* to next/previous step, reset the overlay etc
* to next/previous step, reset the overlay etc
* @param {Event} e
* @param {Event} e
*/
*/
private onClick(e: Event);
private
onClick
(
e
:
Event
)
:
void
;
/**
/**
* Refreshes the driver and resets the position for stage
* Refreshes the driver and resets the position for stage
* and popover on resizing the window
* and popover on resizing the window
*/
*/
private onResize();
private
onResize
()
:
void
;
/**
/**
* Makes it operable with keyboard
* Makes it operable with keyboard
* @param {Event} e
* @param {Event} e
*/
*/
private onKeyUp(e: Event);
private
onKeyUp
(
e
:
Event
)
:
void
;
/**
/**
* Moves to the previous step if possible
* Moves to the previous step if possible
* otherwise resets the overlay
* otherwise resets the overlay
*/
*/
public movePrevious();
public
movePrevious
()
:
void
;
/**
/**
* Moves to the next step if possible
* Moves to the next step if possible
* otherwise resets the overlay
* otherwise resets the overlay
*/
*/
public moveNext();
public
moveNext
()
:
void
;
/**
/**
* Checks if can be moved to next step
* Checks if can be moved to next step
...
@@ -86,7 +86,7 @@ declare module 'driver.js' {
...
@@ -86,7 +86,7 @@ declare module 'driver.js' {
/**
/**
* Resets the steps and clears the overlay
* Resets the steps and clears the overlay
*/
*/
public reset();
public
reset
()
:
void
;
/**
/**
* Checks if there is any highlighted element or not
* Checks if there is any highlighted element or not
...
@@ -110,7 +110,7 @@ declare module 'driver.js' {
...
@@ -110,7 +110,7 @@ declare module 'driver.js' {
* Defines the steps to be used in multi-step driver
* Defines the steps to be used in multi-step driver
* @param {Array<Driver.Step>} steps
* @param {Array<Driver.Step>} steps
*/
*/
public defineSteps(steps: Array<Driver.Step>);
public
defineSteps
(
steps
:
Array
<
Driver
.
Step
>
)
:
void
;
/**
/**
* Prepares {Driver.Element} from the given step definition
* Prepares {Driver.Element} from the given step definition
...
@@ -118,19 +118,19 @@ declare module 'driver.js' {
...
@@ -118,19 +118,19 @@ declare module 'driver.js' {
* @param {Array<Driver.Step>} allSteps all the given steps
* @param {Array<Driver.Step>} allSteps all the given steps
* @param {number} stepIndex array index for the current step
* @param {number} stepIndex array index for the current step
*/
*/
private prepareElementFromStep(step: Driver.Step | string, allSteps: Array<Driver.Step>, stepIndex: number);
private
prepareElementFromStep
(
step
:
Driver
.
Step
|
string
,
allSteps
:
Array
<
Driver
.
Step
>
,
stepIndex
:
number
)
:
void
;
/**
/**
* Starts presenting the set steps from the given index
* Starts presenting the set steps from the given index
* @param {number} index
* @param {number} index
*/
*/
public start(index?: number);
public
start
(
index
?:
number
)
:
void
;
/**
/**
* Highlights the given element. Element can be a query selector or a step definition
* Highlights the given element. Element can be a query selector or a step definition
* @param {string | Driver.Step} element
* @param {string | Driver.Step} element
*/
*/
public highlight(element: string | Driver.Step);
public
highlight
(
element
:
string
|
Driver
.
Step
)
:
void
;
}
}
namespace
Driver
{
namespace
Driver
{
...
@@ -214,7 +214,7 @@ declare module 'driver.js' {
...
@@ -214,7 +214,7 @@ declare module 'driver.js' {
/**
/**
* Brings the current DOMElement in view
* Brings the current DOMElement in view
*/
*/
public bringInView();
public
bringInView
()
:
void
;
/**
/**
* Gets the position of element on screen
* Gets the position of element on screen
...
@@ -225,38 +225,38 @@ declare module 'driver.js' {
...
@@ -225,38 +225,38 @@ declare module 'driver.js' {
/**
/**
* Manually scrolls to current element if scrollInToView is not supported
* Manually scrolls to current element if scrollInToView is not supported
*/
*/
private scrollManually();
private
scrollManually
()
:
void
;
/**
/**
* Is called when the current element is deselected
* Is called when the current element is deselected
* @param {boolean} hideStage
* @param {boolean} hideStage
*/
*/
private onDeselected(hideStage?: boolean
= false)
;
private
onDeselected
(
hideStage
?:
boolean
):
void
;
/**
/**
* Is called when element is about to be highlighted
* Is called when element is about to be highlighted
*/
*/
private onHighlightStarted();
private
onHighlightStarted
()
:
void
;
/**
/**
* Is called when element has been successfully highlighted
* Is called when element has been successfully highlighted
*/
*/
private onHighlighted();
private
onHighlighted
()
:
void
;
/**
/**
* Shows the stage on the current element
* Shows the stage on the current element
*/
*/
private showStage();
private
showStage
()
:
void
;
/**
/**
* Hides the popover from the current element if visible
* Hides the popover from the current element if visible
*/
*/
private hidePopover();
private
hidePopover
()
:
void
;
/**
/**
* Shows the popover on current element if possible
* Shows the popover on current element if possible
*/
*/
private showPopover();
private
showPopover
()
:
void
;
/**
/**
* Gets the full page size
* Gets the full page size
...
@@ -267,7 +267,7 @@ declare module 'driver.js' {
...
@@ -267,7 +267,7 @@ declare module 'driver.js' {
* Checks if the current element is same as passed element
* Checks if the current element is same as passed element
* @param {Driver.Element} element
* @param {Driver.Element} element
*/
*/
private isSame(element: Driver.Element);
private
isSame
(
element
:
Driver
.
Element
)
:
void
;
/**
/**
* Gets the node that this element refers to
* Gets the node that this element refers to
...
@@ -316,18 +316,18 @@ declare module 'driver.js' {
...
@@ -316,18 +316,18 @@ declare module 'driver.js' {
/**
/**
* Prepares the DOM element for overlay and appends to body
* Prepares the DOM element for overlay and appends to body
*/
*/
private makeNode();
private
makeNode
()
:
void
;
/**
/**
* Highlights the given Element while resetting the existing one
* Highlights the given Element while resetting the existing one
* @param {Driver.Element} element
* @param {Driver.Element} element
*/
*/
public highlight(element: Driver.Element);
public
highlight
(
element
:
Driver
.
Element
)
:
void
;
/**
/**
* Shows the overlay while appending to body if it is not there already
* Shows the overlay while appending to body if it is not there already
*/
*/
public show();
public
show
()
:
void
;
/**
/**
* Gets the highlighted element in overlay if any
* Gets the highlighted element in overlay if any
...
@@ -346,18 +346,18 @@ declare module 'driver.js' {
...
@@ -346,18 +346,18 @@ declare module 'driver.js' {
* by default or without animation if immediate is set to false
* by default or without animation if immediate is set to false
* @param {boolean} immediate
* @param {boolean} immediate
*/
*/
public clear(immediate
: boolean = false)
;
public
clear
(
immediate
?:
boolean
):
void
;
/**
/**
* Removes the overlay node if it exists
* Removes the overlay node if it exists
*/
*/
private removeNode();
private
removeNode
()
:
void
;
/**
/**
* Refreshes the overlay i.e. sets the size according to current window size
* Refreshes the overlay i.e. sets the size according to current window size
* And moves the highlight around if necessary
* And moves the highlight around if necessary
*/
*/
public refresh();
public
refresh
()
:
void
;
}
}
export
class
Popover
{
export
class
Popover
{
...
@@ -384,58 +384,58 @@ declare module 'driver.js' {
...
@@ -384,58 +384,58 @@ declare module 'driver.js' {
/**
/**
* Prepares the DOM element for popover and appends to the body
* Prepares the DOM element for popover and appends to the body
*/
*/
private makeNode();
private
makeNode
()
:
void
;
/**
/**
* Hides the popover if visible
* Hides the popover if visible
*/
*/
public hide();
public
hide
()
:
void
;
/**
/**
* Sets the initial state for popover before changing position
* Sets the initial state for popover before changing position
*/
*/
private setInitialState();
private
setInitialState
()
:
void
;
/**
/**
* Shows the popover at the given position
* Shows the popover at the given position
* @param {Driver.Position} position
* @param {Driver.Position} position
*/
*/
public show(position: Driver.Position);
public
show
(
position
:
Driver
.
Position
)
:
void
;
/**
/**
* Renders the buttons in the footer of the popover
* Renders the buttons in the footer of the popover
*/
*/
private renderButtons();
private
renderButtons
()
:
void
;
/**
/**
* Positions the popover to the left of the given element position
* Positions the popover to the left of the given element position
* @param {Driver.Position} position
* @param {Driver.Position} position
*/
*/
private positionOnLeft(position: Driver.Position);
private
positionOnLeft
(
position
:
Driver
.
Position
)
:
void
;
/**
/**
* Positions the popover to the right of the given element position
* Positions the popover to the right of the given element position
* @param {Driver.Position} position
* @param {Driver.Position} position
*/
*/
private positionOnRight(position: Driver.Position);
private
positionOnRight
(
position
:
Driver
.
Position
)
:
void
;
/**
/**
* Positions the popover to the top of the given element position
* Positions the popover to the top of the given element position
* @param {Driver.Position} position
* @param {Driver.Position} position
*/
*/
private positionOnTop(position: Driver.Position);
private
positionOnTop
(
position
:
Driver
.
Position
)
:
void
;
/**
/**
* Positions the popover to the bottom of the given element position
* Positions the popover to the bottom of the given element position
* @param {Driver.Position} position
* @param {Driver.Position} position
*/
*/
private positionOnBottom(position: Driver.Position);
private
positionOnBottom
(
position
:
Driver
.
Position
)
:
void
;
/**
/**
* Positions the popover automatically around the element position
* Positions the popover automatically around the element position
* @param {Driver.Position} position
* @param {Driver.Position} position
*/
*/
private autoPosition(position: Driver.Position);
private
autoPosition
(
position
:
Driver
.
Position
)
:
void
;
}
}
export
class
Stage
extends
Element
{
export
class
Stage
extends
Element
{
...
@@ -455,23 +455,23 @@ declare module 'driver.js' {
...
@@ -455,23 +455,23 @@ declare module 'driver.js' {
/**
/**
* Prepares the node and appends to body if not there already
* Prepares the node and appends to body if not there already
*/
*/
private makeNode();
private
makeNode
()
:
void
;
/**
/**
* Hides the stage by removing the node
* Hides the stage by removing the node
*/
*/
public hide();
public
hide
()
:
void
;
/**
/**
* Sets the default properties on the node
* Sets the default properties on the node
*/
*/
private setInitialStyle();
private
setInitialStyle
()
:
void
;
/**
/**
* Shows the stage at provided position
* Shows the stage at provided position
* @param {Driver.Position} position
* @param {Driver.Position} position
*/
*/
public show(position: Driver.Position);
public
show
(
position
:
Driver
.
Position
)
:
void
;
}
}
export
class
Position
{
export
class
Position
{
...
@@ -481,11 +481,11 @@ declare module 'driver.js' {
...
@@ -481,11 +481,11 @@ declare module 'driver.js' {
bottom
:
number
;
bottom
:
number
;
constructor
({
constructor
({
left: number
= 0
,
left
:
number
,
top: number
= 0
,
top
:
number
,
bottom: number
= 0
,
bottom
:
number
,
right: number
= 0
,
right
:
number
,
}
= {}
);
});
/**
/**
* Checks if the given position is valid and can be highlighted
* Checks if the given position is valid and can be highlighted
...
@@ -497,7 +497,7 @@ declare module 'driver.js' {
...
@@ -497,7 +497,7 @@ declare module 'driver.js' {
* Checks if the given position is same as the passed position
* Checks if the given position is same as the passed position
* @param {Driver.Position} position
* @param {Driver.Position} position
*/
*/
equals(position: Driver.Position);
equals
(
position
:
Driver
.
Position
)
:
void
;
}
}
interface
ScreenCoordinates
{
interface
ScreenCoordinates
{
...
@@ -648,4 +648,6 @@ declare module 'driver.js' {
...
@@ -648,4 +648,6 @@ declare module 'driver.js' {
interface
StageOptions
extends
ElementOptions
{
interface
StageOptions
extends
ElementOptions
{
}
}
}
}
export
=
Driver
;
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录