mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-05-29 15:44:31 +00:00
Fix problems for npm test
This commit is contained in:
120
types/excel-style-dataformatter/index.d.ts
vendored
120
types/excel-style-dataformatter/index.d.ts
vendored
@@ -1,77 +1,63 @@
|
||||
// Type definitions for excel-style-dataformatter v2.0.1
|
||||
// Type definitions for excel-style-dataformatter 2.0
|
||||
// Project: https://github.com/fakundo/Excel-Style-Javascript-DataFormatter
|
||||
// Definitions by: SanderDeWaal1992 <https://github.com/SanderDeWaal1992>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module "excel-style-dataformatter" {
|
||||
class DataFormatter {
|
||||
constructor(options?: DataFormatter.FormatterOptions);
|
||||
declare class DataFormatter {
|
||||
constructor(options?: DataFormatter.FormatterOptions);
|
||||
|
||||
/**
|
||||
* Format a value
|
||||
* @param value
|
||||
* @param type value type
|
||||
* @param format format preset
|
||||
*/
|
||||
public format(value: any, type: string, format: string): DataFormatter.FormatResult;
|
||||
/**
|
||||
* Defines locales
|
||||
* @param locales
|
||||
*/
|
||||
public defineLocales(locales: DataFormatter.LocalesOptions[]): void;
|
||||
/**
|
||||
* Sets locale
|
||||
* If locale doesn't exist, sets default
|
||||
* @param locale
|
||||
*/
|
||||
public setLocale(locale: string): void;
|
||||
/**
|
||||
* Sets UTC offset for dates
|
||||
* @param offset in minutes
|
||||
*/
|
||||
public setUTCOffset(offset: number | null): void;
|
||||
/**
|
||||
* Format a value
|
||||
* @param value
|
||||
* @param type value type
|
||||
* @param format format preset
|
||||
*/
|
||||
format(value: any, type: string, format: string): DataFormatter.FormatResult;
|
||||
/**
|
||||
* Defines locales
|
||||
* @param locales
|
||||
*/
|
||||
defineLocales(locales: DataFormatter.LocalesOptions[]): void;
|
||||
/**
|
||||
* Sets locale
|
||||
* If locale doesn't exist, sets default
|
||||
* @param locale
|
||||
*/
|
||||
setLocale(locale: string): void;
|
||||
/**
|
||||
* Sets UTC offset for dates
|
||||
* @param offset in minutes
|
||||
*/
|
||||
setUTCOffset(offset: number | null): void;
|
||||
}
|
||||
|
||||
declare namespace DataFormatter {
|
||||
interface LocalesOptions {
|
||||
name: string;
|
||||
months: string[];
|
||||
monthsShort: string[];
|
||||
days: string[];
|
||||
daysShort: string[];
|
||||
thousandSeparator: string;
|
||||
decimalSeparator: string;
|
||||
formats: {
|
||||
[index: string]: string
|
||||
};
|
||||
}
|
||||
interface FormatterOptions {
|
||||
debug?: boolean;
|
||||
UTCOffset?: number | null;
|
||||
locale?: string;
|
||||
transformCode?: (code: any) => any;
|
||||
locales?: LocalesOptions[];
|
||||
}
|
||||
|
||||
namespace DataFormatter {
|
||||
export interface LocalesOptions {
|
||||
name: string,
|
||||
months: string[],
|
||||
monthsShort: string[],
|
||||
days: string[],
|
||||
daysShort: string[],
|
||||
thousandSeparator: string,
|
||||
decimalSeparator: string,
|
||||
formats: {
|
||||
[index: string]: string
|
||||
}
|
||||
}
|
||||
export interface FormatterOptions {
|
||||
debug?: boolean,
|
||||
UTCOffset?: number | null,
|
||||
locale?: string,
|
||||
transformCode?: (code: any) => any,
|
||||
locales?: LocalesOptions[]
|
||||
}
|
||||
|
||||
export interface FormatResult {
|
||||
value: string,
|
||||
align: string,
|
||||
color: string,
|
||||
pattern: string
|
||||
}
|
||||
interface FormatResult {
|
||||
value: string;
|
||||
align: string;
|
||||
color: string;
|
||||
pattern: string;
|
||||
}
|
||||
|
||||
export = DataFormatter;
|
||||
}
|
||||
|
||||
declare module "excel-style-dataformatter/lib/locales/en-US" {
|
||||
import * as DataFormatter from "excel-style-dataformatter";
|
||||
const locale: DataFormatter.LocalesOptions;
|
||||
export = locale;
|
||||
}
|
||||
|
||||
declare module "excel-style-dataformatter/lib/locales/ru" {
|
||||
import * as DataFormatter from "excel-style-dataformatter";
|
||||
const locale: DataFormatter.LocalesOptions;
|
||||
export = locale;
|
||||
}
|
||||
export = DataFormatter;
|
||||
|
||||
4
types/excel-style-dataformatter/lib/locales/en-US.d.ts
vendored
Normal file
4
types/excel-style-dataformatter/lib/locales/en-US.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import * as DataFormatter from "../../index";
|
||||
|
||||
declare const locale: DataFormatter.LocalesOptions;
|
||||
export = locale;
|
||||
4
types/excel-style-dataformatter/lib/locales/ru.d.ts
vendored
Normal file
4
types/excel-style-dataformatter/lib/locales/ru.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import * as DataFormatter from "../../index";
|
||||
|
||||
declare const locale: DataFormatter.LocalesOptions;
|
||||
export = locale;
|
||||
@@ -7,6 +7,7 @@
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
@@ -17,6 +18,8 @@
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"lib/locales/en-US.d.ts",
|
||||
"lib/locales/ru.d.ts",
|
||||
"excel-style-dataformatter-tests.ts"
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user