@types/less
Advanced tools
Comparing version 3.0.1 to 3.0.2
@@ -33,2 +33,4 @@ // Type definitions for LESS 3.x | ||
addPreProcessor(preProcessor: PreProcessor, priority?: number): void; | ||
addFileManager(fileManager: FileManager): void; | ||
} | ||
@@ -38,2 +40,3 @@ | ||
install: (less: LessStatic, pluginManager: PluginManager) => void; | ||
minVersion?: [number, number, number]; | ||
} | ||
@@ -57,2 +60,104 @@ | ||
interface FileLoadResult { | ||
/** Full resolved path to file. */ | ||
filename: string; | ||
/** The contents of the file, as a string. */ | ||
contents: string; | ||
} | ||
interface FileLoadError { | ||
/** Error object if an error occurs. */ | ||
error: unknown; | ||
} | ||
class FileManager extends AbstractFileManager { | ||
/** | ||
* Returns whether this file manager supports this file for file retrieval | ||
* If true is returned, loadFile will then be called with the file. | ||
*/ | ||
supports(filename: string, currentDirectory: string, options: LoadFileOptions, environment: Environment): boolean; | ||
/** | ||
* Loads a file asynchronously. Expects a promise that either rejects with an error or fulfills with a FileLoadResult. | ||
*/ | ||
loadFile(filename: string, currentDirectory: string, options: LoadFileOptions, environment: Environment): Promise<FileLoadResult>; | ||
/** | ||
* Loads a file synchronously. Expects an immediate return with wither a FileLoadResult or FileLoadError. | ||
*/ | ||
loadFileSync(filename: string, currentDirectory: string, options: LoadFileOptions, environment: Environment): FileLoadResult | FileLoadError; | ||
} | ||
class AbstractFileManager { | ||
/** | ||
* Given the full path to a file, return the path component. | ||
*/ | ||
getPath(filename: string): string; | ||
/** | ||
* Append a .less extension if appropriate. Only called if less thinks one could be added. | ||
*/ | ||
tryAppendLessExtension(filename: string): string; | ||
/** | ||
* Whether the rootpath should be converted to be absolute. | ||
* The browser ovverides this to return true because urls must be absolute. | ||
*/ | ||
alwaysMakePathsAbsolute(): boolean; | ||
/** | ||
* Returns whether a path is absolute. | ||
*/ | ||
isPathAbsolute(path: string): boolean; | ||
/** | ||
* Joins together 2 paths. | ||
*/ | ||
join(basePath: string, laterPath: string): string; | ||
/** | ||
* Returns the difference between 2 paths | ||
* E.g. url = a/ baseUrl = a/b/ returns ../ | ||
* url = a/b/ baseUrl = a/ returns b/ | ||
*/ | ||
pathDiff(url: string, baseUrl: string): string; | ||
/** | ||
* Returns whether this file manager supports this file for syncronous file retrieval | ||
* If true is returned, loadFileSync will then be called with the file. | ||
*/ | ||
supportsSync(filename: string, currentDirectory: string, options: LoadFileOptions, environment: Environment): boolean; | ||
} | ||
interface LoadFileOptions { | ||
paths?: string[]; | ||
prefixes?: string[]; | ||
ext?: string; | ||
rawBuffer?: any; | ||
syncImport?: boolean; | ||
} | ||
interface Environment { | ||
/** | ||
* Converts a string to a base 64 string | ||
*/ | ||
encodeBase64(str: string): string; | ||
/** | ||
* Lookup the mime-type of a filename | ||
*/ | ||
mimeLookup(filename: string): string; | ||
/** | ||
* Look up the charset of a mime type | ||
*/ | ||
charsetLookup(mime: string): string; | ||
/** | ||
* Gets a source map generator | ||
*/ | ||
getSourceMapGenerator(): any; | ||
} | ||
interface SourceMapOption { | ||
@@ -173,2 +278,5 @@ sourceMapURL?: string; | ||
watch(): void; | ||
FileManager: typeof Less.FileManager; | ||
PluginManager: typeof Less.PluginManager; | ||
} | ||
@@ -175,0 +283,0 @@ |
{ | ||
"name": "@types/less", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "TypeScript definitions for LESS", | ||
@@ -29,3 +29,3 @@ "license": "MIT", | ||
"main": "", | ||
"types": "index", | ||
"types": "index.d.ts", | ||
"repository": { | ||
@@ -38,4 +38,4 @@ "type": "git", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "a8580f1ccd42fa3bb5d57a3d9746644c5c2f0bed63a61a6cdde3eb485146e243", | ||
"typeScriptVersion": "2.0" | ||
"typesPublisherContentHash": "80a7d917306801b6b1fa53c2982004471dd64640f849b3d7096c2e0d2eddf9f6", | ||
"typeScriptVersion": "3.3" | ||
} |
@@ -8,10 +8,10 @@ # Installation | ||
# Details | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/less | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/less. | ||
Additional Details | ||
* Last updated: Fri, 25 Oct 2019 20:27:33 GMT | ||
### Additional Details | ||
* Last updated: Fri, 04 Dec 2020 06:23:40 GMT | ||
* Dependencies: none | ||
* Global values: Less, less | ||
* Global values: `Less`, `less` | ||
# Credits | ||
These definitions were written by Tom Hasner <https://github.com/thasner>, Pranay Prakash <https://github.com/pranaygp>, Daniel Waxweiler <https://github.com/dwaxweiler>, and Richard Lea <https://github.com/chigix>. | ||
These definitions were written by [Tom Hasner](https://github.com/thasner), [Pranay Prakash](https://github.com/pranaygp), [Daniel Waxweiler](https://github.com/dwaxweiler), and [Richard Lea](https://github.com/chigix). |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12056
238