micromark-util-types
Advanced tools
Comparing version 1.1.0 to 2.0.0
@@ -248,3 +248,3 @@ // Note: this file is authored manually, not generated from `index.js`. | ||
* Extra fields. | ||
* @returns | ||
* @returns {Token} | ||
* Token. | ||
@@ -273,3 +273,3 @@ */ | ||
*/ | ||
export type Consume = (code: Code) => void | ||
export type Consume = (code: Code) => undefined | ||
@@ -342,6 +342,6 @@ /** | ||
* | ||
* But there is one case where they return void: for the eof character code | ||
* (at the end of a value). | ||
* The reason being: well, there isn’t any state that makes sense, so void | ||
* works well. | ||
* But there is one case where they return `undefined`: for the eof character | ||
* code (at the end of a value). | ||
* The reason being: well, there isn’t any state that makes sense, so | ||
* `undefined` works well. | ||
* Practically that has also helped: if for some reason it was a mistake, then | ||
@@ -356,3 +356,3 @@ * an exception is throw because there is no next function, meaning it | ||
*/ | ||
export type State = (code: Code) => State | void | ||
export type State = (code: Code) => State | undefined | ||
@@ -408,3 +408,3 @@ /** | ||
/** | ||
* Like a tokenizer, but without `ok` or `nok`, and returning void. | ||
* Like a tokenizer, but without `ok` or `nok`, and returning `undefined`. | ||
* | ||
@@ -420,3 +420,3 @@ * This is the final hook when a container must be closed. | ||
*/ | ||
export type Exiter = (this: TokenizeContext, effects: Effects) => void | ||
export type Exiter = (this: TokenizeContext, effects: Effects) => undefined | ||
@@ -699,3 +699,3 @@ /** | ||
*/ | ||
defineSkip: (point: Point) => void | ||
defineSkip: (point: Point) => undefined | ||
@@ -748,19 +748,16 @@ /** | ||
/** | ||
* Encodings supported by the buffer class. | ||
* Encodings supported by `TextEncoder`. | ||
* | ||
* This is a copy of the typing from Node, copied to prevent Node globals from | ||
* being needed. | ||
* Copied from: <https://github.com/DefinitelyTyped/DefinitelyTyped/blob/a2bc1d8/types/node/globals.d.ts#L174> | ||
* Arbitrary encodings can be supported depending on how the engine is built. | ||
* So any string *could* be valid. | ||
* But you probably want `utf-8`. | ||
*/ | ||
export type Encoding = | ||
| 'ascii' | ||
| 'base64' | ||
| 'binary' | ||
| 'hex' | ||
| 'latin1' | ||
| 'ucs-2' | ||
| 'ucs2' | ||
| 'utf-8' | ||
| 'utf16le' | ||
| 'utf8' | ||
// Encodings supported in Node by default or when built with the small-icu option. | ||
// Does not include aliases. | ||
| 'utf-8' // Always supported in Node. | ||
| 'utf-16le' // Always supported in Node. | ||
| 'utf-16be' // Not supported when ICU is disabled. | ||
// Everything else (depends on browser, or full ICU data). | ||
| (string & {}) | ||
@@ -770,7 +767,3 @@ /** | ||
* | ||
* Can either be text, or a `Buffer` like structure. | ||
* This does not directly use type `Buffer`, because it can also be used in a | ||
* browser context. | ||
* Instead this leverages `Uint8Array` which is the base type for `Buffer`, | ||
* and a native JavaScript construct. | ||
* Can either be text, or a `Uint8Array` like structure. | ||
*/ | ||
@@ -910,3 +903,3 @@ export type Value = Uint8Array | string | ||
value?: CompileData[Key] | ||
) => void | ||
) => undefined | ||
@@ -929,3 +922,3 @@ /** | ||
*/ | ||
lineEndingIfNeeded: () => void | ||
lineEndingIfNeeded: () => undefined | ||
@@ -948,3 +941,3 @@ /** | ||
*/ | ||
buffer: () => void | ||
buffer: () => undefined | ||
@@ -967,3 +960,3 @@ /** | ||
*/ | ||
raw: (value: string) => void | ||
raw: (value: string) => undefined | ||
@@ -978,3 +971,3 @@ /** | ||
*/ | ||
tag: (value: string) => void | ||
tag: (value: string) => undefined | ||
@@ -1007,3 +1000,3 @@ /** | ||
*/ | ||
export type Handle = (this: CompileContext, token: Token) => void | ||
export type Handle = (this: CompileContext, token: Token) => undefined | ||
@@ -1018,3 +1011,3 @@ /** | ||
this: Omit<CompileContext, 'sliceSerialize'> | ||
) => void | ||
) => undefined | ||
@@ -1206,3 +1199,3 @@ /** | ||
// Note: when changing the next interface, you likely also have to change | ||
// `micromark-util-symbol/types.js`. | ||
// `micromark-util-symbol`. | ||
/** | ||
@@ -1209,0 +1202,0 @@ * Map of allowed token types. |
{ | ||
"name": "micromark-util-types", | ||
"version": "1.1.0", | ||
"version": "2.0.0", | ||
"description": "micromark utility with a couple of typescript types", | ||
@@ -31,4 +31,2 @@ "license": "MIT", | ||
"type": "module", | ||
"main": "index.js", | ||
"types": "index.d.ts", | ||
"files": [ | ||
@@ -39,4 +37,3 @@ "index.d.ts", | ||
"exports": "./index.js", | ||
"scripts": {}, | ||
"xo": false | ||
} |
@@ -72,8 +72,10 @@ # micromark-util-types | ||
Projects maintained by the unified collective are compatible with all maintained | ||
Projects maintained by the unified collective are compatible with maintained | ||
versions of Node.js. | ||
As of now, that is Node.js 16+. | ||
Our projects sometimes work with older versions, but this is not guaranteed. | ||
This package work with `micromark` version 3+. | ||
When we cut a new major release, we drop support for unmaintained versions of | ||
Node. | ||
This means we try to keep the current release line, | ||
`micromark-util-types@^2`, compatible with Node.js 16. | ||
This package works with `micromark@^3`. | ||
@@ -80,0 +82,0 @@ ## Security |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
36656
152
0
1170