replace internal module to namespace

This commit is contained in:
vvakame
2016-03-17 02:18:10 +09:00
parent 2f47c75835
commit 14fe4313f4
1139 changed files with 179639 additions and 179639 deletions
+98 -98
View File
@@ -22,17 +22,17 @@ interface JQueryStatic {
dynatableSetup(options: JQueryDynatable.Options): void;
}
declare module JQueryDynatable {
declare namespace JQueryDynatable {
interface Features {
/**
* Enable the pagination feature
*
*
* @default true
*/
paginate?: boolean;
/**
* Enable the sorting feature
*
*
* @default true
*/
sort?: boolean;
@@ -45,7 +45,7 @@ declare module JQueryDynatable {
pushState?: boolean;
/**
* Enable the search feature
*
*
* @default true
*/
search?: boolean;
@@ -59,7 +59,7 @@ declare module JQueryDynatable {
/**
* Enable the perPageSelect feature
* The perPageSelect will insert a form control filled with the options from `perPageOptions`
*
*
* @default true
*/
perPageSelect?: boolean;
@@ -67,8 +67,8 @@ declare module JQueryDynatable {
interface Column {
index: number;
label: string;
/**
* Determined by the `data-dynatable-column` or using the `defaultColumnIdStyle`
/**
* Determined by the `data-dynatable-column` or using the `defaultColumnIdStyle`
*
* @example
* // Using the `defaultColumnIdStyle` of `camelCase`
@@ -80,7 +80,7 @@ declare module JQueryDynatable {
*
* @param record A data object representing the current line of data
* @return The data for the current cell
*
*
* @example
* function exampleAttributeWriter(record) {
* return record[this.id];
@@ -93,7 +93,7 @@ declare module JQueryDynatable {
* @param cell A html node of the target cell
* @param record A data object representing the current line of data
* @return the html content for the current cell
*
*
* @example
* function exampleAttributeReader(cell, record) {
* return $(cell).html();
@@ -132,19 +132,19 @@ declare module JQueryDynatable {
columns?: Array<JQueryDynatable.Column>;
/**
* Selector used by dynatable in order to find the table header row
*
*
* @default 'thead tr'
*/
headRowSelector?: string;
/**
* Selector used by dynatable in order to find the table body rows
*
*
* @default 'tbody tr'
*/
bodyRowSelector?: string;
/**
* Optional classname that can be added by dynatable to the header cells
*
*
* @default null
*/
headRowClass?: string;
@@ -158,7 +158,7 @@ declare module JQueryDynatable {
*
* @default null
* @see http://www.dynatable.com/#querying
*
*
* @example
* $('#search-year')
*/
@@ -191,7 +191,7 @@ declare module JQueryDynatable {
* The jQuery object pointing to a target where to insert the recordCount html
*
* @default null
*
*
* @example
* $('#chart-status-text')
*/
@@ -257,13 +257,13 @@ declare module JQueryDynatable {
paginationDisabledClass?: string;
/**
* Text content for the previous page link
*
*
* @default 'Previous'
*/
paginationPrev?: string;
/**
* Text content for the next page link
*
*
* @default 'Next'
*/
paginationNext?: string;
@@ -311,61 +311,61 @@ declare module JQueryDynatable {
perPagePlacement?: string;
/**
* Text content preceding the items per page <select>
*
*
* @default 'Show: '
*/
perPageText?: string;
/**
* Text content introducing the pagination
*
*
* @default 'Pages: '
*/
pageText?: string;
/**
* Text content used inside the recordsCount
*
*
* @default '{pageLowerBound} to {pageUpperBound} of'
*/
recordCountPageBoundTemplate?: string;
/**
* Text content used inside the recordsCount
*
*
* @default '{recordsShown} of'
*/
recordCountPageUnboundedTemplate?: string;
/**
* Text content used inside the recordsCount
*
*
* @default '{recordsQueryCount} {collectionName}'
*/
recordCountTotalTemplate?: string;
/**
* Text content used inside the recordsCount
*
*
* @default ' (filtered from {recordsTotal} total records)'
*/
recordCountFilteredTemplate?: string;
/**
* Text content used inside the recordsCount
*
*
* @default 'Showing '
*/
recordCountText?: string;
/**
* Text content used inside the recordsCount
*
*
* @default '{text} {pageTemplate} {totalTemplate} {filteredTemplate}'
*/
recordCountTextTemplate?: string;
/**
* Text content used inside the recordsCount
*
*
* @default '<span id="dynatable-record-count-{elementId}" class="dynatable-record-count">{textTemplate}</span>'
*/
recordCountTemplate?: string;
/**
* Text content injected inside the processingIndicator
*
*
* @default 'Processing...'
*/
processingText?: string;
@@ -373,106 +373,106 @@ declare module JQueryDynatable {
interface Dataset {
/**
* Enable the `ajax` mode
*
*
* @default false
*/
ajax?: boolean;
/**
* A string containing the URL to which the request is sent.
*
*
* @default null
*/
ajaxUrl?: string;
/**
* Defining the `cache` setting for the jQuery's ajax call...
* true or false for dataType 'script' and 'jsonp'
*
*
* @default null
* @see http://api.jquery.com/jQuery.ajax
*/
ajaxCache?: boolean;
/**
* Send the ajax request automatically
*
*
* @default false
*/
ajaxOnLoad?: boolean;
/**
* Defining the `method` setting for the jQuery's ajax call...
* The HTTP method to use for the request (e.g. "POST", "GET", "PUT").
*
* The HTTP method to use for the request (e.g. "POST", "GET", "PUT").
*
* @enum('GET', 'POST')
* @default 'GET'
* @todo Check if other methods could be used... ('GET', 'PUT', 'HEAD', 'POST', 'PATCH', 'TRACE', 'DELETE', 'CONNECT', 'OPTIONS', 'IS_AWARE', 'IS_EAGER', 'PROPFIND', 'IS_OPTIONAL', 'IS_REQUIRED', 'IS_CONSTRUCTOR', 'IS_INSTANTIATOR')
*/
ajaxMethod?: string;
/**
* The type of data that you're expecting back from the server.
* The type of data that you're expecting back from the server.
* If none is specified, jQuery will try to infer it based on the MIME type of the response...
*
*
* @enum('xml', 'html', 'script', 'json', 'jsonp', 'text')
* @default 'json'
* @see http://api.jquery.com/jQuery.ajax
*/
ajaxDataType?: string;
/**
* Name of the property in the dataset that contains the total number of records
*
* Name of the property in the dataset that contains the total number of records
*
* @default null
*/
totalRecordCount?: string;
/**
* Object describing the current request's filtering
*
*
* @default {}
*/
queries?: Object;
/**
* Name of the property in the dataset that contains the total number of records for the current query
*
*
* @default null
*/
queryRecordCount?: string;
/**
* The page represented in the for the current dataset
*
*
* @default null
*/
page?: number;
/**
* The default number of items loaded per page
*
*
* @default 10
*/
perPageDefault?: number;
/**
* The default options available in the perPage menu built by dynatable
*
*
* @default [10,20,50,100]
*/
perPageOptions?: Array<number>;
/**
* Object describing the current request's sorting
*
*
* @default {}
*/
sorts?: Object;
/**
* The sorting keys (generated by dynatable)
*
*
* @default null
*/
sortsKeys?: Array<string>;
/**
* The sorting types (generated by dynatable)
* It will hosts the type of object to sort (string, number, etc.)
*
*
* @default {}
*/
sortTypes?: Object;
/**
* The core data (generated or loaded by dynatable)
*
*
* @default null
*/
records?: any;
@@ -488,7 +488,7 @@ declare module JQueryDynatable {
* @return the data for the current cell
*
* @default defaultRowWriter
*
*
* @example
* function exampleRowWriter(rowIndex, record, columns, cellWriter) {
* var tr = '';
@@ -508,28 +508,28 @@ declare module JQueryDynatable {
* @return the data for the current cell
*
* @default defaultCellWriter
*
*
* @example
* function exampleCellWriter(column, record) {
* var html = column.attributeWriter(record),
* td = '<td';
*
*
* if (column.hidden || column.textAlign) {
* td += ' style="';
*
*
* // keep cells for hidden column headers hidden
* if (column.hidden) {
* td += 'display: none;';
* }
*
*
* // keep cells aligned as their column headers are aligned
* if (column.textAlign) {
* td += 'text-align: ' + column.textAlign + ';';
* }
*
*
* td += '"';
* }
*
*
* return td + '>' + html + '</td>';
* };
*/
@@ -539,7 +539,7 @@ declare module JQueryDynatable {
*
* @param record A data object representing the current line of data
* @return the data for the current cell
*
*
* @default defaultAttributeWriter
*
* @example
@@ -555,12 +555,12 @@ declare module JQueryDynatable {
* Function that interprets the row into data
*
* @param index The index of the current row (from 0 to the perPage value)
* @param thisRef
* @param thisRef
* @param record
* @return the data for the current row
*
*
* @default null
*
*
* @example
* function exampleRowReader(index, this, record) {
* //...
@@ -573,9 +573,9 @@ declare module JQueryDynatable {
* @param cell A html node of the target cell
* @param record A data object representing the current line of data
* @return the data for the current cell
*
*
* @default defaultAttributeReader
*
*
* @example
* function exampleAttributeReader(cell, record) {
* return $(cell).html();
@@ -667,14 +667,14 @@ declare module JQueryDynatable {
generate($cell?: JQuery): JQuery;
/**
* Parse the table header row, analyse its cells and save the columns.
*
*
* @return Could return an `$.error()` if nothing is found.
*/
getFromTable(): void|JQuery;
/** Initializes `settings.table.columns` array and calls `getFromTable()` */
init(): void;
/**
* Check if the `$element` is valid (if it is a `table`)
/**
* Check if the `$element` is valid (if it is a `table`)
*
* @return A boolean
*/
@@ -709,9 +709,9 @@ declare module JQueryDynatable {
create(): JQuery;
/** Call the `attach()` method */
init(): void;
/**
/**
* Check if the search feature is enabled in `settings.features`
*
*
* @return A boolean
*/
initOnLoad(): boolean;
@@ -721,7 +721,7 @@ declare module JQueryDynatable {
attach(): void;
/**
* Generate a string containing the html of a pagination link
*
*
* @param page The page number
* @param label The text of the link (could be Previous, Next or a number)
* @param linkClass The classname for the `<a>`
@@ -730,7 +730,7 @@ declare module JQueryDynatable {
* @return A string containing html markup
*/
buildLink(page: number, label: string|number, linkClass: string, conditional: boolean, conditionalClass: string): string;
/**
/**
* Build the `<ul>` and creates the event listeners
*
* @return A string containing html markup
@@ -738,9 +738,9 @@ declare module JQueryDynatable {
create(): string;
/** Call the attach method */
init(): void;
/**
/**
* Check if the paginate feature is enabled in `settings.features`
*
*
* @return A boolean
*/
initOnLoad(): boolean;
@@ -748,15 +748,15 @@ declare module JQueryDynatable {
interface PaginationPage {
/** Parse the current window.location in order to determine the target page */
init(): void;
/**
/**
* Check if the paginate feature is enabled in `settings.features`
*
*
* @return A boolean
*/
initOnLoad(): boolean;
/**
/**
* Set the page in the dataset
*
*
* @param page The new page number
*/
set(page: number): void;
@@ -772,9 +772,9 @@ declare module JQueryDynatable {
create(): JQuery;
/** Set up the pagination per page */
init(): void;
/**
/**
* Check if the paginate feature is enabled in `settings.features`
*
*
* @return A boolean
*/
initOnLoad(): boolean;
@@ -811,7 +811,7 @@ declare module JQueryDynatable {
interface Queries {
/**
* Add a new condition in the queries
*
*
* @param name The key for for the query
* @param value The value we wish to find
* @return A reference to the related Dynatable object
@@ -823,20 +823,20 @@ declare module JQueryDynatable {
init(): void;
/**
* Check if search feature is enabled
*
*
* @return A boolean if search feature is enabled
*/
initOnLoad(): boolean;
/**
* Remove the query from the dataset
*
*
* @param name The key for for the query to be removed
* @return A reference to the related Dynatable object
*/
remove(name: string): Dynatable;
/** Run a search with all the saved queries */
run(): any;
/**
/**
* Shortcut for performing simple query from built-in search
*
* @param q The value that will be searched for
@@ -848,7 +848,7 @@ declare module JQueryDynatable {
interface QueriesFunctions {
/**
* Search in all of the properties of the provided single record
*
*
* @param record A data object with all the properties of the current line
* @param queryValue The researched value
* @return A boolean indicating if a match was found
@@ -874,7 +874,7 @@ declare module JQueryDynatable {
init(): void;
/**
* Check if ajax feature is enabled
*
*
* @return A boolean if ajax feature is enabled
*/
initOnLoad(): boolean;
@@ -890,13 +890,13 @@ declare module JQueryDynatable {
resetOriginal(): void;
/**
* Call the appropriated sort function
*
*
* @return The number (-1, 0 or +1) representing the comparison
*/
sort(): number;
/**
* Merge ajax response json with cached data including (meta-data and records)
*
*
* @param data The new data
*/
updateFromJson(data: any): void;
@@ -914,7 +914,7 @@ declare module JQueryDynatable {
init(): void;
/**
* Check if recordCount feature is enabled
*
*
* @return A boolean if recordCount feature is enabled
*/
initOnLoad(): boolean;
@@ -931,7 +931,7 @@ declare module JQueryDynatable {
interface Sorts {
/**
* Add a new sort in sortKeys
*
*
* @param attr The key for for the sorting
* @param direction The sorting direction (-1 or +1)
* @return A reference to the related Dynatable object
@@ -943,7 +943,7 @@ declare module JQueryDynatable {
functions: SortsFunctions;
/**
* Try to intelligently guess which sort function to use based on the type of attribute values.
*
*
* @param a The first record
* @param b The second record
* @param attr The key of the property
@@ -954,13 +954,13 @@ declare module JQueryDynatable {
init(): void;
/**
* Check if sort feature is enabled
*
*
* @return A boolean if sort feature is enabled
*/
initOnLoad(): boolean;
/**
* Remove a sort attribute from the sortKeys
*
*
* @param attr The key to be removed from the sorting
* @return A reference to the related Dynatable object
*/
@@ -969,7 +969,7 @@ declare module JQueryDynatable {
interface SortsFunctions {
/**
* Sorting between 2 numbers
*
*
* @param a The first record
* @param b The second record
* @param attr The key of the property
@@ -979,7 +979,7 @@ declare module JQueryDynatable {
number(a: any, b: any, attr: string, direction: number): number;
/**
* Restores the original order we had...
*
*
* @param a The first record
* @param b The second record
* @return The number (-1, 0 or +1) representing the comparison
@@ -987,7 +987,7 @@ declare module JQueryDynatable {
originalPlacement(a: any, b: any): number;
/**
* Sorting between 2 strings
*
*
* @param a The first record
* @param b The second record
* @param attr The key of the property
@@ -1028,7 +1028,7 @@ declare module JQueryDynatable {
init(): void;
/**
* Check if sort feature is enabled
*
*
* @return A boolean if sort feature is enabled
*/
initOnLoad(): boolean;
@@ -1036,20 +1036,20 @@ declare module JQueryDynatable {
removeAll(): void;
/** Remove all arrows Elements from the table */
removeAllArrows(): void;
/**
* Remove the arrow found inside the provided $link
/**
* Remove the arrow found inside the provided $link
*
* @param $link The jQuery object containing the `<a>` markup in the sortable headers
*/
removeArrow($link: JQuery): void;
/**
/**
* Remove the link generated by dynatable inside the sortable header
* and restore its original html content
*
* @param cell The cell Element that will be parsed
*/
removeOne(cell: Element): void;
/**
/**
* @todo learn more about this method and document it
*
* @param $link The jQuery object to be used
@@ -1057,14 +1057,14 @@ declare module JQueryDynatable {
* @return A boolean which is true if supplied test function passes for ALL items in an array
*/
sortedByColumn($link: JQuery, column: Column): boolean;
/**
/**
* Inspect the settings to determine the order to use
*
* @param column The Column object that will be used
* @return A number (-1 or +1) describing the order to use (DESC or ASC)
*/
sortedByColumnValue(column: Column): number;
/**
/**
* Refresh the [multi] sorting of the dataset
*
* @param $e The event object (of the click on the table sortable header)
@@ -1092,7 +1092,7 @@ declare module JQueryDynatable {
* Update the URL data using pushState
*
* @param data An object with the parameters we want to push
*/
*/
push(data: Object): void;
}
interface Dynatable {
@@ -1105,7 +1105,7 @@ declare module JQueryDynatable {
/**
* Each dynatable instance inherits from this,
* set properties specific to instance
*
*
* @param element The html node to be used by dynatable
* @param options The JQueryDynatable.Options object which contains all the settings
* @return A reference to the current and brand new dynatable object