Interface Standard<Component, Config>

Defines the TRL / client side configuration object to load a Svelte component that is suitable to use with TJSSvelte.API.Config.parseConfig.

interface Standard<
    Component extends SvelteComponent = SvelteComponent,
    Config extends
        {
            ContextOmit?: keyof NonNullable<Config["ContextShape"]>;
            ContextShape?: { [key: string]: any };
            PropsOmit?: keyof ComponentProps<Component>;
        } = { ContextOmit: never; ContextShape: {}; PropsOmit: never },
> {
    anchor?: Element;
    class: new (
        options: ComponentConstructorOptions<ComponentProps<Component>>,
    ) => Component;
    context?: NarrowContextObject<Config>;
    intro?: boolean;
    props?: Partial<Omit<ComponentProps<Component>, Config["PropsOmit"]>>;
    target?: Element | Document | ShadowRoot;
}

Type Parameters

  • Component extends SvelteComponent = SvelteComponent

    A specific component to narrow the allowed class and props.

  • Config extends {
        ContextOmit?: keyof NonNullable<Config["ContextShape"]>;
        ContextShape?: { [key: string]: any };
        PropsOmit?: keyof ComponentProps<Component>;
    } = { ContextOmit: never; ContextShape: {}; PropsOmit: never }

    Additional options to omit properties from allowed in context or props.

Properties

anchor?: Element

A child of target to render the component immediately before.

The Svelte component class / constructor function.

context?: NarrowContextObject<Config>

The root-level additional data to add to the context passed to the component.

intro?: boolean

If true, will play transitions on initial render, rather than waiting for subsequent state changes.

props?: Partial<Omit<ComponentProps<Component>, Config["PropsOmit"]>>

Props to pass to the component. You may define props as an object.

The target to render component to. By default, document.body is used as the target if not otherwise defined.