mirror of
https://github.com/less/less.js.git
synced 2026-01-20 04:38:02 -05:00
Fix the API files
This commit is contained in:
@@ -1,62 +0,0 @@
|
||||
module.exports = {
|
||||
/**
|
||||
* Warns the user about something
|
||||
* @param {String} msg - the message about the warning
|
||||
*/
|
||||
warn: function(msg) {
|
||||
},
|
||||
/**
|
||||
* Converts a string to a base 64 string
|
||||
* @param str
|
||||
*/
|
||||
encodeBase64: function(str) {
|
||||
},
|
||||
/**
|
||||
* Lookup the mime-type of a filename
|
||||
* @param filename
|
||||
*/
|
||||
mimeLookup: function (filename) {
|
||||
},
|
||||
/**
|
||||
* Look up the charset of a mime type
|
||||
* @param mime
|
||||
*/
|
||||
charsetLookup: function (mime) {
|
||||
},
|
||||
/**
|
||||
*
|
||||
*/
|
||||
getSourceMapGenerator: function getSourceMapGenerator() {
|
||||
},
|
||||
/**
|
||||
* gets the path from the filename, e.g. "http://wwe.files.com/ha/ha.less" would return
|
||||
* "http://wwe.files.com/ha/"
|
||||
* If the filename is a file e.g. "file.less" it should return the empty string ""
|
||||
* @param {String} filename - the filename to extract the path.
|
||||
* @returns {String}
|
||||
*/
|
||||
getPath: function (filename) {
|
||||
},
|
||||
/**
|
||||
* Returns whether the path is absolute, e.g. "/file.less" = true, "file.less" = false
|
||||
* @param {String} filename - the filename
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
isPathAbsolute: function(filename) {
|
||||
},
|
||||
/**
|
||||
* Loads a file for an import aynscronously (or syncronously)
|
||||
* @param {String} filename - the filename
|
||||
* @param {String} currentDirectory - the current directory we are in
|
||||
* @param {Object} options - the context/options object
|
||||
* @param {Function} callback - a function to callback when finished,
|
||||
* taking the format callback(error, contents, fullfilename, reserved)
|
||||
* where error is { type: {string}, message: {string} }, contents is {string} and fullfilename is {string}
|
||||
* for reserved, see less-browser/index.js which uses this argument for cache information
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
loadFile: function(filename, currentDirectory, options, callback) {
|
||||
},
|
||||
supportsDataURI: function() {
|
||||
}
|
||||
};
|
||||
25
lib/less/environment/environment-api.js
Normal file
25
lib/less/environment/environment-api.js
Normal file
@@ -0,0 +1,25 @@
|
||||
module.exports = {
|
||||
/**
|
||||
* Converts a string to a base 64 string
|
||||
* @param str
|
||||
*/
|
||||
encodeBase64: function(str) {
|
||||
},
|
||||
/**
|
||||
* Lookup the mime-type of a filename
|
||||
* @param filename
|
||||
*/
|
||||
mimeLookup: function (filename) {
|
||||
},
|
||||
/**
|
||||
* Look up the charset of a mime type
|
||||
* @param mime
|
||||
*/
|
||||
charsetLookup: function (mime) {
|
||||
},
|
||||
/**
|
||||
* Gets a source map generator
|
||||
*/
|
||||
getSourceMapGenerator: function getSourceMapGenerator() {
|
||||
}
|
||||
};
|
||||
95
lib/less/environment/file-manager-api.js
Normal file
95
lib/less/environment/file-manager-api.js
Normal file
@@ -0,0 +1,95 @@
|
||||
module.exports = {
|
||||
/**
|
||||
* Given the full path to a file, return the path component
|
||||
* Provided by AbstractFileManager
|
||||
* @param {string} filename
|
||||
* @returns {string}
|
||||
*/
|
||||
getPath: function(filename) {
|
||||
},
|
||||
/**
|
||||
* Whether the rootpath should be converted to be absolute.
|
||||
* The browser ovverides this to return true because urls must be absolute.
|
||||
* Provided by AbstractFileManager (returns false)
|
||||
* @returns {bool}
|
||||
*/
|
||||
alwaysMakePathsAbsolute: function() {
|
||||
},
|
||||
/**
|
||||
* Returns whether a path is absolute
|
||||
* Provided by AbstractFileManager
|
||||
* @param {string} path
|
||||
* @returns {bool}
|
||||
*/
|
||||
isPathAbsolute: function(path) {
|
||||
},
|
||||
/**
|
||||
* joins together 2 paths
|
||||
* Provided by AbstractFileManager
|
||||
* @param {string} basePath
|
||||
* @param {string} laterPath
|
||||
*/
|
||||
join: function(basePath, laterPath) {
|
||||
},
|
||||
/**
|
||||
* Returns the difference between 2 paths
|
||||
* E.g. url = a/ baseUrl = a/b/ returns ../
|
||||
* url = a/b/ baseUrl = a/ returns b/
|
||||
* Provided by AbstractFileManager
|
||||
* @param {string} url
|
||||
* @param {string} baseUrl
|
||||
* @returns {string}
|
||||
*/
|
||||
pathDiff: function(url, baseUrl) {
|
||||
},
|
||||
/**
|
||||
* Returns whether this file manager supports this file for syncronous file retrieval
|
||||
* If true is returned, loadFileSync will then be called with the file.
|
||||
* Provided by AbstractFileManager (returns false)
|
||||
* @param {string} filename
|
||||
* @param {string} currentDirectory
|
||||
* @param {object} options
|
||||
* @param {less.environment.environment} environment
|
||||
* @returns {bool}
|
||||
*/
|
||||
supportsSync: function(filename, currentDirectory, options, environment) {
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @param {string} filename
|
||||
* @param {string} currentDirectory
|
||||
* @param {object} options
|
||||
* @param {less.environment.environment} environment
|
||||
* @returns {bool}
|
||||
*/
|
||||
supports: function(filename, currentDirectory, options, environment) {
|
||||
},
|
||||
/**
|
||||
* Loads a file asynchronously. Expects a promise that either rejects with an error or fullfills with an
|
||||
* object containing
|
||||
* { filename: - full resolved path to file
|
||||
* contents: - the contents of the file, as a string }
|
||||
*
|
||||
* @param {string} filename
|
||||
* @param {string} currentDirectory
|
||||
* @param {object} options
|
||||
* @param {less.environment.environment} environment
|
||||
* @returns {Promise}
|
||||
*/
|
||||
loadFile: function(filename, currentDirectory, options, environment) {
|
||||
},
|
||||
/**
|
||||
* Loads a file synchronously. Expects an immediate return with an object containing
|
||||
* { error: - error object if an error occurs
|
||||
* filename: - full resolved path to file
|
||||
* contents: - the contents of the file, as a string }
|
||||
*
|
||||
* @param {string} filename
|
||||
* @param {string} currentDirectory
|
||||
* @param {object} options
|
||||
* @param {less.environment.environment} environment
|
||||
* @returns {object} should be an object containing error or contents and filename
|
||||
*/
|
||||
loadFileSync: function(filename, currentDirectory, options, environment) {
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user