Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add IPageControl interface to winjs.d.ts #1522

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
45 changes: 43 additions & 2 deletions typings/winjs/winjs.d.ts
Expand Up @@ -9124,6 +9124,47 @@ declare module WinJS.UI.Pages {

}

/**
* A PageControl.
**/
interface IPageControl extends IPageControlMembers {
/**
* Gets the DOM element that hosts the PageControl.
**/
element: HTMLElement;
/**
* Gets the Promise that is fulfilled with the element after render method (and the returned promise if exist) is completed.
**/
elementReady: IPromise<HTMLElement>;
/**
* Gets the Promise that is fulfilled with this PageControl object after processed method (and the returned promise if exist) is completed.
**/
renderComplete: IPromise<IPageControl>;
/**
* Gets the Promise that is fulfilled with the element after ready method is finished.
**/
readyComplete: IPromise<IPageControl>;
/**
* Gets the URI for the content that defines this page.
**/
uri: string;
/**
* Gets whether an URI of the document was identical with the URI of this page when the page was constructed.
**/
selfhost: boolean;
/**
* Dispose the page.
**/
dispose(): void;
}

/**
* A constructor that creates a PageControl.
**/
interface IPageControlConstructor {
new (element?: HTMLElement, options?: any, complete?: (page: IPageControl) => void, parentedPromise?: IPromise<any>): IPageControl;
}

//#endregion Interfaces

//#region Objects
Expand All @@ -9138,14 +9179,14 @@ declare module WinJS.UI.Pages {
* @param members An object that defines the members that the control will have.
* @returns A constructor function that creates the PageControl.
**/
function define(uri: string, members: IPageControlMembers): (element?: HTMLElement, options?: any, complete?: (page: any) => void, parentedPromise?: Promise<any>) => void;
function define(uri: string, members: IPageControlMembers): IPageControlConstructor;

/**
* Gets an already-defined page control for the specified URI, or creates a new one.
* @param uri The URI for the content that defines the page.
* @returns A constructor function that creates the page.
**/
function get(uri: string): (element?: HTMLElement, options?: any, complete?: (page: any) => void, parentedPromise?: Promise<any>) => void;
function get(uri: string): IPageControlConstructor;

/**
* Creates a PageControl from the specified URI and inserts it inside the specified element.
Expand Down