Fix the API files

This commit is contained in:
Luke Page
2014-10-12 16:49:38 +01:00
parent a1808b8943
commit c40069e83e
3 changed files with 120 additions and 62 deletions

View File

@@ -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() {
}
};

View 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() {
}
};

View 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) {
}
};