mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-05-29 15:44:31 +00:00
Fix linting issues
This commit is contained in:
@@ -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);
|
||||
|
||||
8
types/clamp-js-main/index.d.ts
vendored
8
types/clamp-js-main/index.d.ts
vendored
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user