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

View File

@@ -0,0 +1,4 @@
import type { Declaration } from 'postcss';
declare const acosFunctionCheck = "acos(";
declare function transformAcosFunction(decl: Declaration): string | undefined;
export { acosFunctionCheck, transformAcosFunction };

View File

@@ -0,0 +1,4 @@
import type { Declaration } from 'postcss';
declare const asinFunctionCheck = "asin(";
declare function transformAsinFunction(decl: Declaration): string | undefined;
export { asinFunctionCheck, transformAsinFunction };

View File

@@ -0,0 +1,4 @@
import type { Declaration } from 'postcss';
declare const atanFunctionCheck = "atan(";
declare function transformAtanFunction(decl: Declaration): string | undefined;
export { atanFunctionCheck, transformAtanFunction };

View File

@@ -0,0 +1,4 @@
import type { Declaration } from 'postcss';
declare const atan2FunctionCheck = "atan2(";
declare function transformAtan2Function(decl: Declaration): string | undefined;
export { atan2FunctionCheck, transformAtan2Function };

View File

@@ -0,0 +1,4 @@
import type { Declaration } from 'postcss';
declare const cosFunctionCheck = "cos(";
declare function transformCosFunction(decl: Declaration): string | undefined;
export { cosFunctionCheck, transformCosFunction };

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,6 @@
import type { PluginCreator } from 'postcss';
declare type pluginOptions = {
preserve?: 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,4 @@
import type { Declaration } from 'postcss';
declare const sinFunctionCheck = "sin(";
declare function transformSinFunction(decl: Declaration): string | undefined;
export { sinFunctionCheck, transformSinFunction };

View File

@@ -0,0 +1,4 @@
import type { Declaration } from 'postcss';
declare const tanFunctionCheck = "tan(";
declare function transformTanFunction(decl: Declaration): string | undefined;
export { tanFunctionCheck, transformTanFunction };

View File

@@ -0,0 +1,61 @@
import type { FunctionNode, WordNode, Node } from 'postcss-value-parser';
export declare function turnToRad(turn: number): number;
export declare function degToRad(deg: number): number;
export declare function gradToRad(grad: number): number;
export declare function radToDeg(rad: number): number;
export declare function gradToDeg(grad: number): number;
export declare function turnToDeg(turn: number): number;
declare const toRad: {
turn: typeof turnToRad;
deg: typeof degToRad;
grad: typeof gradToRad;
};
declare const toDeg: {
grad: typeof gradToDeg;
turn: typeof turnToDeg;
rad: typeof radToDeg;
};
export declare function filterOnlyWords(node: Node): boolean;
/**
* Try to compute a calculation from a Node.
*
* This validates that the calculation has a valid order which is:
* - `{Number} {Operation} {Number} ...`
*
* Only basic arithmetic operations are allowed, and it has to be separate words
* similarly to how CSS calc works:
*
* - `sin(3.14159 * 2)` -> is valid
* - `sin(3.14159*2)` -> is not valid
*
*
* @param {FunctionNode} nodes Nodes to be parsed
* @param {Boolean} ignoreUnit Whether units are ignored or converted to radians
* @return {FunctionNode} Returns the node, if it managed to calculate, it will
* simplify inner nodes.
* @see https://www.w3.org/TR/css-values-4/#trig-funcs
*/
export declare function computeCalculation(nodes: Node[], ignoreUnit?: boolean): Node[];
export declare function functionNodeToWordNode(fn: FunctionNode): WordNode;
/**
* Formats a number that's intended to be put into CSS.
*
* Due to processing of Number(number.toFixed(decimals)) this will get
* rid of ending zeroes, usually helping with the rounding which is the
* intended effect.
*
* For example, converting 4.71238898038469 radians into deg leads to
* 270.000000000669786 which is going to result as 270 unless a
* precision of 10 is chosen.
*
* @param {Number} number Number to be formatted
* @param {Number} decimals Precision of decimals, CSS doesn't usually handle further than 5.
*/
export declare function formatResultingNumber(number: number, decimals: number): string;
export declare function parseNumber(value: string): false | {
number: any;
unit: string;
};
declare type validateNodeReturn = [WordNode, number] | undefined;
export declare function validateNode(node: FunctionNode, parseUnit?: boolean): validateNodeReturn;
export { toRad, toDeg };