interface Config {
    isConfig(
        config: unknown,
        options?: { raiseException?: boolean },
    ): config is Dynamic | Standard;
    isConfigEmbed(
        config: unknown,
        options?: { raiseException?: boolean },
    ): config is Embed;
    parseConfig(
        config: Dynamic | Standard,
        options?: { thisArg?: unknown },
    ): Parsed;
}

Methods

  • Validates config argument whether it is a valid TJSSvelte.Config.Dynamic or TJSSvelte.Config.Standard configuration object suitable for parsing by TJSSvelte.API.Config.parseConfig.

    Parameters

    • config: unknown

      The potential config object to validate.

    • Optionaloptions: { raiseException?: boolean }

      Options.

      • OptionalraiseException?: boolean

        If validation fails raise an exception.

    Returns config is Dynamic | Standard

    Is the config a valid TJSSvelte.Config.Dynamic or TJSSvelte.Config.Standard configuration object.

    Any validation error when raiseException is enabled.

  • Validates config argument whether it is a valid TJSSvelte.Config.Embed configuration object suitable for directly mounting via the <svelte:component> directive.

    Parameters

    • config: unknown

      The potential config object to validate.

    • Optionaloptions: { raiseException?: boolean }

      Options.

      • OptionalraiseException?: boolean

        If validation fails raise an exception.

    Returns config is Embed

    Is the config a valid TJSSvelte.Config.Embed configuration object.

    Any validation error when raiseException is enabled.

  • Parses a TyphonJS Svelte dynamic or standard config object ensuring that the class specified is a Svelte component, loads any dynamic defined context or props preparing the config object for loading into the Svelte component.

    Parameters

    • config: Dynamic | Standard

      Svelte config object.

    • Optionaloptions: { thisArg?: unknown }

      Options.

      • OptionalthisArg?: unknown

        This reference to set for invoking any context or props defined as functions for Config.Dynamic configuration objects.

    Returns Parsed

    The processed Svelte config object turned with parsed props & context converted into the format supported by Svelte.