mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-05 20:02:05 +08:00
[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:
committed by
Mohamed Hegazy
parent
af36b1bcf2
commit
65049e5d32
17
types/ascii2mathml/ascii2mathml-tests.ts
Normal file
17
types/ascii2mathml/ascii2mathml-tests.ts
Normal 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
35
types/ascii2mathml/index.d.ts
vendored
Normal 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;
|
||||
}
|
||||
22
types/ascii2mathml/tsconfig.json
Normal file
22
types/ascii2mathml/tsconfig.json
Normal 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"
|
||||
]
|
||||
}
|
||||
1
types/ascii2mathml/tslint.json
Normal file
1
types/ascii2mathml/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
6
types/intl/index.d.ts
vendored
Normal file
6
types/intl/index.d.ts
vendored
Normal 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
1
types/intl/intl-tests.ts
Normal file
@@ -0,0 +1 @@
|
||||
import * as intl from 'intl';
|
||||
22
types/intl/tsconfig.json
Normal file
22
types/intl/tsconfig.json
Normal 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
1
types/intl/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
16
types/remove-markdown/index.d.ts
vendored
Normal file
16
types/remove-markdown/index.d.ts
vendored
Normal 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;
|
||||
5
types/remove-markdown/remove-markdown-tests.ts
Normal file
5
types/remove-markdown/remove-markdown-tests.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import removeMd = require('remove-markdown');
|
||||
|
||||
removeMd(''); // $ExpectType string
|
||||
removeMd('', {}); // $ExpectType string
|
||||
removeMd('', { stripListLeaders: true, gfm: true }); // $ExpectType string
|
||||
22
types/remove-markdown/tsconfig.json
Normal file
22
types/remove-markdown/tsconfig.json
Normal 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"
|
||||
]
|
||||
}
|
||||
1
types/remove-markdown/tslint.json
Normal file
1
types/remove-markdown/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user