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

Added types export to typings #39

Merged
merged 1 commit into from
Feb 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update typings.
  • Loading branch information
mciastek committed Feb 23, 2020
commit 55200e440f4fe9106b721d3046bdd6a47ffc951a
40 changes: 22 additions & 18 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
declare var sal: Sal;
declare namespace sal {
interface Options {
rootMargin?: string;
threshold?: number;
animateClassName?: string;
disabledClassName?: string;
enterEventName?: string,
exitEventName?: string,
selector?: string;
once?: boolean;
disabled?: boolean;
}

interface Options {
rootMargin?: string;
threshold?: number;
animateClassName?: string;
disabledClassName?: string;
enterEventName?: string,
exitEventName?: string,
selector?: string;
once?: boolean;
disabled?: boolean;
}
interface API {
elements: HTMLElement[];
enable: () => void;
disable: () => void;
reset: (settings?: Options) => void;
}

interface PublicAPI {
elements: HTMLElement[];
enable: () => void;
disable: () => void;
reset: (settings?: Options) => void;
type Instance = (options?: Options) => API;
}

type Sal = (options?: Options) => PublicAPI;
declare const sal: sal.Instance;

export as namespace sal;
export = sal;