Interface IPageControlMembers

Provides members for a PageControl. You implement this interface when defining a new PageControl.

Index

Methods

Methods

optional public error(err: any): Promise

Called if any error occurs during the processing of the page.

Parameters

  • err: any

    The error that occurred.

Returns

Promise

Nothing if the error was handled, or an error promise if the error was not handled.

optional public init(element: HTMLElement, options: any): Promise

Initializes the control before the content of the control is set. Use the processed method for any initialization that should be done after the content of the control has been set.

Parameters

  • element: HTMLElement

    The DOM element that will contain all the content for the page.

  • options: any

    The options passed to the constructor of the page.

Returns

Promise

A promise that is fulfilled when initialization is complete, if asynchronous processing is necessary. If not, returns nothing.

optional public load(uri: string): Promise

Creates DOM objects from the content in the specified URI. This method is called after the PageControl is defined and before the init method is called.

Parameters

  • uri: string

    The URI from which to create DOM objects.

Returns

Promise

A promise whose fulfilled value is the set of unparented DOM objects.

optional public processed(element: HTMLElement, options: any): Promise

Initializes the control after the content of the control is set.

Parameters

  • element: HTMLElement

    The DOM element that will contain all the content for the page.

  • options: any

    The options that are to be passed to the constructor of the page.

Returns

Promise

A promise that is fulfilled when initialization is complete, if asynchronous processing is necessary. If not, returns nothing.

optional public ready(element: HTMLElement, options: any): Promise

Called after all initialization and rendering is complete. At this time, the element is ready for use.

Parameters

  • element: HTMLElement

    The DOM element that contains all the content for the page.

  • options: any

    An object that contains one or more property/value pairs to apply to the PageControl. How these property/value pairs are used (or not used) depends on the implementation of that particular PageControl.

Returns

Promise

A promise that is fulfilled when the element is ready for use, if asynchronous processing is necessary. If not, returns nothing.

optional public render(element: HTMLElement, options: any, loadResult: Promise)

Takes the elements returned by the load method and attaches them to the specified element.

Parameters

  • element: HTMLElement

    The DOM element to which the loadResult elements are appended.

  • options: any

    An object that contains one or more property/value pairs to apply to the PageControl. How these property/value pairs are used (or not used) depends on the implementation of that particular PageControl.

  • loadResult: Promise

    A Promise that contains the elements returned from the load method.