mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Note that this *trivially* updates project urls by adding the NPM url to the end, even when the urls are almost identical or the DT one is outdated. I'll clean up the urls in a later commit. This PR is unfinished! Please do not merge it yet.
68 lines
1.8 KiB
TypeScript
68 lines
1.8 KiB
TypeScript
// Type definitions for Masonry 4.2
|
|
// Project: https://github.com/desandro/masonry, https://masonry.desandro.com
|
|
// Definitions by: Mark Wilson <https://github.com/m-a-wilson>, Travis Brown <https://github.com/warriorrocker>
|
|
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
|
// TypeScript Version: 2.3
|
|
|
|
/// <reference types="jquery" />
|
|
|
|
export = Masonry;
|
|
|
|
declare class Masonry {
|
|
constructor(options?: Masonry.Options);
|
|
constructor(selector: string | Element, options?: Masonry.Options);
|
|
|
|
masonry?(): void;
|
|
masonry?(eventName: string, listener: any): void;
|
|
|
|
// layout
|
|
layout?(): void;
|
|
layoutItems?(items: any[], isStill?: boolean): void;
|
|
stamp?(elements: any[]): void;
|
|
unstamp?(elements: any[]): void;
|
|
|
|
// add and remove items
|
|
appended?(elements: any[]): void;
|
|
prepended?(elements: any[]): void;
|
|
addItems?(elements: any[]): void;
|
|
remove?(elements: any[]): void;
|
|
|
|
// events
|
|
on?(eventName: string, listener: any): void;
|
|
off?(eventName: string, listener: any): void;
|
|
once?(eventName: string, listener: any): void;
|
|
|
|
// utilities
|
|
reloadItems?(): void;
|
|
destroy?(): void;
|
|
getItemElements?(): any[];
|
|
data?(element: Element): Masonry;
|
|
}
|
|
|
|
declare namespace Masonry {
|
|
interface Options {
|
|
// layout
|
|
itemSelector?: string;
|
|
columnWidth?: any;
|
|
percentPosition?: boolean;
|
|
gutter?: any;
|
|
stamp?: string;
|
|
fitWidth?: boolean;
|
|
originLeft?: boolean;
|
|
originTop?: boolean;
|
|
horizontalOrder?: boolean;
|
|
|
|
// setup
|
|
containerStyle?: {};
|
|
transitionDuration?: any;
|
|
resize?: boolean;
|
|
initLayout?: boolean;
|
|
}
|
|
}
|
|
|
|
declare global {
|
|
interface JQuery {
|
|
masonry(options?: Masonry.Options): JQuery;
|
|
}
|
|
}
|