Skip to content
Typecorev0.12.1

AssertComponentRoute

type AssertComponentRoute<
    Brand extends ComponentBrand,
    Defs extends readonly AnyCustomId[],
    TCtor extends AnyHandlerCtor
> =
    SameSet<Brand, ComponentOf<TCtor>> extends true
        ? [DefsOf<TCtor>] extends [Defs]
            ? TCtor
            : Mismatch<
                  "the customId definitions do not match the handler generic",
                  Defs,
                  DefsOf<TCtor>
              >
        : Mismatch<
              "the decorator does not match the handler kind",
              Brand,
              ComponentOf<TCtor>
          >;