@base-framework/base
Version:
This is a javascript framework.
91 lines (90 loc) • 2.58 kB
TypeScript
/**
* This is the instance of base that all modules will use.
*
* @global
*/
export const base: Base;
/**
* Base
*
* This is the base framework.
*
* @class
*/
declare class Base {
/**
* @member {array} errors
*/
errors: any[];
/**
* @member {object} dataTracker
*/
dataTracker: typeof DataTracker;
/**
* this will augement the base framework with new functionality.
*
* @param {object} methods The new methods to add.
* @returns {object} An instance of base.
*/
augment(methods: object): object;
/**
* This will override a method function with a new function.
*
* @param {object} obj The object being modified.
* @param {string} methodName the method name being overriden.
* @param {function} overrideMethod The new function to call.
* @param {array} args The args to pass to the first function call.
* @returns {*} The results of the function being called.
*/
override(obj: object, methodName: string, overrideMethod: Function, args: any[]): any;
/**
* This will get the last error.
*
* @returns {(object|boolean)} The last error or false.
*/
getLastError(): (object | boolean);
/**
* This will add an error.
*
* @param {object} err
* @returns {void}
*/
addError(err: object): void;
/**
* This will get the value from a property on an object.
*
* @param {object} obj
* @param {string} property
* @param {*} [defaultText] A value if no value is set.
* @returns {string}
*/
getProperty(obj: object, property: string, defaultText?: any): string;
/**
* This will create a callBack.
*
* @param {object} obj
* @param {function} method
* @param {array} [argArray] Default args to pass.
* @param {boolean} [addArgs] Set to add merge args from the
* curried function.
* @returns {function|boolean} The callBack function or false.
*/
createCallBack(obj: object, method: Function, argArray?: any[], addArgs?: boolean): Function | boolean;
/**
* This will bind scope to a method.
*
* @param {object} obj
* @param {function} method
* @returns {function}
*/
bind(obj: object, method: Function): Function;
/**
* This will return the base prototype to allow the module
* to be added to base as a module.
*
* @returns {object} the base prototype.
*/
extend: Base;
}
import { DataTracker } from './data-tracker/data-tracker.js';
export {};