UNPKG

2.42 kBTypeScriptView Raw
1/**
2 * Copyright 2020 Inrupt Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal in
6 * the Software without restriction, including without limitation the rights to use,
7 * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8 * Software, and to permit persons to whom the Software is furnished to do so,
9 * subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16 * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20 */
21import { Theme } from "@material-ui/core";
22import { ThemeOptions } from "@material-ui/core/styles";
23import { Typography, TypographyStyle } from "@material-ui/core/styles/createTypography";
24import { JssStyle } from "jss";
25import { Palette } from "@material-ui/core/styles/createPalette";
26import { IconSetConfiguration, IconStyles } from "./icon";
27export interface ThemeConfiguration extends ThemeOptions {
28 name: string;
29 label: string;
30 localFonts?: Record<string, (path: string) => string>;
31 stylesheets?: string[];
32 licenses?: string[];
33 iconSet: ThemeIcons;
34}
35export interface ThemeIcons {
36 config: IconSetConfiguration;
37 styles: (theme: PrismTheme) => IconStyles;
38 iconColor: (color: string) => JssStyle;
39}
40interface PrismPalette extends Palette {
41 adjustAlpha: (color: string, alpha: number) => string;
42}
43interface PrismTypography extends Typography {
44 body: TypographyStyle;
45 heading: TypographyStyle;
46}
47export interface PrismTheme extends Theme {
48 icons: ThemeIcons;
49 palette: PrismPalette;
50 typography: PrismTypography;
51}
52export interface CreatePrismThemeOptions {
53 icons: ThemeIcons;
54}
55export declare function createPrismTheme(configuration: ThemeConfiguration, options?: Partial<CreatePrismThemeOptions>, ...args: object[]): PrismTheme;
56export {};