source: frontend/node_modules/@csstools/postcss-trigonometric-functions/dist/utils.d.ts

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 13 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 2.4 KB
Line 
1import type { FunctionNode, WordNode, Node } from 'postcss-value-parser';
2export declare function turnToRad(turn: number): number;
3export declare function degToRad(deg: number): number;
4export declare function gradToRad(grad: number): number;
5export declare function radToDeg(rad: number): number;
6export declare function gradToDeg(grad: number): number;
7export declare function turnToDeg(turn: number): number;
8declare const toRad: {
9 turn: typeof turnToRad;
10 deg: typeof degToRad;
11 grad: typeof gradToRad;
12};
13declare const toDeg: {
14 grad: typeof gradToDeg;
15 turn: typeof turnToDeg;
16 rad: typeof radToDeg;
17};
18export declare function filterOnlyWords(node: Node): boolean;
19/**
20 * Try to compute a calculation from a Node.
21 *
22 * This validates that the calculation has a valid order which is:
23 * - `{Number} {Operation} {Number} ...`
24 *
25 * Only basic arithmetic operations are allowed, and it has to be separate words
26 * similarly to how CSS calc works:
27 *
28 * - `sin(3.14159 * 2)` -> is valid
29 * - `sin(3.14159*2)` -> is not valid
30 *
31 *
32 * @param {FunctionNode} nodes Nodes to be parsed
33 * @param {Boolean} ignoreUnit Whether units are ignored or converted to radians
34 * @return {FunctionNode} Returns the node, if it managed to calculate, it will
35 * simplify inner nodes.
36 * @see https://www.w3.org/TR/css-values-4/#trig-funcs
37 */
38export declare function computeCalculation(nodes: Node[], ignoreUnit?: boolean): Node[];
39export declare function functionNodeToWordNode(fn: FunctionNode): WordNode;
40/**
41 * Formats a number that's intended to be put into CSS.
42 *
43 * Due to processing of Number(number.toFixed(decimals)) this will get
44 * rid of ending zeroes, usually helping with the rounding which is the
45 * intended effect.
46 *
47 * For example, converting 4.71238898038469 radians into deg leads to
48 * 270.000000000669786 which is going to result as 270 unless a
49 * precision of 10 is chosen.
50 *
51 * @param {Number} number Number to be formatted
52 * @param {Number} decimals Precision of decimals, CSS doesn't usually handle further than 5.
53 */
54export declare function formatResultingNumber(number: number, decimals: number): string;
55export declare function parseNumber(value: string): false | {
56 number: any;
57 unit: string;
58};
59declare type validateNodeReturn = [WordNode, number] | undefined;
60export declare function validateNode(node: FunctionNode, parseUnit?: boolean): validateNodeReturn;
61export { toRad, toDeg };
Note: See TracBrowser for help on using the repository browser.