forked from ctrl-freaks/freezeframe.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix type declarations for publishing
- Loading branch information
1 parent
c55bcd4
commit 325cd9b
Showing
8 changed files
with
5,274 additions
and
2,930 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
export declare const classes: { | ||
SELECTOR: string; | ||
CONTAINER: string; | ||
LOADING_ICON: string; | ||
IMAGE: string; | ||
CANVAS: string; | ||
READY: string; | ||
INACTIVE: string; | ||
ACTIVE: string; | ||
CANVAS_READY: string; | ||
RESPONSIVE: string; | ||
OVERLAY: string; | ||
}; | ||
export declare const defaultOptions: { | ||
selector: string; | ||
responsive: boolean; | ||
trigger: string; | ||
overlay: boolean; | ||
warnings: boolean; | ||
}; | ||
export declare const styleId = "ff-styles"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { SelectorOrNodes, Freeze, FreezeFrameOptions, RequireProps } from '../types'; | ||
declare class Freezeframe { | ||
#private; | ||
options: FreezeFrameOptions; | ||
items: Freeze[]; | ||
$images: HTMLImageElement[]; | ||
private _eventListeners; | ||
private get _stylesInjected(); | ||
constructor(target?: SelectorOrNodes | RequireProps<FreezeFrameOptions, 'selector'>, options?: FreezeFrameOptions); | ||
private _init; | ||
private _capture; | ||
private _load; | ||
private _setup; | ||
private _wrap; | ||
private _process; | ||
private _ready; | ||
private _attach; | ||
private _addEventListener; | ||
private _removeEventListener; | ||
private _injectStylesheet; | ||
private _emit; | ||
private _toggleOn; | ||
private _toggleOff; | ||
private _toggle; | ||
start(): this; | ||
stop(): this; | ||
toggle(): this; | ||
on(event: string, cb: Function): this; | ||
destroy(): void; | ||
} | ||
export default Freezeframe; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export declare const stylesheet: () => string; | ||
export declare const container: () => string; | ||
export declare const canvas: () => string; | ||
export declare const overlay: () => string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { SelectorOrNodes, FreezeFrameOptions } from '../../types/index'; | ||
export declare const pipe: (...fns: Function[]) => (...initArgs: any[]) => any; | ||
export declare const formatMessage: (string: string) => string; | ||
export declare const error: (message: string, ...args: any[]) => void; | ||
export declare const warn: (message: string, ...args: any[]) => void; | ||
export declare const isTouch: () => boolean; | ||
export declare const parseFilename: (filePath: string) => string; | ||
export declare const validateFilename: (filePath: string) => boolean; | ||
export declare const normalizeElements: (selectorOrNodes: SelectorOrNodes) => Element | HTMLCollectionOf<Element> | NodeListOf<Element>; | ||
export declare const validateElements: (elements: Element | Element[], _: any, options: FreezeFrameOptions) => any[]; | ||
export declare const dedupeImages: (images: HTMLImageElement[]) => HTMLImageElement[]; | ||
export declare const htmlToNode: (html: string) => HTMLElement; | ||
export declare const wrapNode: ($el: HTMLElement, $wrapper: HTMLElement) => void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
export declare type RequireProps<T extends {}, K extends keyof T> = Omit<T, K> & { | ||
[MK in K]-?: NonNullable<T[MK]>; | ||
}; | ||
export declare type SelectorOrNodes = string | Element | HTMLCollectionOf<Element> | NodeListOf<Element>; | ||
export declare type TriggerType = string | false; | ||
export declare enum FreezeFrameEventTypes { | ||
START = "start", | ||
STOP = "stop", | ||
TOGGLE = "toggle" | ||
} | ||
export interface FreezeFrameOptions { | ||
selector?: SelectorOrNodes; | ||
responsive?: boolean; | ||
trigger?: TriggerType; | ||
overlay?: boolean; | ||
warnings?: boolean; | ||
} | ||
export interface Freeze { | ||
$container: HTMLElement; | ||
$canvas: HTMLCanvasElement; | ||
$image: HTMLImageElement; | ||
} | ||
export interface FreezeFrameEvent { | ||
$image: HTMLImageElement; | ||
event: string; | ||
listener: EventListenerOrEventListenerObject; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters