-
-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update numbro.d.ts to use export = instead of export default #232
Merged
BenjaminVanRyseghem
merged 2 commits into
BenjaminVanRyseghem:develop
from
olmobrutall:develop
Apr 3, 2017
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,101 +1,105 @@ | ||
// Definitions by: Dan Poggi <https://github.com/dpoggi> | ||
|
||
interface NumbroStatic { | ||
(value?: any): Numbro; | ||
|
||
version: string; | ||
isNumbro(value: any): value is Numbro; | ||
|
||
setCulture(newCultureCode: string, fallbackCultureCode?: string): void; | ||
culture(): string; | ||
culture(cultureCode: string): void; | ||
culture(cultureCode: string, newCulture: NumbroCulture): NumbroStatic; | ||
cultureData(cultureCode?: string): NumbroCulture; | ||
cultures(): Array<NumbroCulture>; | ||
|
||
/** | ||
* Language functions | ||
* | ||
* @deprecated Since version 1.6.0. Will be removed in version 2.0. Use the | ||
* culture versions instead. | ||
*/ | ||
setLanguage(newCultureCode: string, fallbackCultureCode?: string): void; | ||
language(): string; | ||
language(cultureCode: string): void; | ||
language(cultureCode: string, newCulture: NumbroCulture): NumbroStatic; | ||
languageData(cultureCode?: string): NumbroCulture; | ||
languages(): Array<NumbroCulture>; | ||
|
||
zeroFormat(newFormat: string): void; | ||
defaultFormat(newFormat: string): void; | ||
defaultCurrencyFormat(newFormat: string): void; | ||
|
||
validate(value: string, cultureCode?: string): boolean; | ||
|
||
loadCulturesInNode(): void; | ||
|
||
/** | ||
* @deprecated Since version 1.6.0. Will be removed in version 2.0. Use the | ||
* culture version instead. | ||
*/ | ||
loadLanguagesInNode(): void; | ||
} | ||
|
||
export interface Numbro { | ||
clone(): Numbro; | ||
|
||
format(formatString?: string, roundingFunction?: RoundingFunction): string; | ||
formatCurrency(formatString?: string, roundingFunction?: RoundingFunction): string; | ||
unformat(formattedNumber: string): number; | ||
|
||
binaryByteUnits(): string; | ||
byteUnits(): string; | ||
decimalByteUnits(): string; | ||
|
||
value(): number; | ||
valueOf(): number; | ||
declare function numbro(value?: any): numbro.Numbro; | ||
|
||
declare namespace numbro { | ||
|
||
export const version: string; | ||
export function isNumbro(value: any): value is Numbro; | ||
|
||
export function setCulture(newCultureCode: string, fallbackCultureCode ?: string): void; | ||
export function culture(): string; | ||
export function culture(cultureCode: string): void; | ||
export function culture(cultureCode: string, newCulture: NumbroCulture): typeof numbro; | ||
export function cultureData(cultureCode ?: string): NumbroCulture; | ||
export function cultures(): Array<NumbroCulture>; | ||
|
||
/** | ||
* Language functions | ||
* | ||
* @deprecated Since version 1.6.0. Will be removed in version 2.0. Use the | ||
* culture versions instead. | ||
*/ | ||
export function setLanguage(newCultureCode: string, fallbackCultureCode ?: string): void; | ||
export function language(): string; | ||
export function language(cultureCode: string): void; | ||
export function language(cultureCode: string, newCulture: NumbroCulture): typeof numbro; | ||
export function languageData(cultureCode ?: string): NumbroCulture; | ||
export function languages(): Array<NumbroCulture>; | ||
|
||
export function zeroFormat(newFormat: string): void; | ||
export function defaultFormat(newFormat: string): void; | ||
export function defaultCurrencyFormat(newFormat: string): void; | ||
|
||
export function validate(value: string, cultureCode ?: string): boolean; | ||
|
||
export function loadCulturesInNode(): void; | ||
|
||
/** | ||
* @deprecated Since version 1.6.0. Will be removed in version 2.0. Use the | ||
* culture version instead. | ||
*/ | ||
export function loadLanguagesInNode(): void; | ||
|
||
|
||
|
||
interface Numbro { | ||
clone(): Numbro; | ||
|
||
format(formatString?: string, roundingFunction?: RoundingFunction): string; | ||
formatCurrency(formatString?: string, roundingFunction?: RoundingFunction): string; | ||
unformat(formattedNumber: string): number; | ||
|
||
binaryByteUnits(): string; | ||
byteUnits(): string; | ||
decimalByteUnits(): string; | ||
|
||
value(): number; | ||
valueOf(): number; | ||
|
||
set(value: number): this; | ||
add(value: number): this; | ||
subtract(value: number): this; | ||
multiply(value: number): this; | ||
divide(value: number): this; | ||
|
||
difference(value: number): number; | ||
} | ||
|
||
export interface NumbroCulture { | ||
langLocaleCode: string; | ||
cultureCode: string; | ||
delimiters: { | ||
thousands: string; | ||
decimal: string; | ||
}; | ||
abbreviations: { | ||
thousand: string; | ||
million: string; | ||
billion: string; | ||
trillion: string; | ||
}; | ||
ordinal(num: number): string; | ||
currency: { | ||
symbol: string; | ||
position: string; | ||
}; | ||
defaults: { | ||
currencyFormat: string; | ||
}; | ||
formats: { | ||
fourDigits: string; | ||
fullWithTwoDecimals: string; | ||
fullWithTwoDecimalsNoCurrency: string; | ||
fullWithNoDecimals: string; | ||
}; | ||
} | ||
|
||
export interface RoundingFunction { | ||
(x: number): number; | ||
} | ||
|
||
set(value: number): this; | ||
add(value: number): this; | ||
subtract(value: number): this; | ||
multiply(value: number): this; | ||
divide(value: number): this; | ||
|
||
difference(value: number): number; | ||
} | ||
|
||
export interface NumbroCulture { | ||
langLocaleCode: string; | ||
cultureCode: string; | ||
delimiters: { | ||
thousands: string; | ||
decimal: string; | ||
}; | ||
abbreviations: { | ||
thousand: string; | ||
million: string; | ||
billion: string; | ||
trillion: string; | ||
}; | ||
ordinal(num: number): string; | ||
currency: { | ||
symbol: string; | ||
position: string; | ||
}; | ||
defaults: { | ||
currencyFormat: string; | ||
}; | ||
formats: { | ||
fourDigits: string; | ||
fullWithTwoDecimals: string; | ||
fullWithTwoDecimalsNoCurrency: string; | ||
fullWithNoDecimals: string; | ||
}; | ||
} | ||
|
||
export interface RoundingFunction { | ||
(x: number): number; | ||
} | ||
export = numbro; | ||
|
||
declare const numbro: NumbroStatic; | ||
export default numbro; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one empty line feels enough 😄