@stencila/thema
Version:
Themes for executable documents
39 lines (38 loc) • 1.48 kB
TypeScript
export declare const ASSET_PATH: string;
export interface ThemeObject {
[key: string]: string;
}
/**
* The keys used to refer to which example and
* which theme the user wants to see.
*/
export declare enum keys {
EXAMPLE = "example",
THEME = "theme",
HEADER = "header"
}
/**
* Create an object consisting only of changed values
*
* @function diff
* @param {Object} original - Source object to compare against
* @param {Object} updated - New object with partially updated values
* @return {Object} Object containing keys with changed values
*/
export declare const diff: <O extends Record<string, unknown>>(original: O, updated: O) => O;
/**
* Convert a JS object to a stringified CSS rule, using object keys as variable names.
*
* @function objToVars
* @param {Object} obj - JS Object, where the keys are variable names (without leading `--` dashes)
* @param {boolean} [compile] - If true, translates Stencila's Custom `:--root` Selector into `[data-itemscope='root']`
* @return {string} Stringified CSS styleesheet containing variable declarations
*/
export declare const objToVars: (obj: ThemeObject, compile?: boolean) => string;
/**
* Submit a PR to https://github.com/stencila/thema for a new theme.
*
* Uses the github `/new` route to create a new `styles.css` file
* within `src/themes/<new-theme-name>` folder.
*/
export declare const submitPR: (name: string, theme: ThemeObject, baseName: string, baseTheme: ThemeObject) => void;