Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Commit

Permalink
Update and/or configure type declarations. (#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
aomarks authored Feb 17, 2018
1 parent 0a472b3 commit 72ebd02
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 79 deletions.
14 changes: 7 additions & 7 deletions iron-overlay-backdrop.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,29 +31,29 @@ interface IronOverlayBackdropElement extends Polymer.Element {
* Returns true if the backdrop is opened.
*/
opened: boolean|null|undefined;
created(): any;
attached(): any;
created(): void;
attached(): void;

/**
* Appends the backdrop to document body if needed.
*/
prepare(): any;
prepare(): void;

/**
* Shows the backdrop.
*/
open(): any;
open(): void;

/**
* Hides the backdrop.
*/
close(): any;
close(): void;

/**
* Removes the backdrop from document body if needed.
*/
complete(): any;
_onTransitionend(event: any): any;
complete(): void;
_onTransitionend(event: any): void;
}

interface HTMLElementTagNameMap {
Expand Down
56 changes: 28 additions & 28 deletions iron-overlay-behavior.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ declare namespace Polymer {
/**
* The backdrop element.
*/
backdropElement(): Element;
readonly backdropElement: Element;

/**
* Returns the node to give focus to.
*/
_focusNode(): Node;
readonly _focusNode: Node;

/**
* Array of nodes that can receive focus (overlay included), ordered by `tabindex`.
Expand All @@ -107,110 +107,110 @@ declare namespace Polymer {
* If you know what is your content (specifically the first and last focusable children),
* you can override this method to return only `[firstFocusable, lastFocusable];`
*/
_focusableNodes(): Node[];
readonly _focusableNodes: Node[];
ready(): void;
attached(): any;
detached(): any;
attached(): void;
detached(): void;

/**
* Toggle the opened state of the overlay.
*/
toggle(): any;
toggle(): void;

/**
* Open the overlay.
*/
open(): any;
open(): void;

/**
* Close the overlay.
*/
close(): any;
close(): void;

/**
* Cancels the overlay.
*
* @param event The original event
*/
cancel(event?: Event|null): any;
cancel(event?: Event|null): void;

/**
* Invalidates the cached tabbable nodes. To be called when any of the focusable
* content changes (e.g. a button is disabled).
*/
invalidateTabbables(): any;
_ensureSetup(): any;
invalidateTabbables(): void;
_ensureSetup(): void;

/**
* Called when `opened` changes.
*/
_openedChanged(opened?: boolean): any;
_canceledChanged(): any;
_withBackdropChanged(): any;
_openedChanged(opened?: boolean): void;
_canceledChanged(): void;
_withBackdropChanged(): void;

/**
* tasks which must occur before opening; e.g. making the element visible.
*/
_prepareRenderOpened(): any;
_prepareRenderOpened(): void;

/**
* Tasks which cause the overlay to actually open; typically play an animation.
*/
_renderOpened(): any;
_renderOpened(): void;

/**
* Tasks which cause the overlay to actually close; typically play an animation.
*/
_renderClosed(): any;
_renderClosed(): void;

/**
* Tasks to be performed at the end of open action. Will fire `iron-overlay-opened`.
*/
_finishRenderOpened(): any;
_finishRenderOpened(): void;

/**
* Tasks to be performed at the end of close action. Will fire `iron-overlay-closed`.
*/
_finishRenderClosed(): any;
_preparePositioning(): any;
_finishPositioning(): any;
_finishRenderClosed(): void;
_preparePositioning(): void;
_finishPositioning(): void;

/**
* Applies focus according to the opened state.
*/
_applyFocus(): any;
_applyFocus(): void;

/**
* Cancels (closes) the overlay. Call when click happens outside the overlay.
*/
_onCaptureClick(event: Event): any;
_onCaptureClick(event: Event): void;

/**
* Keeps track of the focused child. If withBackdrop, traps focus within overlay.
*/
_onCaptureFocus(event: Event): any;
_onCaptureFocus(event: Event): void;

/**
* Handles the ESC key event and cancels (closes) the overlay.
*/
_onCaptureEsc(event: Event): any;
_onCaptureEsc(event: Event): void;

/**
* Handles TAB key events to track focus changes.
* Will wrap focus for overlays withBackdrop.
*/
_onCaptureTab(event: Event): any;
_onCaptureTab(event: Event): void;

/**
* Refits if the overlay is opened and not animating.
*/
_onIronResize(): any;
_onIronResize(): void;

/**
* Will call notifyResize if overlay is opened.
* Can be overridden in order to avoid multiple observers on the same node.
*/
_onNodesChange(): any;
_onNodesChange(): void;
}

const IronOverlayBehaviorImpl: object;
Expand Down
4 changes: 2 additions & 2 deletions iron-scroll-manager.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ declare namespace Polymer {
* Scroll locking is implemented as a stack so that cases such as
* dropdowns within dropdowns are handled well.
*/
function pushScrollLock(element: HTMLElement): any;
function pushScrollLock(element: HTMLElement): void;


/**
Expand All @@ -44,6 +44,6 @@ declare namespace Polymer {
* the scroll lock constraints only change when the most recently pushed
* element is removed.
*/
function removeScrollLock(element: HTMLElement): any;
function removeScrollLock(element: HTMLElement): void;
}
}
72 changes: 31 additions & 41 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"license": "BSD-3-Clause",
"devDependencies": {
"@polymer/gen-typescript-declarations": "^1.1.1",
"@polymer/gen-typescript-declarations": "^1.2.0",
"bower": "^1.8.0"
},
"scripts": {
Expand Down

0 comments on commit 72ebd02

Please sign in to comment.