css-kits
Version:
Parse css to javascript object. Support change class and id
25 lines (24 loc) • 899 B
TypeScript
import { StyleSheet } from '../types';
export declare function mkResult<T>(callbackFn: () => T): T;
export interface StyleForEachEventData {
type: 'open-comment' | 'close-comment' | 'open-string' | 'close-string';
value: string;
index: number;
breakForEach: () => void;
}
export type StyleForEachCallback = (e: {
value: string;
index: number;
breakForEach: () => void;
}) => void;
export interface StyleForEachProps {
subject: string;
callbackFn?: StyleForEachCallback;
eventFn?: (e: StyleForEachEventData) => void;
}
/**
* forEach ignore string and comment
*/
export declare function styleForEach(props: StyleForEachProps): void;
export type SelectorsMapCallbackFn = (selector: string) => string;
export declare function selectorsMap(styleSheetList: StyleSheet[], callbackFn: SelectorsMapCallbackFn, clone?: boolean): StyleSheet[];