@dynamicss/dynamicss
Version:
Manage CSS style sheets with javascript
51 lines (50 loc) • 1.96 kB
TypeScript
import { DynamicSheet, DynamicSheetRule } from "./DynamicStyle/DynamicStyle";
export declare namespace DynamiCSS {
/**
* Inserts a stylesheet into the DOM.
* When an error occurs returns an empty string
* @param dynamicSheet a dyncamic sheet
* @return the id of the stylesheet in string format
*/
function insertStyleSheet(dynamicSheet: DynamicSheet | undefined | null): string;
/**
*
* @param id the id of he style sheet
* @param sheetRules the set of rules
* @returns an empty string or the id
*/
function editStyleSheet(id: string | undefined | null, sheetRules: DynamicSheetRule[] | null): string;
/**
* Given an id in string format, checks into the DOM whether there is a style
* with the given id. If true, this function will remove the stylesheet and return the id.
* If not present, will return an empty string
* @param id the id of the stylesheet to remove if exists
* @returns the id or an empty string
*/
function removeStyleSheet(id: string | null | undefined): string;
/**
* Given an id in string format, checks into the DOM whether there is a style
* with the given id exists and returna boolean result
* @param id the id of the stylesheet to check if exists
* @returns true if the stylesheet was found
*/
function existStyleSheet(id: string | undefined | null): boolean;
/**
* Creates a stylesheet given a stylesheet
* @param styleSheet astylesheet
* @returns the new stylesheet object
*/
function makeStyleSheet(styleSheet: DynamicSheet | undefined | null): DynamicSheet;
}
/**
*
* @param className
* @returns
*/
export declare function makeRawRuleLabel(className: string): string;
/**
*
* @param sheetRules
* @returns
*/
export declare function toRawStyleSheet(sheetRules: DynamicSheetRule[] | null | undefined): string;