This commit is contained in:
Iliyan Angelov
2025-09-14 23:24:25 +03:00
commit c67067a2a4
71311 changed files with 6800714 additions and 0 deletions

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,16 @@
import type { PluginCreator } from 'postcss';
import type { ImportOptions, ExportOptions } from './lib/options';
export interface PluginOptions {
/** Do not emit warnings about "importFrom" and "exportTo" deprecations */
disableDeprecationNotice?: boolean;
/** Determines whether Custom Properties and properties using custom properties should be preserved in their original form. */
preserve?: boolean;
/** Specifies sources where Custom Properties can be imported from, which might be CSS, JS, and JSON files, functions, and directly passed objects. */
importFrom?: ImportOptions | Array<ImportOptions>;
/** Specifies destinations where Custom Properties can be exported to, which might be CSS, JS, and JSON files, functions, and directly passed objects. */
exportTo?: ExportOptions | Array<ExportOptions>;
/** Specifies if `importFrom` properties or `:root` properties have priority. */
overrideImportFromWithRoot?: boolean;
}
declare const creator: PluginCreator<PluginOptions>;
export default creator;

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
import type { ImportOptions } from './options';
import valuesParser from 'postcss-value-parser';
export default function getCustomPropertiesFromImports(sources: Array<ImportOptions>): Promise<Map<string, valuesParser.ParsedValue>>;

View File

@@ -0,0 +1,2 @@
import valuesParser from 'postcss-value-parser';
export default function getCustomPropertiesFromRoot(root: any, opts: any): Map<string, valuesParser.ParsedValue>;

View File

@@ -0,0 +1,4 @@
import type { Container, Declaration } from 'postcss';
declare function isBlockIgnored(container: Container): any;
declare function isDeclarationIgnored(decl: Declaration): boolean;
export { isBlockIgnored, isDeclarationIgnored, };

View File

@@ -0,0 +1,26 @@
export declare type ImportFromSource = {
from: string;
type?: string;
} | string;
export declare type ImportCustomProperties = {
customProperties?: Record<string, string>;
'custom-properties'?: Record<string, string>;
};
export declare type ImportAsFunction = () => ImportFromSource | ImportCustomProperties;
export declare type ImportAsPromise = Promise<ImportFromSource | ImportCustomProperties>;
export declare type ImportAsFunctionPromise = () => Promise<ImportFromSource | ImportCustomProperties>;
export declare type ImportOptions = ImportFromSource | ImportCustomProperties | ImportAsFunction | ImportAsPromise | ImportAsFunctionPromise;
export declare type ExportJSONFunction = (customProperties?: Record<string, string>) => Record<string, string>;
export declare type ExportToSource = {
to: string;
type?: string;
toJSON: ExportJSONFunction;
} | string;
export declare type ExportCustomProperties = {
customProperties?: Record<string, string>;
'custom-properties'?: Record<string, string>;
toJSON: ExportJSONFunction;
};
export declare type ExportAsFunction = (ExportCustomProperties: any) => void;
export declare type ExportAsFunctionPromise = (ExportCustomProperties: any) => Promise<void>;
export declare type ExportOptions = ExportToSource | ExportCustomProperties | ExportAsFunction | ExportAsFunctionPromise;

View File

@@ -0,0 +1,2 @@
declare const _default: (decl: any, customProperties: any, opts: any) => void;
export default _default;

View File

@@ -0,0 +1 @@
export default function transformValueAST(root: any, customProperties: any): any;

View File

@@ -0,0 +1,2 @@
import type { ExportOptions } from './options';
export default function writeCustomPropertiesToExports(customProperties: any, destinations: Array<ExportOptions>): Promise<void[]>;