mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
As official demo code shows that the callbacks are wrongly typed.
```
// Callbacks usage example
var clusterize = new Clusterize({
…
callbacks: {
clusterWillChange: function() {},
clusterChanged: function() {},
scrollingProgress: function(progress) {}
}
});
```
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
// Type definitions for clusterize.js 0.17
|
|
// Project: https://github.com/NeXTs/Clusterize.js
|
|
// Definitions by: Pr1st0n <https://github.com/Pr1st0n>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
declare class Clusterize {
|
|
constructor(options: Clusterize.Options);
|
|
|
|
destroy(clean?: boolean): void;
|
|
refresh(force?: boolean): void;
|
|
clear(): void;
|
|
getRowsAmount(): number;
|
|
getScrollProgress(): number;
|
|
update(data?: string[]): void;
|
|
append(rows: string[]): void;
|
|
prepend(rows: string[]): void;
|
|
}
|
|
|
|
declare namespace Clusterize {
|
|
interface Options {
|
|
scrollId: string;
|
|
contentId: string;
|
|
rows?: string[];
|
|
tag?: string;
|
|
rows_in_block?: number;
|
|
blocks_in_cluster?: number;
|
|
show_no_data_row?: boolean;
|
|
no_data_text?: string;
|
|
no_data_class?: string;
|
|
keep_parity?: boolean;
|
|
callbacks?: Callbacks;
|
|
}
|
|
|
|
interface Callbacks {
|
|
clusterWillChange?: () => void;
|
|
clusterChanged?: () => void;
|
|
scrollingProgress?: (progress: number) => void;
|
|
}
|
|
}
|
|
|
|
export = Clusterize;
|