Fix definition for convert-layout (#20355)

* Add types for convert-layout ( https://github.com/ai/convert-layout )

* Add missed layouts, fix tsc warnings

* Fix tslint and common mistakes

* Simplify definition structure for convert-layout
This commit is contained in:
xeningem
2017-10-11 16:20:10 -07:00
committed by Wesley Wigham
parent dd06dd6ece
commit 0fc087ca36
11 changed files with 52 additions and 25 deletions
-2
View File
@@ -1,2 +0,0 @@
import { layout } from './index';
export const by: layout;
+1 -1
View File
@@ -1,4 +1,4 @@
import { ru } from 'convert-layout/ru';
import { ru } from 'convert-layout';
const s = 'Lorem ipsum dolor sit amet.';
let result = ru.toEn(s);
-2
View File
@@ -1,2 +0,0 @@
import { layout } from './index';
export const de: layout;
-2
View File
@@ -1,2 +0,0 @@
import { layout } from './index';
export const es: layout;
-2
View File
@@ -1,2 +0,0 @@
import { layout } from './index';
export const he: layout;
+45 -2
View File
@@ -3,9 +3,52 @@
// Definitions by: Mikhail Aksenov <https://github.com/xeningem>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
export const layouts: { [id: string]: layout };
declare var layouts: { [id: string]: layout };
declare var lang_layout: layout;
export interface layout {
declare const convert_layout: {
by: layout;
de: layout;
es: layout;
he: layout;
kk: layout;
ru: layout;
uk: layout;
};
declare module "convert-layout" {
export = convert_layout;
}
declare module "convert-layout/by" {
export = lang_layout;
}
declare module "convert-layout/de" {
export = lang_layout;
}
declare module "convert-layout/es" {
export = lang_layout;
}
declare module "convert-layout/he" {
export = lang_layout;
}
declare module "convert-layout/kk" {
export = lang_layout;
}
declare module "convert-layout/ru" {
export = lang_layout;
}
declare module "convert-layout/uk" {
export = lang_layout;
}
interface layout {
toEn(s: string): string;
fromEn(s: string): string;
}
-2
View File
@@ -1,2 +0,0 @@
import { layout } from './index';
export const kk: layout;
-2
View File
@@ -1,2 +0,0 @@
import { layout } from './index';
export const ru: layout;
-7
View File
@@ -18,13 +18,6 @@
},
"files": [
"index.d.ts",
"by.d.ts",
"de.d.ts",
"es.d.ts",
"he.d.ts",
"kk.d.ts",
"ru.d.ts",
"uk.d.ts",
"convert-layout-tests.ts"
]
}
+6 -1
View File
@@ -1 +1,6 @@
{ "extends": "dtslint/dt.json" }
{
"extends": "dtslint/dt.json",
"rules": {
"no-declare-current-package": false
}
}
-2
View File
@@ -1,2 +0,0 @@
import { layout } from './index';
export const uk: layout;