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 definition #14

Open
wants to merge 1 commit into
base: dist
Choose a base branch
from

Conversation

romain-preston
Copy link

Here a simple typescript definition for the class, it comes handy in a typescript and module/AMD environment.

@zengabor
Copy link
Owner

Thank you very much

@zivni
Copy link

zivni commented Jul 4, 2016

To be used with import * as zenscroll from "zenscroll"
I think the typing should be in modules like so:

declare module ZenScroll {

    interface ZenScrollBase {

        to(element: HTMLElement);
        to(element: HTMLElement, duration: number);
        to(element: HTMLElement, duration: number, onDone: () => void);

        toY(y: number);
        toY(y: number, duration: number);
        toY(y: number, duration: number, onDone: () => void);


        center(element: HTMLElement);
        center(element: HTMLElement, duration: number);
        center(element: HTMLElement, duration: number, offset: number);
        center(element: HTMLElement, duration: number, offset: number, onDone: () => void);



        moving(): boolean;

        stop();

        setup(duration: number);
        setup(duration: number, offset: number);
    }

    interface ZenScroll extends ZenScrollBase {
        createScroller(element: HTMLElement, duration: number, offset: number): ZenScrollBase;

        intoView(element: HTMLElement);
    }
}

declare module "zenscroll" {
    var zenscroll: ZenScroll.ZenScroll;
    export = zenscroll;
}

@Nixuge
Copy link

Nixuge commented Jul 20, 2024

Is there a reason why this isn't merged?

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

Successfully merging this pull request may close these issues.

4 participants