Options
All
  • Public
  • Public/Protected
  • All
Menu

Module metro

Index

Type aliases

SearchFilter: (module?: Module) => boolean

Type declaration

    • Function that determines whether a module satisfies a condition.

      Parameters

      • Optional module: Module

        The module.

      Returns boolean

      Whether the module satisfies the condition.

Variables

common: metro/common = window.enmity.modules.common
filters: { byDisplayName: (name: string, defaultExport?: boolean) => SearchFilter; byName: (name: string, defaultExport?: boolean) => SearchFilter; byProps: (...mdls: string[]) => SearchFilter; byTypeName: (name: string, defaultExport?: boolean) => SearchFilter } = ...

Functions to generate filters that can be used as arguments for getModule, getModules, or bulk to retrieve modules.

Type declaration

  • byDisplayName: (name: string, defaultExport?: boolean) => SearchFilter
      • Generate a SearchFilter based on a module's display name.

        Parameters

        • name: string

          The module's display name.

        • Optional defaultExport: boolean

          Whether to return the inner default property if found in an esModule.

        Returns SearchFilter

  • byName: (name: string, defaultExport?: boolean) => SearchFilter
      • Generate a SearchFilter based on a module's name.

        Parameters

        • name: string

          The module's name.

        • Optional defaultExport: boolean

          Whether to return the inner default property if found in an esModule.

        Returns SearchFilter

  • byProps: (...mdls: string[]) => SearchFilter
      • Generate a SearchFilter based on a module's properties.

        Parameters

        • Rest ...mdls: string[]

          Properties that must be present for a module to satisfy the filter.

        Returns SearchFilter

  • byTypeName: (name: string, defaultExport?: boolean) => SearchFilter
      • Generate a SearchFilter based on a module's type name.

        Parameters

        • name: string

          The module's type name.

        • Optional defaultExport: boolean

          Whether to return the inner default property if found in an esModule.

        Returns SearchFilter

Functions

  • Get multiple modules using an array of filters.

    If you need to retrieve multiple modules at the same time, use this function instead of making multiple calls to other module-fetching functions. This function is more efficient because it only loops over the module cache once.

    Parameters

    Returns (Module | undefined)[]

    The modules that satisfy the filters, in the order of the filters.

  • Get a module by the name property of either the module or its default export.

    Parameters

    Returns (Module | undefined) | (Module | undefined)[]

    A module that has the given display name, or undefined if no module was found.

  • Get a module by a keyword.

    Parameters

    Returns Module | Module[] | undefined

    A module that has the given keyword, or undefined if no module was found. Will return an array of modules if all in the options is set to true.

  • Get a module by the name property of either the module or its default export.

    Parameters

    Returns (Module | undefined) | (Module | undefined)[]

    A module that has the given name, or undefined if no module was found.

  • Get a module by its properties.

    Parameters

    • Rest ...options: string[] | [...props: string[], options: ConditionalBulk] | [...props: string[][], options: ConditionalBulk]

      The properties that a module must have, or the properties and an object of options. If using the bulk option, then for each module's properties, use either a single string or an array of strings.

    Returns (Module | undefined) | (Module | undefined)[]

    A module that has the given properties, or undefined if no module was found. Will return an array of modules if bulk or all in the options are set to true.

  • Get a module by the name property of either the module or its default export's type property.

    Useful for getting components.

    Parameters

    Returns (Module | undefined) | (Module | undefined)[]

    A module that has the given type name, or undefined if no module was found.

  • Get a module that satisfies a filter.

    When looping through the full array of available modules, the first module that satisfies the filter will be returned.

    Parameters

    • filter: SearchFilter

      The filter to check the module.

    • Optional options: BaseOptions

      Options to modify the module-searching behavior.

    Returns Module | Module[] | undefined

    A module that satisfies the filter, or undefined if no module was found. Will return an array of modules if all in options is set to true.

Generated using TypeDoc