@types/wnumb
Advanced tools
Comparing version 1.0.28 to 1.2.0
@@ -1,78 +0,79 @@ | ||
// Type definitions for wnumb 1.0 | ||
// Type definitions for wnumb 1.2 | ||
// Project: https://github.com/leongersen/wnumb | ||
// Definitions by: Corey Jepperson <https://github.com/acoreyj> | ||
// Jamie Neubert Pedersen <https://github.com/eikooc> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
export default wNumb; | ||
export as namespace wNumb; | ||
/** | ||
* Create a wNumb | ||
*/ | ||
declare function wNumb(options?: wNumb.Options): wNumb.Instance; | ||
declare function wNumb(options?: Options): Instance; | ||
declare namespace wNumb { | ||
interface Options { | ||
/** The number of decimals to include in the result. Limited to 7. */ | ||
decimals?: number; | ||
/** | ||
* The decimal separator. | ||
* Defaults to '.' if thousand isn't already set to '.'. | ||
*/ | ||
mark?: string; | ||
/** | ||
* Separator for large numbers. For example: ' ' would result in a formatted number of 1 000 000. | ||
*/ | ||
thousand?: string; | ||
/** | ||
* A string to prepend to the number. Use cases include prefixing with money symbols such as '$' or '€'. | ||
*/ | ||
prefix?: string; | ||
/** | ||
* A number to append to a number. For example: ',-'. | ||
*/ | ||
postfix?: string; | ||
/** | ||
* The prefix for negative values. Defaults to '-' if negativeBefore isn't set. | ||
*/ | ||
negative?: string; | ||
/** | ||
* The prefix for a negative number. Inserted before prefix. | ||
*/ | ||
negativeBefore?: string; | ||
/** | ||
* This is a powerful option to manually modify the slider output. | ||
* | ||
* For example, to show a number in another currency: | ||
* function( value ){ | ||
* return value * 1.32; | ||
* } | ||
*/ | ||
encoder?: (value: number) => number; | ||
/** | ||
* Reverse the operations set in encoder. | ||
* Use this option to undo modifications made while encoding the value. | ||
* function( value ){ | ||
* return value / 1.32; | ||
* } | ||
*/ | ||
decoder?: (value: number) => number; | ||
/** | ||
* Similar to encoder, but applied after all other formatting options are applied. | ||
*/ | ||
edit?: (value: number) => number; | ||
/** | ||
* Similar to decoder and the reverse for edit. | ||
* Applied before all other formatting options are applied. | ||
*/ | ||
undo?: (value: number) => number; | ||
} | ||
export interface Options { | ||
/** The number of decimals to include in the result. Limited to 7. */ | ||
decimals?: number; | ||
/** | ||
* The decimal separator. | ||
* Defaults to '.' if thousand isn't already set to '.'. | ||
*/ | ||
mark?: string; | ||
/** | ||
* Separator for large numbers. For example: ' ' would result in a formatted number of 1 000 000. | ||
*/ | ||
thousand?: string; | ||
/** | ||
* A string to prepend to the number. Use cases include prefixing with money symbols such as '$' or '€'. | ||
*/ | ||
prefix?: string; | ||
/** | ||
* A number to append to a number. For example: ',-'. | ||
*/ | ||
suffix?: string; | ||
/** | ||
* The prefix for negative values. Defaults to '-' if negativeBefore isn't set. | ||
*/ | ||
negative?: string; | ||
/** | ||
* The prefix for a negative number. Inserted before prefix. | ||
*/ | ||
negativeBefore?: string; | ||
/** | ||
* This is a powerful option to manually modify the slider output. | ||
* For example, to show a number in another currency: | ||
* function( value ){ | ||
* return value * 1.32; | ||
* } | ||
*/ | ||
encoder?: (value: number) => number; | ||
/** | ||
* Reverse the operations set in encoder. | ||
* Use this option to undo modifications made while encoding the value. | ||
* function( value ){ | ||
* return value / 1.32; | ||
* } | ||
*/ | ||
decoder?: (value: number) => number; | ||
/** | ||
* Similar to encoder, but applied after all other formatting options are applied. | ||
*/ | ||
edit?: (value: number) => number; | ||
/** | ||
* Similar to decoder and the reverse for edit. | ||
* Applied before all other formatting options are applied. | ||
*/ | ||
undo?: (value: number) => number; | ||
} | ||
interface Instance { | ||
/** | ||
* format to string | ||
*/ | ||
to(val: number): string; | ||
/** | ||
* get number from formatted string | ||
*/ | ||
from(val: string): number; | ||
} | ||
export interface Instance { | ||
/** | ||
* format to string | ||
*/ | ||
to(val: number): string; | ||
/** | ||
* get number from formatted string | ||
*/ | ||
from(val: string): number; | ||
} |
{ | ||
"name": "@types/wnumb", | ||
"version": "1.0.28", | ||
"version": "1.2.0", | ||
"description": "TypeScript definitions for wnumb", | ||
@@ -11,13 +11,20 @@ "license": "MIT", | ||
"githubUsername": "acoreyj" | ||
}, | ||
{ | ||
"name": "Jamie Neubert Pedersen", | ||
"url": "https://github.com/eikooc", | ||
"githubUsername": "eikooc" | ||
} | ||
], | ||
"main": "", | ||
"types": "index.d.ts", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git" | ||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", | ||
"directory": "types/wnumb" | ||
}, | ||
"scripts": {}, | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "cea05198893b3eba18a7cb6e07e04d44a1294c274040765638ef2730c80a2649", | ||
"typeScriptVersion": "2.0" | ||
"typesPublisherContentHash": "d2c7fa326dd014b6aa40eca5c6b47a40b9c348741807d596306f05d8510d3d95", | ||
"typeScriptVersion": "2.8" | ||
} |
@@ -8,10 +8,10 @@ # Installation | ||
# Details | ||
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/wnumb | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/wnumb. | ||
Additional Details | ||
* Last updated: Fri, 29 Dec 2017 03:12:35 GMT | ||
### Additional Details | ||
* Last updated: Wed, 05 Feb 2020 16:49:43 GMT | ||
* Dependencies: none | ||
* Global values: wNumb | ||
* Global values: `wNumb` | ||
# Credits | ||
These definitions were written by Corey Jepperson <https://github.com/acoreyj>. | ||
These definitions were written by Corey Jepperson (https://github.com/acoreyj), and Jamie Neubert Pedersen (https://github.com/eikooc). |
Sorry, the diff of this file is not supported yet
4841