@types/knockout-transformations
TypeScript icon, indicating that this package has built-in type declarations

2.0.33 • Public • Published

Installation

npm install --save @types/knockout-transformations

Summary

This package contains type definitions for knockout-transformations (https://github.com/One-com/knockout-transformations).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/knockout-transformations.

index.d.ts

/// <reference types="knockout" />

declare namespace KnockoutTransformations {
    interface Mapping<T, TResult> {
        (value: T): TResult;
    }
    interface MappingOption<T, TResult> {
        mapping: Mapping<T, TResult>;
        disposeItem?: ((item: TResult) => void) | undefined;
    }
    interface MappingWithDisposeCallbackOption<T, TResult> {
        mappingWithDisposeCallback: (value: T) => {
            mappedValue: TResult;
            dispose: () => void;
        };
    }
}

interface KnockoutObservableArrayFunctions<T> {
    map<TResult>(mapping: KnockoutTransformations.Mapping<T, TResult>): KnockoutObservableArray<TResult>;
    map<TResult>(mapping: KnockoutTransformations.MappingOption<T, TResult>): KnockoutObservableArray<TResult>;
    map<TResult>(
        mapping: KnockoutTransformations.MappingWithDisposeCallbackOption<T, TResult>,
    ): KnockoutObservableArray<TResult>;

    filter(predicate: (value: T) => boolean): KnockoutObservableArray<T>;
    sortBy(sorter: (value: T, descending: (sorter: any) => any) => any): KnockoutObservableArray<T>;
    indexBy(indexer: (value: T) => string): KnockoutObservable<{ [index: string]: T[] }>;
    indexBy(indexer: (value: T) => string[]): KnockoutObservable<{ [index: string]: T[] }>;
    indexBy(indexer: (value: T) => any): KnockoutObservable<any>;
    uniqueIndexBy(indexer: (value: T) => string): KnockoutObservable<{ [index: string]: T }>;
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:38 GMT
  • Dependencies: @types/knockout

Credits

These definitions were written by John Reilly, and Wim Looman.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/knockout-transformations

Weekly Downloads

0

Version

2.0.33

License

MIT

Unpacked Size

5.82 kB

Total Files

5

Last publish

Collaborators

  • types