@mathjax/src
    Preparing search index...

    The Package class for handling individual components

    Index

    Constructors

    • Parameters

      • name: string

        The name of the package

      • noLoad: boolean = false

        True when the package is just for reference, not loading

      Returns Package

    Properties

    dependencies: Package[] = []

    The packages that this one depends on

    dependencyCount: number = 0

    The number of dependencies that haven't yet been loaded

    dependents: Package[] = []

    The packages that require this one

    hasFailed: boolean = false

    True if the package has failed to load

    isLoaded: boolean = false

    True when the package has been loaded successfully

    isLoading: boolean = false

    True when the package is being loaded but hasn't yet finished loading

    name: string

    The package name

    noLoad: boolean

    True if this package should be loaded automatically (e.g., it was created in reference to a MathJax.loader.ready() call when the package hasn't been requested to load)

    promise: Promise<string>

    A promise that resolves when the package is loaded successfully and rejects when it fails to load

    provided: Package[] = []

    The sub-packages that this one provides

    reject: PackageFailed

    The function that rejects the package's promise

    resolve: PackageReady

    The function that resolves the package's promise

    result: any = {}

    The result of loading a module via the custom loader

    packages: PackageMap = ...

    The set of packages being used

    Accessors

    • get canLoad(): boolean

      Returns boolean

      True when the package can be loaded (i.e., its dependencies are all loaded, it is allowed to be loaded, isn't already loading, and hasn't failed to load in the past)

    Methods

    • Add a package as a dependent, and if it is not just for reference, check if we need to change our noLoad status.

      Parameters

      • extension: Package

        The package to add as a dependent

      • noLoad: boolean

        The noLoad status of the dependent

      Returns void

    • Check if a package is really ready to be marked as loaded (When it is loaded, it may set its own checkReady() function or extraLoads array as a means of loading additional packages. E.g., an output jax may load a font package, dependent on its configuration.)

      The configuration's checkReady() function returns a promise that allows the loader to wait for addition actions to finish before marking the file as loaded (or failing to load).

      Returns void

    • If this package is marked as noLoad, change that and check all our dependencies to see if they need to change their noLoad status as well.

      I.e., if there are dependencies that were set up for reference and a leaf node needs to be loaded, make sure all parent nodes are marked as needing to be loaded as well.

      Returns void

    • Called when the package fails to load for some reason

      Mark it as failed to load Reject the promise for this package with an error

      Parameters

      • message: string

        The error message for a load failure

      Returns void

    • Load using a custom require method (usually the one from node.js)

      Parameters

      • url: string

        The URL to load from

      Returns void

    • Called when the package is loaded.

      Mark it as loaded, and tell its dependents that this package has been loaded (may cause dependents to load themselves). Mark any provided packages as loaded. Resolve the promise that says this package is loaded.

      Returns void

    • Load in a browser by inserting a script to load the proper URL

      Parameters

      • url: string

        The URL to load from

      Returns void

    • Returns Promise<string>[]

      The array of promises that must be resolved before this package can be loaded

    • Parameters

      • promises: Promise<string>[]

        The array or promises that must be resolved before this package can load

      Returns Promise<string>

      The promise indicating when this file is loaded

    • Parameters

      • names: string[] = []

        The names of the packages that this package provides

      Returns void

    • This is called when a dependency loads.

      Decrease the dependency count, and try to load this package when the dependencies are all loaded.

      Returns void

    • Attempt to load all packages that are ready to be loaded (i.e., that have no unloaded dependencies, and that haven't already been loaded, and that aren't in process of being loaded, and that aren't marked as noLoad).

      Returns void

    • Parameters

      • name: string

        The package configuration to be loaded

      Returns Promise<void>

      A promise for when extra files and checkReady have been fulfilled

    • Compute the path for a package using the loader's path filters

      Parameters

      • name: string

        The name of the package to resolve

      • addExtension: boolean = true

        True if .js should be added automatically

      Returns string

      The path (file or URL) for this package