@hypothesis/frontend-shared
Version:
Shared components, styles and utilities for Hypothesis projects
31 lines (30 loc) • 1.12 kB
TypeScript
import type { FunctionComponent } from 'preact';
export declare const componentGroups: {
readonly data: "Data Display";
readonly feedback: "Feedback";
readonly input: "Input";
readonly layout: "Layout";
readonly navigation: "Navigation";
readonly transition: "Transitions";
};
export type PlaygroundRouteGroup = keyof typeof componentGroups | 'home' | 'foundations' | 'components' | 'hooks' | 'prototype' | 'custom';
/**
* Route "handler" that provides a component (function) that should be rendered
* for the indicated route
*/
export type PlaygroundRoute = {
/**
* Pattern or string path relative to `baseURL`, e.g. '/data-my-component'. If
* not provided, a placeholder entry for this route will be added to the
* navigation, with no link.
*/
route?: string;
title: string;
component?: FunctionComponent;
group: PlaygroundRouteGroup;
};
export type CustomPlaygroundRoute = Omit<PlaygroundRoute, 'group'>;
/**
* Retrieve all routes or the subset in group `group`.
*/
export declare function getRoutes(group?: PlaygroundRouteGroup): PlaygroundRoute[];