UNPKG

@stencila/thema

Version:

Themes for executable documents

40 lines (39 loc) 1.51 kB
import { themes } from '../themes/index'; export { themes }; export interface ThemaAssets { styles: string[]; scripts: string[]; } /** * The path to a theme in this package */ export declare const themePath = "dist/themes"; /** * The conventional name for theme stylesheets */ export declare const styleEntry = "styles.css"; /** * The conventional name for theme JavaScript */ export declare const scriptEntry = "index.js"; export declare type ThemeNames = keyof typeof themes; /** * Tests whether a given string is a valid Thema theme or not. * * @param {string} name Name of the theme */ export declare const isTheme: (theme: string) => theme is "bootstrap" | "elife" | "f1000" | "galleria" | "giga" | "latex" | "nature" | "plos" | "rpng" | "skeleton" | "stencila" | "tufte" | "wilmore"; /** * Return a CDN link to an asset, cleaning up any Windows specific path separators. */ export declare const generateCDNUrl: (asset: string) => string; /** * Given a string, will return a matching theme assets, relative to the project root, * returns undefined if a theme cannot be found. * * @param {string} theme - Name of the theme to look for * @param {boolean | undefined} asCDNUrl - If true, returns the assets as URLs pointing to UNPKG hosted files. * @return {ThemaAssets | undefined} Object containing two arrays, one of all the themes stylesheets, and one of all * scripts. */ export declare const getTheme: (theme: string, asCDNUrl?: boolean | undefined) => ThemaAssets | undefined;