Urara-Blog/node_modules/.pnpm-store/v3/files/9c/9715d2fa25c9b043cbf2dc5342c566515893dee32b4a4c72e2dc9eece715a8deb52ac21d6324b4ef767839e2b3bb1e33883cbe5d77b9319972d6456d4d6841
2022-08-14 01:14:53 +08:00

67 lines
2.4 KiB
Text

import MagicString from 'magic-string';
import Selector from './Selector';
import Element from '../nodes/Element';
import { Ast, CssHashGetter } from '../../interfaces';
import Component from '../Component';
import { CssNode } from './interfaces';
declare class Rule {
selectors: Selector[];
declarations: Declaration[];
node: CssNode;
parent: Atrule;
constructor(node: CssNode, stylesheet: any, parent?: Atrule);
apply(node: Element): void;
is_used(dev: boolean): boolean;
minify(code: MagicString, _dev: boolean): void;
transform(code: MagicString, id: string, keyframes: Map<string, string>, max_amount_class_specificity_increased: number): boolean;
validate(component: Component): void;
warn_on_unused_selector(handler: (selector: Selector) => void): void;
get_max_amount_class_specificity_increased(): number;
}
declare class Declaration {
node: CssNode;
constructor(node: CssNode);
transform(code: MagicString, keyframes: Map<string, string>): void;
minify(code: MagicString): void;
}
declare class Atrule {
node: CssNode;
children: Array<Atrule | Rule>;
declarations: Declaration[];
constructor(node: CssNode);
apply(node: Element): void;
is_used(_dev: boolean): boolean;
minify(code: MagicString, dev: boolean): void;
transform(code: MagicString, id: string, keyframes: Map<string, string>, max_amount_class_specificity_increased: number): void;
validate(component: Component): void;
warn_on_unused_selector(handler: (selector: Selector) => void): void;
get_max_amount_class_specificity_increased(): any;
}
export default class Stylesheet {
source: string;
ast: Ast;
filename: string;
dev: boolean;
has_styles: boolean;
id: string;
children: Array<Rule | Atrule>;
keyframes: Map<string, string>;
nodes_with_css_class: Set<CssNode>;
constructor({ source, ast, component_name, filename, dev, get_css_hash }: {
source: string;
ast: Ast;
filename: string | undefined;
component_name: string | undefined;
dev: boolean;
get_css_hash: CssHashGetter;
});
apply(node: Element): void;
reify(): void;
render(file: string, should_transform_selectors: boolean): {
code: string;
map: import("magic-string").SourceMap;
};
validate(component: Component): void;
warn_on_unused_selectors(component: Component): void;
}
export {};