Skip to content

Commit c40069e

Browse files
committed
Fix the API files
1 parent a1808b8 commit c40069e

File tree

3 files changed

+120
-62
lines changed

3 files changed

+120
-62
lines changed

lib/less/environment/api.js

Lines changed: 0 additions & 62 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module.exports = {
2+
/**
3+
* Converts a string to a base 64 string
4+
* @param str
5+
*/
6+
encodeBase64: function(str) {
7+
},
8+
/**
9+
* Lookup the mime-type of a filename
10+
* @param filename
11+
*/
12+
mimeLookup: function (filename) {
13+
},
14+
/**
15+
* Look up the charset of a mime type
16+
* @param mime
17+
*/
18+
charsetLookup: function (mime) {
19+
},
20+
/**
21+
* Gets a source map generator
22+
*/
23+
getSourceMapGenerator: function getSourceMapGenerator() {
24+
}
25+
};
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
module.exports = {
2+
/**
3+
* Given the full path to a file, return the path component
4+
* Provided by AbstractFileManager
5+
* @param {string} filename
6+
* @returns {string}
7+
*/
8+
getPath: function(filename) {
9+
},
10+
/**
11+
* Whether the rootpath should be converted to be absolute.
12+
* The browser ovverides this to return true because urls must be absolute.
13+
* Provided by AbstractFileManager (returns false)
14+
* @returns {bool}
15+
*/
16+
alwaysMakePathsAbsolute: function() {
17+
},
18+
/**
19+
* Returns whether a path is absolute
20+
* Provided by AbstractFileManager
21+
* @param {string} path
22+
* @returns {bool}
23+
*/
24+
isPathAbsolute: function(path) {
25+
},
26+
/**
27+
* joins together 2 paths
28+
* Provided by AbstractFileManager
29+
* @param {string} basePath
30+
* @param {string} laterPath
31+
*/
32+
join: function(basePath, laterPath) {
33+
},
34+
/**
35+
* Returns the difference between 2 paths
36+
* E.g. url = a/ baseUrl = a/b/ returns ../
37+
* url = a/b/ baseUrl = a/ returns b/
38+
* Provided by AbstractFileManager
39+
* @param {string} url
40+
* @param {string} baseUrl
41+
* @returns {string}
42+
*/
43+
pathDiff: function(url, baseUrl) {
44+
},
45+
/**
46+
* Returns whether this file manager supports this file for syncronous file retrieval
47+
* If true is returned, loadFileSync will then be called with the file.
48+
* Provided by AbstractFileManager (returns false)
49+
* @param {string} filename
50+
* @param {string} currentDirectory
51+
* @param {object} options
52+
* @param {less.environment.environment} environment
53+
* @returns {bool}
54+
*/
55+
supportsSync: function(filename, currentDirectory, options, environment) {
56+
},
57+
/**
58+
*
59+
* @param {string} filename
60+
* @param {string} currentDirectory
61+
* @param {object} options
62+
* @param {less.environment.environment} environment
63+
* @returns {bool}
64+
*/
65+
supports: function(filename, currentDirectory, options, environment) {
66+
},
67+
/**
68+
* Loads a file asynchronously. Expects a promise that either rejects with an error or fullfills with an
69+
* object containing
70+
* { filename: - full resolved path to file
71+
* contents: - the contents of the file, as a string }
72+
*
73+
* @param {string} filename
74+
* @param {string} currentDirectory
75+
* @param {object} options
76+
* @param {less.environment.environment} environment
77+
* @returns {Promise}
78+
*/
79+
loadFile: function(filename, currentDirectory, options, environment) {
80+
},
81+
/**
82+
* Loads a file synchronously. Expects an immediate return with an object containing
83+
* { error: - error object if an error occurs
84+
* filename: - full resolved path to file
85+
* contents: - the contents of the file, as a string }
86+
*
87+
* @param {string} filename
88+
* @param {string} currentDirectory
89+
* @param {object} options
90+
* @param {less.environment.environment} environment
91+
* @returns {object} should be an object containing error or contents and filename
92+
*/
93+
loadFileSync: function(filename, currentDirectory, options, environment) {
94+
}
95+
};

0 commit comments

Comments
 (0)