esnet / pond

Immutable timeseries data structures built with Typescript
http://software.es.net/pond
Other
204 stars 38 forks source link

Index.getIndexString parameter definition missed in v0.9.0 #291

Open mjkangquarry opened 1 year ago

mjkangquarry commented 1 year ago

"Expected 0 arguments, but got 2." error occur when I try to run a sample in TSX as follows.

    const requestsSeries = new TimeSeries({
      name: 'requests',
      columns: ['time', 'requests'],
      points: requests.map(([d, value]) => [Index.getIndexString('1h', new Date(d)), value]),,
    })

I found current definition is different with real function parameter.

Current wrong definition: pond/src/index.d.ts

        static getIndexString(): string;

Real function parameter: pond/src/pond/lib/index.js

    static getIndexString(win, date) {

Please revise it as follows:

         static getIndexString(win: string, date: Date): string;