版博士V2.0程序
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

25 lines
938 B

  1. import { Node } from '../nodes/Node.js';
  2. import type { Document } from './Document.js';
  3. /**
  4. * Verify that the input string is a valid anchor.
  5. *
  6. * Will throw on errors.
  7. */
  8. export declare function anchorIsValid(anchor: string): true;
  9. export declare function anchorNames(root: Document | Node): Set<string>;
  10. /** Find a new anchor name with the given `prefix` and a one-indexed suffix. */
  11. export declare function findNewAnchor(prefix: string, exclude: Set<string>): string;
  12. export declare function createNodeAnchors(doc: Document, prefix: string): {
  13. onAnchor: (source: unknown) => string;
  14. /**
  15. * With circular references, the source node is only resolved after all
  16. * of its child nodes are. This is why anchors are set only after all of
  17. * the nodes have been created.
  18. */
  19. setAnchors: () => void;
  20. sourceObjects: Map<unknown, {
  21. anchor: string | null;
  22. node: Node<unknown> | null;
  23. }>;
  24. };