import { Resource } from './resource'; import type { GlobalConfig, UrlString } from '../types'; import type { CssLink } from './links'; /** * StylesheetResource represents a CSS stylesheet. * * It parses the stylesheet and exposes its links. Links in CSS are the images and fonts that the * stylesheet refers to, as well as any `@import`ed stylesheets. * * To {@link dry} a stylesheet means expanding any relative URLs in links to absolute URLs. * * @category Resources */ export declare class StylesheetResource extends Resource { private _url; private _links; private _config; private _getString; /** * @param stylesheetContent - The stylesheet’s content, a string of CSS. * @param url - The stylesheets URL. Relevant for expanding any relative URLs it may contain. * @param config - Optional environment configuration. */ constructor(stylesheetContent: string, url: UrlString, config?: GlobalConfig); get url(): `${string}:${string}`; /** * The stylesheet’s current content, as a Blob of CSS. * * Any modifications that were made to the stylesheet’s {@link links} are included. */ get blob(): Blob; /** * The stylesheet’s current content, as a string of CSS. * * Any modifications that were made to the stylesheet’s {@link links} are included. */ get string(): string; /** * Get the links defined in the stylesheet. * * Links in CSS are the images and fonts that the stylesheet refers to, as well as any * `@import`ed stylesheets. * * The target of a {@link Link} can be modified, which updates the resource content accordingly. * * Note that currently, all links we find in a stylesheet are subresource links. */ get links(): CssLink[]; /** * Create a StylesheetResource from a Blob of CSS and a URL. */ static fromBlob({ blob, url, config }: { blob: Blob; url: UrlString; config?: GlobalConfig; }): Promise; }