Skip to content

lit-ui-router / TypedLitViewComponent

Type Alias: TypedLitViewComponent<T> ​

ts
type TypedLitViewComponent<T> = 
  | ((props) => void)
  | ({
new (props): Pick<LitElement, keyof LitElement> & {
  _uiViewProps?: UIViewInjectedProps<T>;
};
  sticky?: boolean;
});

Defined in: packages/lit-ui-router/src/interface.ts:438

A routed component as a TypedLitStateDeclaration checks it, without inferring the component's own return type.

  • A template function returning void, which accepts any renderable (as Lit's render(): unknown does), so the template's body is never inferred.
  • A LitElement class, checked against LitElement's public members, so its protected render() is never inferred.

Type Parameters ​

Type ParameterDefault type
T extends DefaultResolvesTypeDefaultResolvesType

Union Members ​

Function ​

ts
(props) => void

Function ​

ts
{
new (props): Pick<LitElement, keyof LitElement> & {
  _uiViewProps?: UIViewInjectedProps<T>;
};
  sticky?: boolean;
}

The router always passes props; classes may declare the parameter or not.

Parameters ​

ParameterType
propsUIViewInjectedProps<T>

Returns ​

Pick<LitElement, keyof LitElement> & { _uiViewProps?: UIViewInjectedProps<T>; }

NameTypeDescriptionDefined in
sticky?booleanIf true, the same component instance is reused across state transitionspackages/lit-ui-router/src/interface.ts:454