Skip to content

Commit

Permalink
Add Typescript type definitions (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisMBarr authored and ryanve committed Feb 11, 2017
1 parent ab8db41 commit 874367e
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
41 changes: 41 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
declare module eol {
/**
* Normalize line endings in text for the current operating system
* @return string with line endings normalized to \r\n or \n
*/
export function auto(text: string): string;

/**
* Normalize line endings in text to CRLF (Windows, DOS)
* @return string with line endings normalized to \r\n
*/
export function crlf(text: string): string;

/**
* Normalize line endings in text to LF (Unix, OS X)
* @return string with line endings normalized to \n
*/
export function lf(text: string): string;

/**
* Normalize line endings in text to CR (Mac OS)
* @return string with line endings normalized to \r
*/
export function cr(text: string): string;

/**
* Add linebreak before text
* @return string with linebreak added before text
*/
export function before(text: string): string;

/**
* Add linebreak after text
* @return string with linebreak added after text
*/
export function after(text: string): string;
}

declare module "eol" {
export = eol;
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,7 @@
"supernew": true,
"undef": true,
"unused": true
}
},
"types": "./index.d.ts",
"typings": "./index.d.ts"
}

0 comments on commit 874367e

Please sign in to comment.