Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
types: add typescript typings for remark-mdx, remark-mdx-remove-expor…
…ts, remark-mdx-remove-imports, @mdx-js/util (#1082)
- Loading branch information
1 parent
65af47c
commit e2eb4ee
Showing
20 changed files
with
210 additions
and
31 deletions.
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
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// TypeScript Version: 3.4 | ||
|
||
import {Plugin} from 'unified' | ||
|
||
/** | ||
* Remove export nodes from the MDXAST. | ||
*/ | ||
declare const remarkMdxRemoveExports: Plugin<[]> | ||
|
||
export = remarkMdxRemoveExports |
4 changes: 4 additions & 0 deletions
4
packages/remark-mdx-remove-exports/types/remark-mdx-remove-exports-test.ts
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import * as unified from 'unified' | ||
import * as mdxRemoveExports from 'remark-mdx-remove-exports' | ||
|
||
unified().use(mdxRemoveExports) |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"lib": ["dom", "es6"], | ||
"strict": true, | ||
"skipLibCheck": true, | ||
"baseUrl": ".", | ||
"jsx": "react", | ||
"paths": { | ||
"remark-mdx-remove-exports": ["index.d.ts"] | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "dtslint/dtslint.json", | ||
"rules": { | ||
"whitespace": false, | ||
"semicolon": false | ||
} | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// TypeScript Version: 3.4 | ||
|
||
import {Plugin} from 'unified' | ||
|
||
/** | ||
* Remove import nodes from the MDXAST. | ||
*/ | ||
declare const remarkMdxRemoveImports: Plugin<[]> | ||
|
||
export = remarkMdxRemoveImports |
4 changes: 4 additions & 0 deletions
4
packages/remark-mdx-remove-imports/types/remark-mdx-remove-imports-test.ts
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import * as unified from 'unified' | ||
import * as mdxRemoveImports from 'remark-mdx-remove-imports' | ||
|
||
unified().use(mdxRemoveImports) |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"lib": ["dom", "es6"], | ||
"strict": true, | ||
"skipLibCheck": true, | ||
"baseUrl": ".", | ||
"jsx": "react", | ||
"paths": { | ||
"remark-mdx-remove-imports": ["index.d.ts"] | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "dtslint/dtslint.json", | ||
"rules": { | ||
"whitespace": false, | ||
"semicolon": false | ||
} | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// TypeScript Version: 3.4 | ||
|
||
import {Plugin} from 'unified' | ||
|
||
/** | ||
* remark plugin to support MDX (Markdown 💛 JSX). | ||
*/ | ||
declare const remarkMdx: Plugin<[]> | ||
|
||
export = remarkMdx |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import * as unified from 'unified' | ||
import * as mdx from 'remark-mdx' | ||
|
||
unified().use(mdx) |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"lib": ["dom", "es6"], | ||
"strict": true, | ||
"skipLibCheck": true, | ||
"baseUrl": ".", | ||
"jsx": "react", | ||
"paths": { | ||
"remark-mdx": ["index.d.ts"] | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "dtslint/dtslint.json", | ||
"rules": { | ||
"whitespace": false, | ||
"semicolon": false | ||
} | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// TypeScript Version: 3.4 | ||
|
||
export const EMPTY_NEWLINE: string | ||
export function isImport(text: string): boolean | ||
export function isExport(text: string): boolean | ||
export function isExportDefault(text: string): boolean | ||
export function isImportOrExport(text: string): boolean | ||
export function startsWithCapitalLetter(text: string): boolean | ||
export function isComment(text: string): boolean | ||
export function getCommentContents(text: string): string | ||
export function paramCase(text: string): string | ||
export function toTemplateLiteral(text: string): string |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { | ||
EMPTY_NEWLINE, | ||
isImport, | ||
isExport, | ||
isExportDefault, | ||
isImportOrExport, | ||
startsWithCapitalLetter, | ||
isComment, | ||
getCommentContents, | ||
paramCase, | ||
toTemplateLiteral | ||
} from '@mdx-js/util' | ||
|
||
EMPTY_NEWLINE // $ExpectType string | ||
isImport('') // $ExpectType boolean | ||
isExport('') // $ExpectType boolean | ||
isExportDefault('') // $ExpectType boolean | ||
isImportOrExport('') // $ExpectType boolean | ||
startsWithCapitalLetter('') // $ExpectType boolean | ||
isComment('') // $ExpectType boolean | ||
getCommentContents('') // $ExpectType string | ||
paramCase('') // $ExpectType string | ||
toTemplateLiteral('') // $ExpectType string |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"lib": ["dom", "es6"], | ||
"strict": true, | ||
"skipLibCheck": true, | ||
"baseUrl": ".", | ||
"jsx": "react", | ||
"paths": { | ||
"@mdx-js/util": ["index.d.ts"] | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "dtslint/dtslint.json", | ||
"rules": { | ||
"whitespace": false, | ||
"semicolon": false | ||
} | ||
} |