Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript types #11

Open
tremby opened this issue Feb 10, 2022 · 1 comment
Open

Typescript types #11

tremby opened this issue Feb 10, 2022 · 1 comment

Comments

@tremby
Copy link

tremby commented Feb 10, 2022

I'm no expert, and there may be problems with this, but here's what I'm using. It might be a starting point.

type FlexMasonryOptions = {
  responsive?: boolean;
  breakpointCols?: {
    [key: string]: number;
  },
  numCols?: number;
};

declare module 'flexmasonry' {
  function init(targets: string | NodeList, options?: FlexMasonryOptions): this;
  function refresh(target: Element, options?: FlexMasonryOptions): this;
  function refreshAll(options?: FlexMasonryOptions): this;
  function destroyAll(): void;
};
@tremby
Copy link
Author

tremby commented Feb 10, 2022

Actually it doesn't seem to be ES6-compatible in the dist version. So I'm declaring and importing flexmasonry/src/flexmasonry.js instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant