11import { tick } from 'svelte' ;
22
3- import { ATTRIBUTES } from '../attributes/index.js' ;
4- import { DEFAULT_TOC_CONFIG } from '../constants.js' ;
3+ import { DEFAULT_TOC_CONFIG , ATTRIBUTES } from '../constants.js' ;
54
65import {
76 extractElementText ,
@@ -12,7 +11,7 @@ import {
1211
1312/**
1413 * @param {import('../toc.svelte.js').Toc } toc
15- * @returns {import('./types.js ').TocRootAction }
14+ * @returns {import('./actions ').TocRootAction }
1615 */
1716export function createTocRootAction ( toc ) {
1817 // eslint-disable-next-line no-undef
@@ -91,7 +90,7 @@ export function createTocRootAction(toc) {
9190 const { anchor, observe, scrollMarginTop } = toc . config ;
9291 /** @type {HTMLElement[] } */
9392 const elements = Array . from ( node . querySelectorAll ( selector ) ) ;
94- /** @type {Promise<import('../types').TocItem['observe']>[] } */
93+ /** @type {Promise<import('../types.public ').TocItem['observe']>[] } */
9594 const observePromises = [ ] ;
9695
9796 node . toggleAttribute ( ATTRIBUTES . observeActiveId , true ) ;
@@ -121,7 +120,7 @@ export function createTocRootAction(toc) {
121120 new Promise ( ( resolve ) => {
122121 const rObserve = processObserve ( element , observe , tocId , updateActiveTocItem , intersectionObservers ) ;
123122 if ( toc . items . has ( tocId ) ) {
124- const tocItem = /** @type {import('../types').TocItem } */ ( toc . items . get ( tocId ) ) ;
123+ const tocItem = /** @type {import('../types.public ').TocItem } */ ( toc . items . get ( tocId ) ) ;
125124 toc . items . set ( tocId , { ...tocItem , observe : rObserve } ) ;
126125 }
127126
@@ -157,3 +156,4 @@ export function createTocRootAction(toc) {
157156 } ;
158157 } ;
159158}
159+
0 commit comments