Skip to content

Commit

Permalink
fix: upgrade less types
Browse files Browse the repository at this point in the history
  • Loading branch information
ntnyq committed Oct 27, 2024
1 parent cce58a4 commit 3eb9c90
Showing 1 changed file with 65 additions and 32 deletions.
97 changes: 65 additions & 32 deletions src/config/packages/less.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
*
* @see https://lesscss.org/usage/#less-options
* @see https://lesscss.org/usage/#less-options-source-map-options
* @compatibility 4.2.0
*/

import type { AnyFn } from '../../utility-types'
import type { AnyFn, LiteralUnion } from '../../utility-types'

export interface LessSourceMap {
outputFilename?: string
Expand Down Expand Up @@ -42,13 +43,6 @@ export interface LessOptions {
*/
plugins?: AnyFn[]

/**
* If true, compress using less built-in compression
*
* @deprecated
*/
compress?: boolean

strictImports?: boolean

/**
Expand All @@ -61,39 +55,27 @@ export interface LessOptions {
maxLineLen?: number

/**
* If false, No color in compiling
*
* @deprecated
*/
color?: boolean

/**
* @deprecated
* @default false
* Add a path to every generated import and url in output css files
*/
ieCompat?: boolean
rootpath?: string

/**
* If true, enable evaluation of JavaScript inline in `.less` files
* allows you to rewrite URLs in imported files so that the URL is always relative to the base file that has been passed to Less
*
* @deprecated
*/
javascriptEnabled?: boolean

/**
* Whether output file information and line numbers in compiled CSS code
*/
dumpLineNumbers?: 'comment' | string

/**
* Add a path to every generated import and url in output css files
* @see https://lesscss.org/usage/#less-options-rewrite-urls
* @default `off`
*/
rootpath?: string
rewriteUrls?: LiteralUnion<'off' | 'all' | 'local'>

/**
* Math mode options for avoiding symbol conflicts on math expressions
* @description
* - `always` (3.x default) - Less does math eagerly
* - `parens-division` (4.0 default) - No division is performed outside of parens using / operator (but can be "forced" outside of parens with ./ operator - ./ is deprecated)
* - `parens` | `strict` - Parens required for all math expressions
* - `strict-legacy` (removed in 4.0) - In some cases, math will not be evaluated if any part of the expression cannot be evaluated
*/
math?: 'always' | 'strict' | 'parens-division' | 'parens' | 'strict-legacy' | number
math?: 'always' | 'strict' | 'parens-division' | 'parens' | 'strict-legacy'

/**
* If true, stops any warnings from being shown
Expand All @@ -102,6 +84,8 @@ export interface LessOptions {

/**
* Without this option, Less attempts to guess at the output unit when it does maths
*
* @default false
*/
strictUnits?: boolean

Expand All @@ -115,10 +99,59 @@ export interface LessOptions {
*/
modifyVars?: Record<string, string>

/**
* This option allows you to specify a argument to go on to every URL, This may be used for cache-busting for instance
*/
urlArgs?: string

/**
* Read files synchronously in Node.js
*/
syncImport?: boolean

/**
* If false, No color in compiling
*
* @deprecated
*/
color?: boolean

/**
* @deprecated
* @default false
*/
ieCompat?: boolean

/**
* If true, compress using less built-in compression
*
* @deprecated use a third-party tool instead
*/
compress?: boolean

/**
* @deprecated use `math` instead
*/
strictMath?: boolean

/**
* @deprecated use `{ rewriteUrls: 'all' }` instead
*/
relativeUrls?: boolean

/**
* Whether output file information and line numbers in compiled CSS code
*
* @deprecated
*/
dumpLineNumbers?: 'comments' | 'mediaquery' | 'all' | string

/**
* If true, enable evaluation of JavaScript inline in `.less` files
*
* @deprecated use `plugins` instead
*/
javascriptEnabled?: boolean

[key: string]: any
}

0 comments on commit 3eb9c90

Please sign in to comment.