deshiknaves / caret-pos

Locate the current position of the caret. A plain JavaScript version of Caret.js.
MIT License
117 stars 13 forks source link

typescript support #7

Closed sl45sms closed 4 years ago

sl45sms commented 5 years ago

Congrats its was very useful for me, following is my (incomplete) types for anyone have interest index.d.ts

type Offset = {
    left: number;
    height: number; 
    top: number;
}

type Pos= {
pos: number;
} & Offset

export function position(element: HTMLElement,pos?:number): Pos;
export function offset(element: HTMLElement): Offset;

(im not create a PR cause types it's incomplete and i don't want anyone blame me for trashing his/her code)

TStoneLee commented 4 years ago

Can I use this in IE 11?