element-vir - v26.14.0
    Preparing search index...

    Function wrapDefineElement

    • Wraps defineElement in a superset of requirements. For example:

      • You could create element definition functions that require all elements to start with a common prefix, like vir-.
      • You could create element definition functions that require all elements to have at least a specified set of input properties.
      • Etc.

      Type Parameters

      Parameters

      • Optionaloptions: PartialWithNullable<
            {
                assertInputs: (
                    inputInit: DeclarativeElementInit<
                        `${string}-${string}`,
                        {},
                        {},
                        {},
                        `${string}-${string}-${string}`,
                        `${string}-${string}-${string}`,
                        readonly string[],
                        readonly string[],
                    >,
                ) => void;
                transformInputs: (
                    inputInit: DeclarativeElementInit<
                        `${string}-${string}`,
                        {},
                        {},
                        {},
                        `${string}-${string}-${string}`,
                        `${string}-${string}-${string}`,
                        readonly string[],
                        readonly string[],
                    >,
                ) => DeclarativeElementInit<
                    `${string}-${string}`,
                    {},
                    {},
                    {},
                    `${string}-${string}-${string}`,
                    `${string}-${string}-${string}`,
                    readonly string[],
                    readonly string[],
                >;
            },
        >

      Returns <Inputs extends PropertyInitMapBase>(
          ...errorParams: DeclarativeElementInputErrorParams<Inputs>,
      ) => <
          const TagName extends `${string}-${string}`,
          State extends PropertyInitMapBase,
          EventsInit extends EventsInitMap,
          const HostClassKeys extends `${string}-${string}-${string}` = `${TagName}-`,
          const CssVarKeys extends `${string}-${string}-${string}` = `${TagName}-`,
          const SlotNames extends readonly string[] = readonly [],
          const TestIds extends readonly string[] = readonly [],
      >(
          inputs: DeclarativeElementInit<
              TagName,
              Inputs,
              State,
              EventsInit,
              HostClassKeys,
              CssVarKeys,
              SlotNames,
              TestIds,
          >,
      ) => DeclarativeElementDefinition<
          TagName,
          Inputs,
          State,
          EventsInit,
          HostClassKeys,
          CssVarKeys,
          SlotNames,
          TestIds,
      >