@hypothesis/frontend-shared
Version:
Shared components, styles and utilities for Hypothesis projects
36 lines (35 loc) • 1.01 kB
TypeScript
/**
* Retrieve all routes or the subset in group `group`.
*
* @param {PlaygroundRouteGroup} [group]
* @returns {PlaygroundRoute[]}
*/
export function getRoutes(group?: PlaygroundRouteGroup | undefined): PlaygroundRoute[];
export namespace componentGroups {
const data: string;
const feedback: string;
const input: string;
const layout: string;
const navigation: string;
}
export type PlaygroundRouteGroup = keyof {
data: string;
feedback: string;
input: string;
layout: string;
navigation: string;
} | 'home' | 'foundations' | 'patterns' | 'components';
/**
* - 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. '/my-patterns'
*/
route?: string | RegExp | undefined;
title: string;
component?: import("preact").FunctionComponent<{}> | undefined;
group: PlaygroundRouteGroup;
};