mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
update(alex): v9 changes (#46989)
- MDX support added - cleaner type imports - tests amended - version bump https://github.com/get-alex/alex/compare/8.2.0...9.0.1 Thanks!
This commit is contained in:
parent
7e4cb54a7d
commit
03f3cf9673
@ -1,3 +1,5 @@
|
||||
import alex = require('alex');
|
||||
|
||||
// configs
|
||||
const exemption = ['word', 'noun'];
|
||||
const deny = ['deny', 'word'];
|
||||
@ -18,15 +20,22 @@ alex('We’ve confirmed his identity.'); // $ExpectType VFile
|
||||
alex('We’ve confirmed his identity.', exemption); // $ExpectType VFile
|
||||
alex('We’ve confirmed his identity.', config); // $ExpectType VFile
|
||||
alex('We’ve confirmed his identity.', denyConfig); // $ExpectType VFile
|
||||
|
||||
alex.markdown('### We’ve confirmed his **identity**.'); // $ExpectType VFile
|
||||
alex.markdown('### We’ve confirmed his **identity**.', exemption); // $ExpectType VFile
|
||||
alex.markdown('### We’ve confirmed his **identity**.', config); // $ExpectType VFile
|
||||
alex.markdown('### We’ve confirmed his **identity**.', denyConfig); // $ExpectType VFile
|
||||
|
||||
alex.html('<p class="black">He walked to class.</p>'); // $ExpectType VFile
|
||||
alex.html('<p class="black">He walked to class.</p>', exemption); // $ExpectType VFile
|
||||
alex.html('<p class="black">He walked to class.</p>', config); // $ExpectType VFile
|
||||
alex.html('<p class="black">He walked to class.</p>', denyConfig); // $ExpectType VFile
|
||||
|
||||
alex.text('The `boogeyman`.'); // $ExpectType VFile
|
||||
alex.text('The `boogeyman`.', exemption); // $ExpectType VFile
|
||||
alex.text('The `boogeyman`.', config); // $ExpectType VFile
|
||||
alex.text('The `boogeyman`.', denyConfig); // $ExpectType VFile
|
||||
|
||||
alex.mdx('The `boogeyman`.', denyConfig); // $ExpectType VFile
|
||||
alex.mdx('<Component>He walked to class.</Component>'); // $ExpectType VFile
|
||||
alex.mdx('<Component>He walked to class.</Component>', config); // $ExpectType VFile
|
||||
|
||||
20
types/alex/index.d.ts
vendored
20
types/alex/index.d.ts
vendored
@ -1,14 +1,14 @@
|
||||
// Type definitions for alex 8.2
|
||||
// Type definitions for alex 9.0
|
||||
// Project: https://alexjs.com
|
||||
// Definitions by: Piotr Błażejewicz <https://github.com/peterblazejewicz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import * as vfile from 'vfile';
|
||||
import { VFile } from 'vfile';
|
||||
|
||||
/**
|
||||
* finds gender favoring, polarizing, race related, religion inconsiderate, or other unequal phrasing in text.
|
||||
*/
|
||||
declare function alex(value: vfile.VFile | string, config?: alex.Config): vfile.VFile;
|
||||
declare function alex(value: VFile | string, config?: alex.Config): VFile;
|
||||
|
||||
declare namespace alex {
|
||||
/**
|
||||
@ -38,13 +38,21 @@ declare namespace alex {
|
||||
}
|
||||
|
||||
/** Check Markdown (ignoring syntax). */
|
||||
function markdown(value: vfile.VFile | string, config?: Config): vfile.VFile;
|
||||
function markdown(value: VFile | string, config?: Config): VFile;
|
||||
|
||||
/** Check HTML (ignoring syntax). */
|
||||
function html(value: vfile.VFile | string, config?: Config): vfile.VFile;
|
||||
function html(value: VFile | string, config?: Config): VFile;
|
||||
|
||||
/** Check plain text (as in, syntax is checked). */
|
||||
function text(value: vfile.VFile | string, config?: Config): vfile.VFile;
|
||||
function text(value: VFile | string, config?: Config): VFile;
|
||||
|
||||
/**
|
||||
* Check [MDX][] (ignoring syntax).
|
||||
*
|
||||
* Note: the syntax for [MDX@2][mdx-next], while currently in beta, is used in
|
||||
* alex
|
||||
*/
|
||||
function mdx(value: VFile | string, config?: Config): VFile;
|
||||
}
|
||||
|
||||
export as namespace alex;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"vfile": "^4.0.2"
|
||||
"vfile": "^4.2.0"
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user