DefinitelyTyped/types/clamp-js/index.d.ts
2017-08-20 15:37:53 -07:00

26 lines
713 B
TypeScript

// Type definitions for clamp-js 0.7
// Project: https://github.com/xavi160/Clamp.js
// Definitions by: Sebastiaan de Rooij <https://github.com/Hikariii>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace clamp {
interface ClampOptions {
clamp?: number|string;
useNativeClamp?: boolean;
splitOnChars?: string[];
animate?: boolean;
truncationChar?: string;
truncationHTML?: string | null;
}
interface ClampResponse {
original: string;
clamped: string;
}
}
declare function clamp(element: HTMLElement, options?: clamp.ClampOptions): clamp.ClampResponse;
export = clamp;
export as namespace clamp;