KC's Workspace
    Preparing search index...

    Maintains a collection of option declarations split into TypeDoc options and TypeScript options. Ensures options are of the correct type for calling code.

    Since plugins commonly add custom options, and TypeDoc does not permit options which have not been declared to be set, options must be read twice. The first time options are read, a noop logger is passed so that any errors are ignored. Then, after loading plugins, options are read again, this time with the logger specified by the application.

    Options are read in a specific order.

    1. argv (0) - Must be read first since it should change the files read when passing --options or --tsconfig.
    2. typedoc-json (100) - Read next so that it can specify the tsconfig.json file to read.
    3. tsconfig-json (200) - Last config file reader, cannot specify the typedoc.json file to read.
    4. argv (300) - Read argv again since any options set there should override those set in config files.
    Index

    Constructors

    • Returns Options

    Properties

    packageDir?: string

    In packages mode, the directory of the package being converted.

    Methods

    • Adds an option declaration to the container with extra type checking to ensure that the runtime type is consistent with the declared type.

      Type Parameters

      Parameters

      • declaration: { name: K } & KeyToDeclaration<K>

        The option declaration that should be added.

      Returns void

    • Adds an option declaration to the container.

      Parameters

      Returns void

    • Adds an option reader that will be used to read configuration values from the command line, configuration files, or other locations.

      Parameters

      Returns void

    • Clones the options, intended for use in packages mode.

      Parameters

      • packageDir: string

      Returns Options

    • Gets the set compiler options.

      Parameters

      Returns CompilerOptions

    • Gets a declaration by one of its names.

      Parameters

      • name: string

      Returns Readonly<DeclarationOption> | undefined

    • Gets the file names discovered through reading a tsconfig file.

      Returns readonly string[]

    • Get the help message to be displayed to the user if --help is passed.

      Returns string

    • Gets the project references - used in solution style tsconfig setups.

      Returns readonly ProjectReference[]

    • Discover similar option names to the given name, for use in error reporting.

      Parameters

      • missingName: string

      Returns string[]

    • Gets a value for the given option key, throwing if the option has not been declared.

      Type Parameters

      Parameters

      • name: K

      Returns TypeDocOptionValues[K]

    • Gets a value for the given option key, throwing if the option has not been declared.

      Parameters

      • name: string

      Returns unknown

    • Checks if the given option's value is deeply strict equal to the default.

      Parameters

      Returns boolean

    • Checks if the given option's value is deeply strict equal to the default.

      Parameters

      • name: string

      Returns boolean

    • Parameters

      • logger: Logger
      • Optionalcwd: string
      • OptionalusedFile: (path: string) => void

      Returns Promise<void>

    • Resets the option bag to all default values. If a name is provided, will only reset that name.

      Parameters

      • Optionalname: keyof TypeDocOptionMap

      Returns void

    • Resets the option bag to all default values. If a name is provided, will only reset that name.

      Parameters

      • Optionalname: string

      Returns void

    • Internal

      Take a snapshot of option values now, used in tests only.

      Parameters

      • snapshot: { __optionSnapshot: never }

      Returns void

    • Sets the compiler options that will be used to get a TS program.

      Parameters

      Returns void

    • Sets the given declared option. Throws if setting the option fails.

      Type Parameters

      Parameters

      • name: K
      • value: Exclude<TypeDocOptions[K], undefined>
      • OptionalconfigPath: string

        the directory to resolve Path type values against

      Returns void

    • Sets the given declared option. Throws if setting the option fails.

      Parameters

      • name: string
      • value: unknown
      • OptionalconfigPath: string

        the directory to resolve Path type values against

      Returns void

    • Internal

      Take a snapshot of option values now, used in tests only.

      Returns { __optionSnapshot: never }