diff --git a/iscroll/iscroll-lite.d.ts b/iscroll/iscroll-lite.d.ts index c01f5db47..085f844b0 100644 --- a/iscroll/iscroll-lite.d.ts +++ b/iscroll/iscroll-lite.d.ts @@ -34,8 +34,8 @@ interface iScrollOptions { declare class iScroll { - constructor (element: string); - constructor (element: string, options: iScrollOptions); + constructor (element: string, options?: iScrollOptions); + constructor (element: HTMLElement, options?: iScrollOptions); destroy(): void; refresh(): void; diff --git a/iscroll/iscroll-tests.ts b/iscroll/iscroll-tests.ts index 9edefab34..4938a609b 100644 --- a/iscroll/iscroll-tests.ts +++ b/iscroll/iscroll-tests.ts @@ -16,4 +16,8 @@ var myScroll4 = new iScroll('wrapper', { }); var myScroll6 = new iScroll('wrapper', { scrollbarClass: 'myScrollbar' }); -myScroll1.refresh(); \ No newline at end of file +myScroll1.refresh(); + + +var myScroll6 = new iScroll(document.getElementById('wrapper')); +var myScroll7 = new iScroll(document.getElementById('wrapper'), { scrollbarClass: 'myScrollbar' }); \ No newline at end of file diff --git a/iscroll/iscroll.d.ts b/iscroll/iscroll.d.ts index a702ebb5e..4c89038ed 100644 --- a/iscroll/iscroll.d.ts +++ b/iscroll/iscroll.d.ts @@ -59,8 +59,8 @@ interface iScrollOptions { declare class iScroll { - constructor (element: string); - constructor (element: string, options: iScrollOptions); + constructor (element: string, options?: iScrollOptions); + constructor (element: HTMLElement, options?: iScrollOptions); destroy(): void; refresh(): void;