// Type definitions for knockout-paging // Project: https://github.com/ErikSchierboom/knockout-paging // Definitions by: Erik Schierboom // Definitions: https://github.com/borisyankov/DefinitelyTyped /// interface KnockoutStatic { paging: KnockoutPagingOptions; pagedObservableArray(initialValue?: T[], options?: KnockoutPagedOptions): KnockoutPagedObservableArray; } interface KnockoutPagingOptions { defaults: KnockoutPagingDefaultOptions; generators: { [name: string]: KnockoutPageGenerator; 'sliding': KnockoutSlidingPageGenerator } } interface KnockoutPagingDefaultOptions { pageNumber: number; pageSize: number; } interface KnockoutPagedObservableArray extends KnockoutObservableArray { pageSize: KnockoutObservable; pageNumber: KnockoutObservable; pageItems: KnockoutComputed; pageCount: KnockoutComputed; itemCount: KnockoutComputed; firstItemOnPage: KnockoutComputed; lastItemOnPage: KnockoutComputed; hasPreviousPage: KnockoutComputed; hasNextPage: KnockoutComputed; isFirstPage: KnockoutComputed; isLastPage: KnockoutComputed; pages: KnockoutComputed; toNextPage(): void; toPreviousPage(): void; toLastPage(): void; toFirstPage(): void; } interface KnockoutPagedOptions { pageSize?: number; pageNumber?: number; pageGenerator?: string; } interface KnockoutObservableArray { extend(requestedExtenders: { 'paged': any; }): KnockoutPagedObservableArray; } interface KnockoutPageGenerator { generate(pagedObservable: KnockoutPagedObservableArray): number[]; } interface KnockoutSlidingPageGenerator extends KnockoutPageGenerator { windowSize: KnockoutObservable; } interface KnockoutExtenders { paged(target: KnockoutObservableArray, options: KnockoutPagedOptions): KnockoutObservableArray; }