Setu-TS
    Preparing search index...

    Class MetadataStore

    Concrete IMetadataStore. Decorators call the merge*/add* methods; the DecoratorPlugin and other consumers read the readonly controllers, services, and routes maps.

    A single module-level instance (metadataStore) is shared by all decorators in the process — decorators are applied at class-definition time and have no context to receive a store instance.

    0.1.0

    Implements

    Index
    • Removes all stored metadata. Intended for test isolation — decorators applied at module-evaluation time are NOT re-run, so callers that rely on decorated fixtures should not clear between tests using those fixtures.

      Returns void

    • Marks one constructor parameter as optional, keyed by its argument index.

      Stored separately from the token map because @Optional and @Inject are independent decorators on the same parameter and may be applied in either order; recording them in one structure would make the result depend on that order.

      Parameters

      • target: Constructor

        The decorated class

      • index: number

        Zero-based constructor argument index

      Returns void

    • Merges a partial module declaration into a class's metadata.

      Every module member is additive, matching the existing collection-valued decorator metadata behavior.

      Parameters

      • target: Constructor

        The decorated module class

      • partial: Partial<ModuleMetadata>

        Module members to record

      Returns void

    • Merges a partial into a method's accumulator. Arrays append; scalar fields replace. Parameter decorators append to params.

      Parameters

      • target: Constructor

        The controller class

      • handler: string

        The method name

      • mutate: (meta: MethodMeta) => void

        A function that mutates the accumulator

      Returns void

    • Replaces a class's optional-argument set outright.

      mergeService REPLACES inject while mergeCtorOptional ACCUMULATES, so two stacked @Inject(...) decorators would leave the winning token list paired with the loser's optional indices — silently marking a required dependency absent-tolerant, or naming an index the shorter replacement list cannot cover, which effectiveOptional then refuses at startup. Inject writes both fields through one call each so the last decorator to apply owns the whole declaration.

      Parameters

      • target: Constructor

        The decorated class

      • indices: Iterable<number>

        The complete set of optional argument indices

      Returns void