@hrefcl/apidoc - v4.0.5
    Preparing search index...
    • Finds a TypeScript interface definition by name in the current file or project

      Parameters

      • interfaceName: string

        Name of the interface to find (e.g., 'UserProfile')

      • currentFile: string

        Path to the current file being processed (used for relative search)

      Returns ParsedInterface

      Parsed interface definition or null if not found

      This function searches for a specific interface definition starting with the cache, then the current file's directory. It performs cross-file lookups to find interface definitions that may be defined in separate TypeScript files, enabling flexible interface referencing in

      tags.

      // In /api/users.js, looking for UserProfile interface
      const userInterface = findInterface('UserProfile', '/api/users.js');
      if (userInterface) {
      console.log(`Found ${userInterface.properties.length} properties`);
      }
      // First call parses and caches
      const interface1 = findInterface('UserProfile', '/api/users.js');

      // Second call returns cached result
      const interface2 = findInterface('UserProfile', '/api/users.js');
      // interface1 === interface2 (same reference)
      // File structure:
      // /api/users.js - contains @apiSchema reference
      // /api/types.ts - contains UserProfile interface

      const userInterface = findInterface('UserProfile', '/api/users.js');
      // Searches /api/*.ts files and finds UserProfile in types.ts

      Uses caching to avoid re-parsing files for subsequent lookups

      Handles file system errors gracefully with warning logs

      4.0.0