[ascii2mathml][intl][remove-markdown] add typings (#18987)

* [ascii2mathml] add typings (v0.5.4)

* [intl] add typings

* [remove-markdown] add typings

* [ascii2mathml][intl][remove-markdown] fix lint

* [intl] fix project link

* [ascii2mathml] fix test error
This commit is contained in:
Muhammad Ragib Hasin
2017-08-16 23:02:24 +06:00
committed by Mohamed Hegazy
parent af36b1bcf2
commit 65049e5d32
12 changed files with 149 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
import * as ascii2mathml from 'ascii2mathml';
let fn = ascii2mathml({}); // $ExpectType any
fn(''); // $ExpectType string
ascii2mathml('', {}); // $ExpectType string
// $ExpectType string
ascii2mathml('', {
decimalMark: '.',
colSep: ',',
rowSep: ';',
display: 'inline',
dir: 'ltr',
bare: false,
standalone: false,
annotate: false
});

35
types/ascii2mathml/index.d.ts vendored Normal file
View File

@@ -0,0 +1,35 @@
// Type definitions for ascii2mathml 0.5
// Project: https://github.com/runarberg/ascii2mathml
// Definitions by: Muhammad Ragib Hasin <https://github.com/RagibHasin>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = A2MML;
declare var A2MML: ascii2mathml;
interface Options {
decimalMark?: string;
colSep?: string;
rowSep?: string;
display?: 'inline' | 'block';
dir?: 'ltr' | 'rtl';
bare?: boolean;
standalone?: boolean;
annotate?: boolean;
}
interface ascii2mathml {
/**
* Generates a function with default options set to convert
* ASCIIMath expression to MathML markup.
* @param options Options
*/
(options: Options): ascii2mathml;
/**
* Converts ASCIIMath expression to MathML markup.
* @param asciimath {string} ASCIIMath expression
* @param options Options
*/
(asciimath: string, options?: Options): string;
}

View File

@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"ascii2mathml-tests.ts"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }

6
types/intl/index.d.ts vendored Normal file
View File

@@ -0,0 +1,6 @@
// Type definitions for intl 1.2
// Project: https://github.com/andyearnshaw/Intl.js
// Definitions by: Muhammad Ragib Hasin <https://github.com/RagibHasin>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = Intl;

1
types/intl/intl-tests.ts Normal file
View File

@@ -0,0 +1 @@
import * as intl from 'intl';

22
types/intl/tsconfig.json Normal file
View File

@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"intl-tests.ts"
]
}

1
types/intl/tslint.json Normal file
View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }

16
types/remove-markdown/index.d.ts vendored Normal file
View File

@@ -0,0 +1,16 @@
// Type definitions for remove-markdown 0.1
// Project: https://github.com/stiang/remove-markdown
// Definitions by: Muhammad Ragib Hasin <https://github.com/RagibHasin>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = RemoveMarkdown;
/**
* Strip Markdown formatting from text
* @param markdown Markdown text
* @param options
*/
declare function RemoveMarkdown(markdown: string, options?: {
stripListLeaders?: boolean
gfm?: boolean
}): string;

View File

@@ -0,0 +1,5 @@
import removeMd = require('remove-markdown');
removeMd(''); // $ExpectType string
removeMd('', {}); // $ExpectType string
removeMd('', { stripListLeaders: true, gfm: true }); // $ExpectType string

View File

@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"remove-markdown-tests.ts"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }