Skip to content

Commit

Permalink
Import SpliceBuffer as generic type
Browse files Browse the repository at this point in the history
  • Loading branch information
robsimmons committed Mar 29, 2024
1 parent fe42e65 commit 4fea67e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/micromark-util-subtokenize/dev/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
* @typedef {import('micromark-util-types').Chunk} Chunk
* @typedef {import('micromark-util-types').Event} Event
* @typedef {import('micromark-util-types').Token} Token
* @typedef {import('micromark-util-types').SpliceBuffer<Event>} EventSpliceBuffer
*/

/**
* @template {{} | null} T
* @typedef {import('micromark-util-types').SpliceBuffer<T>} SpliceBuffer<T>
*/

import {splice} from 'micromark-util-chunked'
Expand Down Expand Up @@ -37,7 +41,7 @@ export function subtokenize(eventsArray) {
let subevents
/** @type {boolean | undefined} */
let more
/** @type {EventSpliceBuffer} */
/** @type {SpliceBuffer<Event>} */
const events = spliceBuffer(eventsArray)

while (++index < events.length) {
Expand Down Expand Up @@ -135,7 +139,7 @@ export function subtokenize(eventsArray) {
/**
* Tokenize embedded tokens.
*
* @param {EventSpliceBuffer} events
* @param {SpliceBuffer<Event>} events
* @param {number} eventIndex
* @returns {Record<string, number>}
*/
Expand Down

0 comments on commit 4fea67e

Please sign in to comment.