Lime Web Components API Documentation - v7.4.0
    Preparing search index...

    Type Alias MatchedComponent

    MatchedComponent: ComponentDescriptor<RouteParam> & Required<
        Pick<ComponentDescriptor<RouteParam>, "props">,
    >

    Result from matching a path to a registered route

    Contains the component name and extracted path parameters from the URL. Returned by RouteRegistry.findComponent. The fields are described on ComponentDescriptor, which this narrows so that a match always carries props, even when the path had no parameters.

    Only props is narrowed, on purpose. Widening this to every field of ComponentDescriptor would make each field added there required here too, which is a contract the router never agreed to.

    import type { MatchedComponent } from '@limetech/lime-web-components';

    // Registered as '/users/:userId/posts/:postId' and matched against
    // '/users/123/posts/456'
    const match: MatchedComponent = {
    name: 'post-viewer',
    props: { userId: 123, postId: 456 },
    };