Fix linting issues

This commit is contained in:
Sinziana Nicolae
2017-12-10 20:30:07 +02:00
parent d9f0cbf0fb
commit b2fdfe631f
2 changed files with 7 additions and 9 deletions

View File

@@ -1,4 +1,4 @@
import clamp, { IClampOptions, IClampResponse } from 'clamp-js-main';
import clamp, { ClampOptions, ClampResponse } from 'clamp-js-main';
const element: HTMLElement = document.createElement('div');
element.style.setProperty('width', '5px');
@@ -9,9 +9,9 @@ const span: HTMLSpanElement = document.createElement('span');
span.textContent = "Lorem ipsum. Lorem ipsum";
element.appendChild(span);
const simpleClamp: IClampResponse = clamp(element);
const simpleClamp: ClampResponse = clamp(element);
const options: IClampOptions = {
const options: ClampOptions = {
clamp: 2,
useNativeClamp: false,
splitOnChars: ['.'],
@@ -19,4 +19,4 @@ const options: IClampOptions = {
truncationChar: '--',
truncationHTML: '<span></span>'
};
const clampWithOptions: IClampResponse = clamp(element, options);
const clampWithOptions: ClampResponse = clamp(element, options);

View File

@@ -3,8 +3,7 @@
// Definitions by: Sinziana Nicolae <https://github.com/sinziananicolae>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export interface IClampOptions {
export interface ClampOptions {
clamp?: number|string;
useNativeClamp?: boolean;
splitOnChars?: string[];
@@ -13,10 +12,9 @@ export interface IClampOptions {
truncationHTML?: string | null;
}
export interface IClampResponse {
export interface ClampResponse {
original: string;
clamped: string;
}
export default function clamp(element: HTMLElement, options?: IClampOptions): IClampResponse;
export default function clamp(element: HTMLElement, options?: ClampOptions): ClampResponse;