Skip to content

Commit

Permalink
feat: add ts typings declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
nzambello committed Nov 23, 2022
1 parent c406dc6 commit 24d7674
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
9 changes: 9 additions & 0 deletions lib/ellipsed.d.ts
@@ -0,0 +1,9 @@
export declare type IEllipsisOptions = {
replaceStr?: string;
responsive?: boolean;
debounceDelay?: number;
delimiter?: string;
}
declare const ellipsis: (selector: string, rows?: number, options?: IEllipsisOptions) => void;
declare const disableResponsive: (listener: EventListener) => void;
export { ellipsis, disableResponsive };
4 changes: 2 additions & 2 deletions lib/ellipsed.js
Expand Up @@ -101,8 +101,8 @@
selector &&
(selector instanceof NodeList
? selector
: selector.nodeType === 1
? [selector]
: selector.nodeType === 1 //if node type is Node.ELEMENT_NODE
? [selector] // wrap it in (NodeList) if it is a single node
: document.querySelectorAll(selector));

var originalTexts = [];
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -9,6 +9,7 @@
"url": "https://github.com/nzambello/ellipsed"
},
"main": "lib/ellipsed.js",
"typings": "lib/ellipsed.d.ts",
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
Expand Down

0 comments on commit 24d7674

Please sign in to comment.