Bumped gulp-shenanigans to 0.5.11

This commit is contained in:
Josh Goldberg
2016-08-15 03:21:00 -07:00
parent 000325e83d
commit 299334cbb2
14 changed files with 8 additions and 5388 deletions
+7 -7
View File
@@ -1,7 +1,7 @@
{
"name": "userwrappr",
"description": "A user interface wrapper for configurable HTML displays over GameStartr games.",
"version": "0.5.3",
"version": "0.5.4",
"author": {
"name": "Josh Goldberg",
"email": "joshuakgoldberg@outlook.com"
@@ -15,13 +15,13 @@
},
"license": "MIT",
"dependencies": {
"DeviceLayr": "^0.5.1",
"GamesRunnr": "^0.5.2",
"InputWritr": "^0.5.1",
"ItemsHoldr": "^0.5.1",
"LevelEditr": "^0.5.1"
"devicelayr": "^0.5.1",
"gamesrunnr": "^0.5.2",
"inputwritr": "^0.5.1",
"itemsholdr": "^0.5.1",
"leveleditr": "^0.5.1"
},
"devDependencies": {
"gulp-shenanigans": "^0.5.1"
"gulp-shenanigans": "^0.5.11"
}
}
+1 -1
View File
@@ -9,6 +9,6 @@
"package": {
"description": "A user interface wrapper for configurable HTML displays over GameStartr games.",
"name": "UserWrappr",
"version": "0.5.11"
"version": "0.5.4"
}
}
-437
View File
@@ -1,437 +0,0 @@
/// <reference path="../typings/ItemsHoldr.d.ts" />
/// <reference path="../typings/MapsCreatr.d.ts" />
/// <reference path="../typings/MapScreenr.d.ts" />
declare namespace AreaSpawnr {
/**
* A Function to add a map command, such as an after or stretch.
*
* @param thing The raw command to create a Thing, as either a title
* or a JSON object.
* @param index Which command this is, as per Array.forEach.
*/
interface ICommandAdder {
(thing: string | MapsCreatr.IPreThingSettings, index: number): void;
}
/**
* Settings to initialize a new IAreaSpawnr.
*/
interface IAreaSpawnrSettings {
/**
* A MapsCreatr used to store and lazily initialize Maps.
*/
MapsCreator: MapsCreatr.IMapsCreatr;
/**
* A MapScreenr used to store attributes of Areas.
*/
MapScreener: MapScreenr.IMapScreenr;
/**
* Function for when a PreThing's Thing should be spawned.
*/
onSpawn?: (prething: MapsCreatr.IPreThing) => void;
/**
* Function for when a PreThing's Thing should be un-spawned.
*/
onUnspawn?: (prething: MapsCreatr.IPreThing) => void;
/**
* Any property names to copy from Areas to
*/
screenAttributes?: string[];
/**
* Function to add an Area's provided "stretches" commands to stretch
* across an Area.
*/
stretchAdd?: ICommandAdder;
/**
* Function to add an Area provides an "afters" command to add PreThings
* to the end of an Area.
*/
afterAdd?: ICommandAdder;
/**
* An optional scope to call stretchAdd and afterAdd on, if not this.
*/
commandScope?: any;
}
/**
* Loads GameStartr maps to spawn and unspawn areas on demand.
*/
interface IAreaSpawnr {
/**
* @returns The internal MapsCreator.
*/
getMapsCreator(): MapsCreatr.IMapsCreatr;
/**
* @returns The internal MapScreener.
*/
getMapScreener(): MapScreenr.IMapScreenr;
/**
* @returns The attribute names to be copied to MapScreener.
*/
getScreenAttributes(): string[];
/**
* @returns The key by which the current Map is indexed.
*/
getMapName(): string;
/**
* Gets the map listed under the given name. If no name is provided, the
* mapCurrent is returned instead.
*
* @param name An optional key to find the map under.
* @returns A Map under the given name, or the current map if none given.
*/
getMap(name?: string): MapsCreatr.IMap;
/**
* Simple getter pipe to the internal MapsCreator.getMaps() function.
*
* @returns A listing of maps, keyed by their names.
*/
getMaps(): {
[i: string]: MapsCreatr.IMap;
};
/**
* @returns The current Area.
*/
getArea(): MapsCreatr.IArea;
/**
* @returns The name of the current Area.
*/
getAreaName(): string;
/**
* @param location The key of the Location to return.
* @returns A Location within the current Map.
*/
getLocation(location: string): MapsCreatr.ILocation;
/**
* @returns The most recently entered Location in the current Area.
*/
getLocationEntered(): MapsCreatr.ILocation;
/**
* Simple getter function for the internal prethings object. This will be
* undefined before the first call to setMap.
*
* @returns A listing of the current area's Prethings.
*/
getPreThings(): MapsCreatr.IPreThingsContainers;
/**
* Sets the currently manipulated Map in the handler to be the one under a
* given name. Note that this will do very little unless a location is
* provided.
*
* @param name A key to find the map under.
* @param location An optional key for a location to immediately start the
* map in (if not provided, ignored).
* @returns The now-current map.
*/
setMap(name: string, location?: string): MapsCreatr.IMap;
/**
* Goes to a particular location in the given map. Area attributes are
* copied to the MapScreener, PreThings are loaded, and stretches and afters
* are checked.
*
* @param name The key of the Location to start in.
*/
setLocation(name: string): void;
/**
* Applies the stretchAdd Function to each given "stretch" command and
* stores the commands in stretches.
*
* @param stretchesRaw Raw descriptions of the stretches.
*/
setStretches(stretchesRaw: (string | MapsCreatr.IPreThingSettings)[]): void;
/**
* Applies the afterAdd Function to each given "after" command and stores
* the commands in afters.
*
* @param aftersRaw Raw descriptions of the afters.
*/
setAfters(aftersRaw: (string | MapsCreatr.IPreThingSettings)[]): void;
/**
* Calls onSpawn on every PreThing touched by the given bounding box,
* determined in order of the given direction. This is a simple wrapper
* around applySpawnAction that also gives it true as the status.
*
* @param direction The direction by which to order PreThings, as "xInc",
* "xDec", "yInc", or "yDec".
* @param top The upper-most bound to spawn within.
* @param right The right-most bound to spawn within.
* @param bottom The bottom-most bound to spawn within.
* @param left The left-most bound to spawn within.
*/
spawnArea(direction: string, top: number, right: number, bottom: number, left: number): void;
/**
* Calls onUnspawn on every PreThing touched by the given bounding box,
* determined in order of the given direction. This is a simple wrapper
* around applySpawnAction that also gives it false as the status.
*
* @param direction The direction by which to order PreThings, as "xInc",
* "xDec", "yInc", or "yDec".
* @param top The upper-most bound to spawn within.
* @param right The right-most bound to spawn within.
* @param bottom The bottom-most bound to spawn within.
* @param left The left-most bound to spawn within.
*/
unspawnArea(direction: string, top: number, right: number, bottom: number, left: number): void;
}
/**
* Loads GameStartr maps to spawn and unspawn areas on demand.
*/
class AreaSpawnr implements IAreaSpawnr {
/**
* Directional equivalents for converting from directions to keys.
*/
static directionKeys: {
[i: string]: string;
};
/**
* Opposite directions for when finding descending order Arrays.
*/
static directionOpposites: {
[i: string]: string;
};
/**
* MapsCreatr container for Maps from which this obtains Thing settings.
*/
private MapsCreator;
/**
* MapScreenr container for attributes copied from Areas.
*/
private MapScreener;
/**
* The names of attributes to be copied to the MapScreenr during setLocation.
*/
private screenAttributes;
/**
* The currently referenced Map, set by setMap.
*/
private mapCurrent;
/**
* The currently referenced Area, set by setLocation.
*/
private areaCurrent;
/**
* The currently referenced Location, set by setLocation.
*/
private locationEntered;
/**
* The name of the currently referenced Area, set by setMap.
*/
private mapName;
/**
* The current Area's listing of PreThings.
*/
private prethings;
/**
* Function for when a PreThing is to be spawned.
*/
private onSpawn;
/**
* Function for when a PreThing is to be un-spawned.
*/
private onUnspawn;
/**
* Optionally, PreThing settings to stretch across an Area.
*/
private stretches;
/**
* If stretches exists, a Function to add stretches to an Area.
*/
private stretchAdd;
/**
* Optionally, PreThing settings to place at the end of an Area.
*/
private afters;
/**
* If afters exists, a Function to add afters to an Area.
*/
private afterAdd;
/**
* An optional scope to call stretchAdd and afterAdd on, if not this.
*/
private commandScope;
/**
* @param {IAreaSpawnrSettings} settings
*/
constructor(settings: IAreaSpawnrSettings);
/**
* @returns The internal MapsCreator.
*/
getMapsCreator(): MapsCreatr.IMapsCreatr;
/**
* @returns The internal MapScreener.
*/
getMapScreener(): MapScreenr.IMapScreenr;
/**
* @returns The attribute names to be copied to MapScreener.
*/
getScreenAttributes(): string[];
/**
* @returns The key by which the current Map is indexed.
*/
getMapName(): string;
/**
* Gets the map listed under the given name. If no name is provided, the
* mapCurrent is returned instead.
*
* @param name An optional key to find the map under.
* @returns A Map under the given name, or the current map if none given.
*/
getMap(name?: string): MapsCreatr.IMap;
/**
* Simple getter pipe to the internal MapsCreator.getMaps() function.
*
* @returns A listing of maps, keyed by their names.
*/
getMaps(): {
[i: string]: MapsCreatr.IMap;
};
/**
* @returns The current Area.
*/
getArea(): MapsCreatr.IArea;
/**
* @returns The name of the current Area.
*/
getAreaName(): string;
/**
* @param location The key of the Location to return.
* @returns A Location within the current Map.
*/
getLocation(location: string): MapsCreatr.ILocation;
/**
* @returns The most recently entered Location in the current Area.
*/
getLocationEntered(): MapsCreatr.ILocation;
/**
* Simple getter function for the internal prethings object. This will be
* undefined before the first call to setMap.
*
* @returns A listing of the current area's Prethings.
*/
getPreThings(): MapsCreatr.IPreThingsContainers;
/**
* Sets the currently manipulated Map in the handler to be the one under a
* given name. Note that this will do very little unless a location is
* provided.
*
* @param name A key to find the map under.
* @param location An optional key for a location to immediately start the
* map in (if not provided, ignored).
* @returns The now-current map.
*/
setMap(name: string, location?: string): MapsCreatr.IMap;
/**
* Goes to a particular location in the given map. Area attributes are
* copied to the MapScreener, PreThings are loaded, and stretches and afters
* are checked.
*
* @param name The key of the Location to start in.
*/
setLocation(name: string): void;
/**
* Applies the stretchAdd Function to each given "stretch" command and
* stores the commands in stretches.
*
* @param stretchesRaw Raw descriptions of the stretches.
*/
setStretches(stretchesRaw: (string | MapsCreatr.IPreThingSettings)[]): void;
/**
* Applies the afterAdd Function to each given "after" command and stores
* the commands in afters.
*
* @param aftersRaw Raw descriptions of the afters.
*/
setAfters(aftersRaw: (string | MapsCreatr.IPreThingSettings)[]): void;
/**
* Calls onSpawn on every PreThing touched by the given bounding box,
* determined in order of the given direction. This is a simple wrapper
* around applySpawnAction that also gives it true as the status.
*
* @param direction The direction by which to order PreThings, as "xInc",
* "xDec", "yInc", or "yDec".
* @param top The upper-most bound to spawn within.
* @param right The right-most bound to spawn within.
* @param bottom The bottom-most bound to spawn within.
* @param left The left-most bound to spawn within.
*/
spawnArea(direction: string, top: number, right: number, bottom: number, left: number): void;
/**
* Calls onUnspawn on every PreThing touched by the given bounding box,
* determined in order of the given direction. This is a simple wrapper
* around applySpawnAction that also gives it false as the status.
*
* @param direction The direction by which to order PreThings, as "xInc",
* "xDec", "yInc", or "yDec".
* @param top The upper-most bound to spawn within.
* @param right The right-most bound to spawn within.
* @param bottom The bottom-most bound to spawn within.
* @param left The left-most bound to spawn within.
*/
unspawnArea(direction: string, top: number, right: number, bottom: number, left: number): void;
/**
* Calls onUnspawn on every PreThing touched by the given bounding box,
* determined in order of the given direction. This is used both to spawn
* and un-spawn PreThings, such as during QuadsKeepr shifting. The given
* status is used as a filter: all PreThings that already have the status
* (generally true or false as spawned or unspawned, respectively) will have
* the callback called on them.
*
* @param callback The callback to be run whenever a matching matching
* PreThing is found.
* @param status The spawn status to match PreThings against. Only PreThings
* with .spawned === status will have the callback applied.
* @param direction The direction by which to order PreThings, as "xInc",
* "xDec", "yInc", or "yDec".
* @param top The upper-most bound to apply within.
* @param right The right-most bound to apply within.
* @param bottom The bottom-most bound to apply within.
* @param left The left-most bound to apply within.
*/
private applySpawnAction(callback, status, direction, top, right, bottom, left);
/**
* Finds the index from which PreThings should stop having an action
* applied to them in applySpawnAction. This is less efficient than the
* unused version below, but is more reliable for slightly unsorted groups.
*
* @param direction The direction by which to order PreThings, as "xInc",
* "xDec", "yInc", or "yDec".
* @param group The group to find a PreThing index within.
* @param mid The middle of the group. This is currently unused.
* @param top The upper-most bound to apply within.
* @param right The right-most bound to apply within.
* @param bottom The bottom-most bound to apply within.
* @param left The left-most bound to apply within.
* @returns The index to start spawning PreThings from.
*/
private findPreThingsSpawnStart(direction, group, mid, top, right, bottom, left);
/**
* Finds the index from which PreThings should stop having an action
* applied to them in applySpawnAction. This is less efficient than the
* unused version below, but is more reliable for slightly unsorted groups.
*
* @param direction The direction by which to order PreThings, as "xInc",
* "xDec", "yInc", or "yDec".
* @param group The group to find a PreThing index within.
* @param mid The middle of the group. This is currently unused.
* @param top The upper-most bound to apply within.
* @param right The right-most bound to apply within.
* @param bottom The bottom-most bound to apply within.
* @param left The left-most bound to apply within.
* @returns The index to stop spawning PreThings from.
*/
private findPreThingsSpawnEnd(direction, group, mid, top, right, bottom, left);
/**
* Conditionally returns a measurement based on what direction String is
* given. This is useful for generically finding boundaries when the
* direction isn't known, such as in findPreThingsSpawnStart and -End.
*
* @param direction The direction by which to order PreThings, as "xInc",
* "xDec", "yInc", or "yDec".
* @param top The upper-most bound to apply within.
* @param right The right-most bound to apply within.
* @param bottom The bottom-most bound to apply within.
* @param left The left-most bound to apply within.
* @returns Either top, right, bottom, or left, depending on direction.
*/
private getDirectionEnd(directionKey, top, right, bottom, left);
}
}
declare var module: any;
-186
View File
@@ -1,186 +0,0 @@
declare namespace ChangeLinr {
/**
* A chained automator for applying and caching transforms.
*/
class ChangeLinr implements IChangeLinr {
/**
* Functions that may be used to transform data, keyed by name.
*/
private transforms;
/**
* Ordered listing of Function names to be applied to raw input.
*/
private pipeline;
/**
* Cached output of previous results of the the pipeline.
*/
private cache;
/**
* Cached output of each step of the pipeline.
*/
private cacheFull;
/**
* Whether this should be caching responses.
*/
private doMakeCache;
/**
* Whether this should be retrieving and using cached results.
*/
private doUseCache;
/**
* @param {IChangeLinrSettings} settings
*/
constructor(settings: IChangeLinrSettings);
/**
* @returns The cached output of this.process and this.processFull.
*/
getCache(): ICache;
/**
* @param key The key under which the output was processed
* @returns The cached output filed under the given key.
*/
getCached(key: string): any;
/**
* @returns A complete listing of the cached outputs from all
* processed information, from each pipeline transform.
*/
getCacheFull(): ICacheFull;
/**
* @returns Whether the cache object is being kept.
*/
getDoMakeCache(): boolean;
/**
* @returns Whether previously cached output is being used in new
* process requests.
*/
getDoUseCache(): boolean;
/**
* Applies a series of transforms to input data. If doMakeCache is on, the
* outputs of this are stored in cache and cacheFull.
*
* @param data The data to be transformed.
* @param [key] They key under which the data is to be stored. If needed
* for caching but not provided, defaults to data.
* @param [attributes] Any extra attributes to be given to transforms.
* @returns The final output of the pipeline.
*/
process(data: any, key?: string, attributes?: any): any;
/**
* A version of this.process that returns the complete output from each
* pipelined transform Function in an Object.
*
* @param data The data to be transformed.
* @param key They key under which the data is to be stored.
* @param [attributes] Any extra attributes to be given to the transforms.
* @returns The final output of the transforms.
*/
processFull(data: any, key: string, attributes?: any): any;
}
/**
* A container of transform Functions, referenced by their keys.
*/
interface ITransforms {
[i: string]: ITransform;
}
/**
* A transformation Function to apply to input.
*
* @param data The raw input data to be transformed.
* @param [key] They key under which the data is to be stored.
* @param [attributes] Any extra attributes to be given to the transforms.
* @param [scope] The ChangeLinr calling the transformation.
* @returns The input data, transformed.
* @remarks All the parameters after data are listed as optional, but they
* will be passed in by the calling ChangeLinr.
*/
interface ITransform {
(data: any, key?: string, attributes?: any, scope?: IChangeLinr): any;
}
/**
* Cached storage for outputs of transformations, keyed by their request key.
*/
interface ICache {
[i: string]: any;
}
/**
* Complete cached storage for transforms, keyed by their request key to
* a mapping of transforms to results.
*/
interface ICacheFull {
[i: string]: {
[j: string]: any;
};
}
/**
* Settings to initialize a new instance of an IChangeLinr.
*/
interface IChangeLinrSettings {
/**
* Transformation functions to be applied to inputs.
*/
transforms: ITransforms;
/**
* The order to apply transformation functions to inputs.
*/
pipeline: string[];
/**
* Whether a cache should be created of transformation results.
*/
doMakeCache?: boolean;
/**
* Whether cache results should be used for computations.
*/
doUseCache?: boolean;
}
/**
* A chained automator for applying and caching transforms.
*/
interface IChangeLinr {
/**
* @returns The cached output of this.process and this.processFull.
*/
getCache(): ICache;
/**
* @param key The key under which the output was processed
* @returns The cached output filed under the given key.
*/
getCached(key: string): any;
/**
* @returns A complete listing of the cached outputs from all
* processed information, from each pipeline transform.
*/
getCacheFull(): ICacheFull;
/**
* @returns Whether the cache object is being kept.
*/
getDoMakeCache(): boolean;
/**
* @returns Whether previously cached output is being used in new
* process requests.
*/
getDoUseCache(): boolean;
/**
* Applies a series of transforms to input data. If doMakeCache is on, the
* outputs of this are stored in cache and cacheFull.
*
* @param data The data to be transformed.
* @param [key] They key under which the data is to be stored.
* If needed but not provided, defaults to data.
* @param [attributes] Any extra attributes to be given to the
* transform Functions.
* @returns The final output of the pipeline.
*/
process(data: any, key?: string, attributes?: any): any;
/**
* A version of this.process that returns the complete output from each
* pipelined transform Function in an Object.
*
* @param data The data to be transformed.
* @param key They key under which the data is to be stored.
* @param [attributes] Any extra attributes to be given to the transforms.
* @returns The final output of the transforms.
*/
processFull(data: any, key: string, attributes?: any): any;
}
}
declare var module: any;
-200
View File
@@ -1,200 +0,0 @@
declare namespace FPSAnalyzr {
/**
* Storage and analysis for framerate measurements.
*/
class FPSAnalyzr implements IFPSAnalyzr {
/**
* Function to generate a current timestamp, commonly performance.now.
*/
getTimestamp: ITimestampGetter;
/**
* How many FPS measurements to keep at any given time, at most.
*/
private maxKept;
/**
* A recent history of FPS measurements (normally an Array). These are
* stored as changes in millisecond timestamps.
*/
private measurements;
/**
* The actual number of FPS measurements currently known.
*/
private numRecorded;
/**
* The current position in the internal measurements listing.
*/
private ticker;
/**
* The most recent timestamp from getTimestamp.
*/
private timeCurrent;
/**
* Initializes a new instance of the FPSAnalyzr class.
*
* @param [settings]
*/
constructor(settings?: IFPSAnalyzrSettings);
/**
* Standard public measurement function.
* Marks the current timestamp as timeCurrent, and adds an FPS measurement
* if there was a previous timeCurrent.
*
* @param [time] An optional timestamp (by default, getTimestamp() is used).
*/
measure(time?: number): void;
/**
* Adds an FPS measurement to measurements, and increments the associated
* count variables.
*
* @param fps An FPS calculated as the difference between two timestamps.
*/
addFPS(fps: number): void;
/**
* @returns The number of FPS measurements to keep.
*/
getMaxKept(): number;
/**
* @returns The actual number of FPS measurements currently known.
*/
getNumRecorded(): number;
/**
* @returns The most recent performance.now timestamp.
*/
getTimeCurrent(): number;
/**
* @returns The current position in measurements.
*/
getTicker(): number;
/**
* @param getAll Whether all measurements should be returned, rather than
* the most recent (by default, false).
* @returns The stored FPS measurements.
*/
getMeasurements(getAll?: boolean): number[];
/**
* Get function for a copy of the measurements listing, but with the FPS
* measurements transformed back into time differences
*
* @returns A container of the most recent FPS time differences.
*/
getDifferences(): number[];
/**
* @returns The average recorded FPS measurement.
*/
getAverage(): number;
/**
* @returns The median recorded FPS measurement.
* @remarks This is O(n*log(n)), where n is the size of the history,
* as it creates a copy of the history and sorts it.
*/
getMedian(): number;
/**
* @returns Array containing the lowest and highest recorded FPS
* measurements, in that order.
*/
getExtremes(): number[];
/**
* @returns The range of recorded FPS measurements.
*/
getRange(): number;
/**
* Converts all measurements to a Number[] in sorted order, regardless
* of whether they're initially stored in an Array or Object.
*
* @returns All measurements, sorted.
*/
private getMeasurementsSorted();
}
/**
* A Function to generate a current timestamp, such as performance.now.
*/
interface ITimestampGetter {
(): number;
}
/**
* Settings to initialize a new IFPSAnalyzr.
*/
interface IFPSAnalyzrSettings {
/**
* How many FPS measurements to keep at any given time, at most.
*/
maxKept?: number;
/**
* A Function to generate a current timestamp, such as performance.now.
*/
getTimestamp?: any;
}
/**
* Storage and analysis for framerate measurements.
*/
interface IFPSAnalyzr {
/**
* Function to generate a current timestamp, commonly performance.now.
*/
getTimestamp: ITimestampGetter;
/**
* Standard public measurement function.
* Marks the current timestamp as timeCurrent, and adds an FPS measurement
* if there was a previous timeCurrent.
*
* @param [time] An optional timestamp (by default, getTimestamp() is used).
*/
measure(time?: number): void;
/**
* Adds an FPS measurement to measurements, and increments the associated
* count variables.
*
* @param fps An FPS calculated as the difference between two timestamps.
*/
addFPS(fps: number): void;
/**
* @returns The number of FPS measurements to keep.
*/
getMaxKept(): number;
/**
* @returns The actual number of FPS measurements currently known.
*/
getNumRecorded(): number;
/**
* @returns The most recent performance.now timestamp.
*/
getTimeCurrent(): number;
/**
* @returns The current position in measurements.
*/
getTicker(): number;
/**
* @param getAll Whether all measurements should be returned, rather than
* the most recent.
* @returns The stored FPS measurements.
*/
getMeasurements(getAll: boolean): number[];
/**
* Get function for a copy of the measurements listing, but with the FPS
* measurements transformed back into time differences
*
* @returns A container of the most recent FPS time differences.
*/
getDifferences(): number[];
/**
* @returns The average recorded FPS measurement.
*/
getAverage(): number;
/**
* @returns The median recorded FPS measurement.
* @remarks This is O(n*log(n)), where n is the size of the history,
* as it creates a copy of the history and sorts it.
*/
getMedian(): number;
/**
* @returns Array containing the lowest and highest recorded FPS
* measurements, in that order.
*/
getExtremes(): number[];
/**
* @returns The range of recorded FPS measurements.
*/
getRange(): number;
}
}
declare var module: any;
-428
View File
@@ -1,428 +0,0 @@
declare namespace GroupHoldr {
/**
* A general storage abstraction for keyed containers of items.
*/
class GroupHoldr implements IGroupHoldr {
/**
* Stored object groups, keyed by name.
*/
private groups;
/**
* Mapping of "add", "delete", "get", and "set" keys to a listing of the
* appropriate Functions for each group.
*/
private functions;
/**
* Names of the stored object groups.
*/
private groupNames;
/**
* Types for each stored object group, as Array or Object.
*/
private groupTypes;
/**
* The names of each group's type, as "Array" or "Object".
*/
private groupTypeNames;
/**
* Initializes a new instance of the GroupHoldr class.
*
* @param settings Settings to be used for initialization.
*/
constructor(settings: IGroupHoldrSettings);
/**
* @returns The mapping of operation types to each group's Functions.
*/
getFunctions(): IFunctionGroups;
/**
* @returns The stored object groups, keyed by name.
*/
getGroups(): IGroups<any>;
/**
* @param name The name of the group to retrieve.
* @returns The group stored under the given name.
*/
getGroup(name: string): {
[i: string]: any;
} | any[];
/**
* @returns Names of the stored object groups.
*/
getGroupNames(): string[];
/**
* Switches an object from one group to another.
*
* @param value The value being moved from one group to another.
* @param groupNameOld The name of the group to move out of.
* @param groupNameNew The name of the group to move into.
* @param [keyOld] What key the value used to be under (required if
* the old group is an Object).
* @param [keyNew] Optionally, what key the value will now be under
* (required if the new group is an Object).
*/
switchMemberGroup(value: any, groupNameOld: string, groupNameNew: string, keyOld?: string | number, keyNew?: string | number): void;
/**
* Calls a Function for each group, with that group as the first argument.
* Extra arguments may be passed in an array after scope and func, as in
* Function.apply's standard.
*
* @param scope An optional scope to call this from (if falsy, defaults
* to the calling GroupHoldr).
* @param func A Function to apply to each group.
* @param [args] Optionally, arguments to pass in after each group.
*/
applyAll(scope: any, func: (...args: any[]) => any, args?: any[]): void;
/**
* Calls a function for each member of each group. Extra arguments may be
* passed in an array after scope and func, as in Function.apply's standard.
*
* @param scope An optional scope to call this from (if falsy, defaults
* to the calling GroupHoldr).
* @param func A Function to apply to each group.
* @param [args] Optionally, arguments to pass in after each group.
*/
applyOnAll(scope: any, func: (...args: any[]) => any, args?: any[]): void;
/**
* Calls a Function for each group, with that group as the first argument.
* Extra arguments may be passed after scope and func natively, as in
* Function.call's standard.
*
* @param scope An optional scope to call this from (if falsy,
* defaults to this).
* @param func A Function to apply to each group.
*/
callAll(scope: any, func: (...args: any[]) => any): void;
/**
* Calls a function for each member of each group. Extra arguments may be
* passed after scope and func natively, as in Function.call's standard.
*
* @param scope An optional scope to call this from (if falsy,
* defaults to this).
* @param func A Function to apply to each group member.
*/
callOnAll(scope: any, func: (...args: any[]) => any): void;
/**
* Clears each Array by setting its length to 0.
*/
clearArrays(): void;
/**
* Meaty function to reset, given an Array of names and an object of
* types. Any pre-existing Functions are cleared, and new ones are added
* as member objects and to this.functions.
*
* @param names An array of names of groupings to be made
* @param types An mapping of the function types of
* the names given in names. This may also be taken
* in as a String, to be converted to an Object.
*/
private setGroupNames(names, types);
/**
* Removes any pre-existing "set", "get", etc. functions.
*/
private clearFunctions();
/**
* Resets groups to an empty Object, and fills it with a new groupType for
* each name in groupNames.
*/
private setGroups();
/**
* Calls the Function creators for each name in groupNames.
*/
private createFunctions();
/**
* Creates a setGroup Function under this and functions.setGroup.
*
* @param name The name of the group, from groupNames.
*/
private createFunctionSetGroup(name);
/**
* Creates a getGroup Function under this and functions.getGroup.
*
* @param name The name of the group, from groupNames.
*/
private createFunctionGetGroup(name);
/**
* Creates a set Function under this and functions.set.
*
* @param name The name of the group, from groupNames.
*/
private createFunctionSet(name);
/**
* Creates a get<type> function under this and functions.get
*
* @param name The name of the group, from groupNames.
*/
private createFunctionGet(name);
/**
* Creates an add function under this and functions.add.
*
* @param name The name of the group, from groupNames.
*/
private createFunctionAdd(name);
/**
* Creates a delete function under this and functions.delete.
*
* @param name The name of the group, from groupNames.
*/
private createFunctionDelete(name);
/**
* Returns the name of a type specified by a string ("Array" or "Object").
*
* @param str The name of the type. If falsy, defaults to Array
* @returns The proper name of the type.
*/
private getTypeName(str);
/**
* Returns function specified by a string (Array or Object).
*
* @param str The name of the type. If falsy, defaults to Array
* @returns The class Function of the type.
*/
private getTypeFunction(str);
}
/**
* An Object group containing objects of type T.
*
* @param T The type of values contained within the group.
*/
interface IDictionary<T> {
[i: string]: T;
}
/**
* Stored object groups, keyed by name.
*/
interface IGroups<T> {
[i: string]: IDictionary<T> | T[];
}
/**
* Types for stored object groups, as Array or Object.
*/
interface ITypesListing {
[i: string]: {
new (): any[] | Object;
};
}
/**
* Abstract parent interface of all group Functions.
*/
interface IGroupHoldrFunction extends Function {
}
/**
* Stores the given group internally.
*
* @param value The new group to store.
*/
interface IGroupHoldrSetGroupFunction<T> extends IGroupHoldrFunction {
(value: IDictionary<T> | T[]): void;
}
/**
* @returns One of the stored groups.
*/
interface IGroupHoldrGetGroupFunction<T> extends IGroupHoldrFunction {
(): IDictionary<T> | T[];
}
/**
* Sets a value in a group.
*
* @param key The key to store the value under.
* @param [value] The value to store in the group.
*/
interface IGroupHoldrSetFunction extends IGroupHoldrFunction {
(key: string | number, value?: any): void;
}
/**
* Retrieves a value from a group.
*
* @param key The key the value is stored under.
*/
interface IGroupHoldrGetFunction extends IGroupHoldrFunction {
(key: string | number): void;
}
/**
* Adds a value to a group.
*
* @param value The value to store in the group.
* @param [key] The key to store the value under.
* @remarks If the group is an Array, not providing a key will use Array::push.
*/
interface IGroupHoldrAddFunction extends IGroupHoldrFunction {
(value: any, key?: string | number): void;
}
/**
* Adds a value to an Array group.
*
* @param value The value to store in the group.
* @param [key] The index to store the value under.
*/
interface IGroupHoldrArrayAddFunction extends IGroupHoldrAddFunction {
(value: any, key?: number): void;
}
/**
* Adds a value to an Object group.
*
* @param value The value to store in the group.
* @param key The key to store the value under.
*/
interface IGroupHoldrObjectAddFunction extends IGroupHoldrAddFunction {
(value: any, key: string): void;
}
/**
* Deletes a value from a group.
*
* @param [arg1] Either the value (Arrays) or the key (Objects).
* @param [arg2] Optionally, for Array groups, the value's index.
*/
interface IGroupHoldrDeleteFunction extends IGroupHoldrFunction {
(arg1?: any, arg2?: any): void;
}
/**
* Deletes a value from an Array group.
*
* @param [value] The value to delete, if index is not provided.
* @param [index] The index of the value, to bypass Array::indexOf.
*/
interface IGroupHoldrArrayDeleteFunction extends IGroupHoldrDeleteFunction {
(value?: any, index?: number): void;
}
/**
* Deletes a value from an Object group.
*
* @param key The key of the value to delete.
*/
interface IGroupHoldrObjectDeleteFunction extends IGroupHoldrDeleteFunction {
(key: string): void;
}
/**
* Storage for Function groups of a single group, keyed by their operation.
*/
interface IGroupHoldrFunctionGroup<T extends IGroupHoldrFunction> {
[i: string]: T;
}
/**
* Storage for Function groups, keyed by their operation.
*/
interface IFunctionGroups {
/**
* Setter Functions for each group, keyed by their group name.
*/
setGroup: IGroupHoldrFunctionGroup<IGroupHoldrSetGroupFunction<any>>;
/**
* Getter Functions for each group, keyed by their group name.
*/
getGroup: IGroupHoldrFunctionGroup<IGroupHoldrGetGroupFunction<any>>;
/**
* Value setter Functions for each group, keyed by their group name.
*/
set: IGroupHoldrFunctionGroup<IGroupHoldrSetFunction>;
/**
* Value getter Functions for each group, keyed by their group name.
*/
get: IGroupHoldrFunctionGroup<IGroupHoldrGetFunction>;
/**
* Value adder Functions for each group, keyed by their group name.
*/
add: IGroupHoldrFunctionGroup<IGroupHoldrAddFunction>;
/**
* Valuer deleter Functions for each group, keyed by their group name.
*/
delete: IGroupHoldrFunctionGroup<IGroupHoldrDeleteFunction>;
}
/**
* Settings to initialize a new IGroupHoldr.
*/
interface IGroupHoldrSettings {
/**
* The names of groups to be creaed.
*/
groupNames: string[];
/**
* The mapping of group types. This can be a single String ("Array" or
* "Object") to set each one, or an Object mapping each groupName to
* a different String (type).
*/
groupTypes: string | {
[i: string]: string;
};
}
/**
* A general storage abstraction for keyed containers of items.
*/
interface IGroupHoldr {
/**
* @returns The mapping of operation types to each group's Functions.
*/
getFunctions(): IFunctionGroups;
/**
* @returns The stored object groups, keyed by name.
*/
getGroups(): IGroups<any>;
/**
* @param name The name of the group to retrieve.
* @returns The group stored under the given name.
*/
getGroup(name: string): {
[i: string]: any;
} | any[];
/**
* @returns Names of the stored object groups.
*/
getGroupNames(): string[];
/**
* Switches an object from one group to another.
*
* @param value The value being moved from one group to another.
* @param groupNameOld The name of the group to move out of.
* @param groupNameNew The name of the group to move into.
* @param [keyOld] What key the value used to be under (required if
* the old group is an Object).
* @param [keyNew] Optionally, what key the value will now be under
* (required if the new group is an Object).
*/
switchMemberGroup(value: any, groupNameOld: string, groupNameNew: string, keyOld?: string | number, keyNew?: string | number): void;
/**
* Calls a Function for each group, with that group as the first argument.
* Extra arguments may be passed in an array after scope and func, as in
* Function.apply's standard.
*
* @param scope An optional scope to call this from (if falsy, defaults
* to the calling GroupHoldr).
* @param func A Function to apply to each group.
* @param [args] Optionally, arguments to pass in after each group.
*/
applyAll(scope: any, func: (...args: any[]) => any, args?: any[]): void;
/**
* Calls a function for each member of each group. Extra arguments may be
* passed in an array after scope and func, as in Function.apply's standard.
*
* @param scope An optional scope to call this from (if falsy, defaults
* to the calling GroupHoldr).
* @param func A Function to apply to each group.
* @param [args] Optionally, arguments to pass in after each group.
*/
applyOnAll(scope: any, func: (...args: any[]) => any, args?: any[]): void;
/**
* Calls a Function for each group, with that group as the first argument.
* Extra arguments may be passed after scope and func natively, as in
* Function.call's standard.
*
* @param scope An optional scope to call this from (if falsy,
* defaults to this).
* @param func A Function to apply to each group.
*/
callAll(scope: any, func: (...args: any[]) => any, ...args: any[]): void;
/**
* Calls a function for each member of each group. Extra arguments may be
* passed after scope and func natively, as in Function.call's standard.
*
* @param scope An optional scope to call this from (if falsy,
* defaults to this).
* @param func A Function to apply to each group member.
*/
callOnAll(scope: any, func: (...args: any[]) => any, ...args: any[]): void;
/**
* Clears each Array by setting its length to 0.
*/
clearArrays(): void;
}
}
declare var module: any;
-238
View File
@@ -1,238 +0,0 @@
declare namespace MapScreenr {
/**
* Functions to compute new variable values, keyed by their variable's names.
*/
interface IVariableFunctions {
[i: string]: Function;
}
/**
* Settings to initialize a new instance of the MapScreenr class.
*/
interface IMapScreenrSettings {
/**
* How wide the MapScreenr should be.
*/
width: number;
/**
* How tall the MapScreenr should be.
*/
height: number;
/**
* A mapping of Functions to generate member variables that should be
* recomputed on screen change, keyed by variable name.
*/
variableFunctions?: IVariableFunctions;
/**
* Arguments to be passed to variable Functions.
*/
variableArgs?: any[];
/**
* Assorted known variables, keyed by name.
*/
variables: {
[i: string]: any;
};
}
/**
* A flexible container for map attributes and viewport.
*/
interface IMapScreenr {
/**
* Top border measurement of the bounding box.
*/
top: number;
/**
* Right border measurement of the bounding box.
*/
right: number;
/**
* Bottom border measurement of the bounding box.
*/
bottom: number;
/**
* Left border measurement of the bounding box.
*/
left: number;
/**
* Constant horizontal midpoint of the bounding box, equal to (left + right) / 2.
*/
middleX: number;
/**
* Constant vertical midpoint of the bounding box, equal to (top + bottom) / 2.
*/
middleY: number;
/**
* Constant width of the bounding box.
*/
width: number;
/**
* Constant height of the bounding box.
*/
height: number;
/**
* Completely clears the MapScreenr for use in a new Area. Positioning is
* reset to (0,0) and user-configured variables are recalculated.
*/
clearScreen(): void;
/**
* Computes middleX as the midpoint between left and right.
*/
setMiddleX(): void;
/**
* Computes middleY as the midpoint between top and bottom.
*/
setMiddleY(): void;
/**
* Recalculates all variables by passing variableArgs to their Functions.
*/
setVariables(): void;
/**
* Recalculates a variable by passing variableArgs to its Function.
*
* @param name The name of the variable to recalculate.
* @param value A new value for the variable instead of its Function's result.
* @returns The new value of the variable.
*/
setVariable(name: string, value?: any): any;
/**
* Shifts the MapScreenr horizontally and vertically via shiftX and shiftY.
*
* @param dx How far to scroll horizontally.
* @param dy How far to scroll vertically.
*/
shift(dx: number, dy: number): void;
/**
* Shifts the MapScreenr horizontally by changing left and right by the dx.
*
* @param dx How far to scroll horizontally.
*/
shiftX(dx: number): void;
/**
* Shifts the MapScreenr vertically by changing top and bottom by the dy.
*
* @param dy How far to scroll vertically.
*/
shiftY(dy: number): void;
/**
* A listing of variable Functions to be calculated on screen resets.
*/
variableFunctions: IVariableFunctions;
/**
* Arguments to be passed into variable computation Functions.
*/
variableArgs: any[];
/**
* Known variables, keyed by name.
*/
variables: {
[i: string]: any;
};
}
/**
* A flexible container for map attributes and viewport.
*/
class MapScreenr implements IMapScreenr {
/**
* A listing of variable Functions to be calculated on screen resets.
*/
variableFunctions: IVariableFunctions;
/**
* Arguments to be passed into variable computation Functions.
*/
variableArgs: any[];
/**
* Top border measurement of the bounding box.
*/
top: number;
/**
* Right border measurement of the bounding box.
*/
right: number;
/**
* Bottom border measurement of the bounding box.
*/
bottom: number;
/**
* Left border measurement of the bounding box.
*/
left: number;
/**
* Constant horizontal midpoint of the bounding box, equal to (left + right) / 2.
*/
middleX: number;
/**
* Constant vertical midpoint of the bounding box, equal to (top + bottom) / 2.
*/
middleY: number;
/**
* Constant width of the bounding box.
*/
width: number;
/**
* Constant height of the bounding box.
*/
height: number;
/**
* Assorted known variables, keyed by name.
*/
variables: {
[i: string]: any;
};
/**
* Resets the MapScreenr. All members of the settings argument are copied
* to the MapScreenr itself, though only width and height are required.
*
* @param {IMapScreenrSettings} settings
*/
constructor(settings: IMapScreenrSettings);
/**
* Completely clears the MapScreenr for use in a new Area. Positioning is
* reset to (0,0) and user-configured variables are recalculated.
*/
clearScreen(): void;
/**
* Computes middleX as the midpoint between left and right.
*/
setMiddleX(): void;
/**
* Computes middleY as the midpoint between top and bottom.
*/
setMiddleY(): void;
/**
* Recalculates all variables by passing variableArgs to their Functions.
*/
setVariables(): void;
/**
* Recalculates a variable by passing variableArgs to its Function.
*
* @param name The name of the variable to recalculate.
* @param value A new value for the variable instead of its Function's result.
* @returns The new value of the variable.
*/
setVariable(name: string, value?: any): any;
/**
* Shifts the MapScreenr horizontally and vertically via shiftX and shiftY.
*
* @param dx How far to scroll horizontally.
* @param dy How far to scroll vertically.
*/
shift(dx: number, dy: number): void;
/**
* Shifts the MapScreenr horizontally by changing left and right by the dx.
*
* @param dx How far to scroll horizontally.
*/
shiftX(dx: number): void;
/**
* Shifts the MapScreenr vertically by changing top and bottom by the dy.
*
* @param dy How far to scroll vertically.
*/
shiftY(dy: number): void;
/**
* Known variables, keyed by name.
*/
[i: string]: any;
}
}
declare var module: any;
-756
View File
File diff suppressed because it is too large Load Diff
-238
View File
@@ -1,238 +0,0 @@
declare namespace ObjectMakr {
/**
* A tree representing class inheritances, where each key represents
* a class, and its children inherit from that class.
*/
interface IClassInheritance {
[i: string]: IClassInheritance;
}
/**
* Properties for a class prototype, which may be of any type.
*/
interface IClassProperties {
[i: string]: any;
}
/**
* Listing of class Functions, keyed by name.
*/
interface IClassFunctions {
[i: string]: IClassFunction;
}
/**
* Root abstract definition for class Functions.
*/
interface IClassFunction {
new (): any;
}
/**
* Member callback for when an output onMake is a Function.
*/
interface IOnMakeFunction {
(output: any, name: string, settings: any, defaults: any): any;
}
/**
* Settings to initialize a new IObjectMakr.
*/
interface IObjectMakrSettings {
/**
* A sketch of class inheritance.
*/
inheritance: IClassInheritance;
/**
* Properties for each class.
*/
properties?: IClassProperties;
/**
* Whether a full property mapping should be made for each type.
*/
doPropertiesFull?: boolean;
/**
* How propperties can be mapped from an Array to indices.
*/
indexMap?: any[];
/**
* Optionally, a String index for each generated Object's Function to
* be run when made.
*/
onMake?: string;
/**
* Optionally, existing classes that can be passed in instead of using auto-generated ones.
*/
functions?: IClassFunctions;
}
/**
* A abstract factory for dynamic attribute-based JavaScript classes.
*/
interface IObjectMakr {
/**
* @returns The complete inheritance mapping.
*/
getInheritance(): any;
/**
* @returns The complete properties mapping.
*/
getProperties(): any;
/**
* @returns The properties for a particular class.
*/
getPropertiesOf(title: string): any;
/**
* @returns Full properties, if doPropertiesFull is true.
*/
getFullProperties(): any;
/**
* @returns Full properties for a particular class, if
* doPropertiesFull is true.
*/
getFullPropertiesOf(title: string): any;
/**
* @returns The full mapping of class constructors.
*/
getFunctions(): IClassFunctions;
/**
* @param name The name of a class to retrieve.
* @returns The constructor for the given class.
*/
getFunction(name: string): IClassFunction;
/**
* @param type The name of a class to check for.
* @returns Whether that class exists.
*/
hasFunction(name: string): boolean;
/**
* @returns The optional mapping of indices.
*/
getIndexMap(): any[];
/**
* Creates a new instance of the specified type and returns it.
* If desired, any settings are applied to it (deep copy using proliferate).
*
* @param name The name of the type to initialize a new instance of.
* @param [settings] Additional attributes to add to the new instance.
* @returns A newly created instance of the specified type.
*/
make(name: string, settings?: any): any;
}
/**
* A abstract factory for dynamic attribute-based JavaScript classes.
*/
class ObjectMakr implements IObjectMakr {
/**
* The sketch of class inheritance.
*/
private inheritance;
/**
* Properties for each class.
*/
private properties;
/**
* The actual Functions for the classes to be made.
*/
private functions;
/**
* Whether a full property mapping should be made for each type.
*/
private doPropertiesFull;
/**
* If doPropertiesFull is true, a version of properties that contains the
* sum properties for each type (rather than missing inherited ones).
*/
private propertiesFull;
/**
* How properties can be mapped from an Array to indices.
*/
private indexMap;
/**
* Optionally, a String index for each generated Object's Function to
* be run when made.
*/
private onMake;
/**
* Initializes a new instance of the ObjectMakr class.
*
* @param settings Settings to be used for initialization.
*/
constructor(settings: IObjectMakrSettings);
/**
* @returns The complete inheritance mapping.
*/
getInheritance(): any;
/**
* @returns The complete properties mapping.
*/
getProperties(): any;
/**
* @returns The properties for a particular class.
*/
getPropertiesOf(title: string): any;
/**
* @returns Full properties, if doPropertiesFull is true.
*/
getFullProperties(): any;
/**
* @returns Full properties for a particular class, if
* doPropertiesFull is true.
*/
getFullPropertiesOf(title: string): any;
/**
* @returns The full mapping of class constructors.
*/
getFunctions(): IClassFunctions;
/**
* @param name The name of a class to retrieve.
* @returns The constructor for the given class.
*/
getFunction(name: string): IClassFunction;
/**
* @param type The name of a class to check for.
* @returns Whether that class exists.
*/
hasFunction(name: string): boolean;
/**
* @returns The optional mapping of indices.
*/
getIndexMap(): any[];
/**
* Creates a new instance of the specified type and returns it.
* If desired, any settings are applied to it (deep copy using proliferate).
*
* @param name The name of the type to initialize a new instance of.
* @param settings Additional attributes to add to the new instance.
* @returns A newly created instance of the specified type.
*/
make(name: string, settings?: any): any;
/**
* Parser that calls processPropertyArray on all properties given as arrays
*
* @param properties Type properties for classes to create.
*/
private processProperties(properties);
/**
* Creates an output properties object with the mapping shown in indexMap
*
* @param properties An Array with indiced versions of properties
*/
private processPropertyArray(indexMap);
/**
* Recursive parser to generate each Function, starting from the base.
*
* @param base An object whose keys are the names of Functions to
* made, and whose values are objects whose keys are
* for children that inherit from these Functions
* @param parent The parent class Function of the classes about to be made.
* @param parentName The name of the parent class to be inherited from,
* if it is a generated one (and not Object itself).
*/
private processFunctions(base, parent, parentName?);
/**
* Proliferates all members of the donor to the recipient recursively, as
* a deep copy.
*
* @param recipient An object receiving the donor's members.
* @param donor An object whose members are copied to recipient.
* @param noOverride If recipient properties may be overriden (by default, false).
*/
private proliferate(recipient, donor, noOverride?);
}
}
declare var module: any;
-597
View File
File diff suppressed because it is too large Load Diff
-953
View File
File diff suppressed because it is too large Load Diff
-626
View File
File diff suppressed because it is too large Load Diff
-142
View File
@@ -1,142 +0,0 @@
declare namespace StringFilr {
/**
* The core stored library in a StringFilr, as a tree of data.
*/
interface ILibrary<T> {
[i: string]: T | ILibrary<T>;
}
/**
* A cache of previously completed lookups.
*/
interface ICache<T> {
[i: string]: T | ILibrary<T>;
}
/**
* Settings to initialize a new IStringFilr.
*/
interface IStringFilrSettings<T> {
/**
* An Object containing data stored as children of sub-Objects.
*/
library: ILibrary<T>;
/**
* A String to use as a default key to rescue on, if provided.
*/
normal?: string;
/**
* Whether the library is required to contain the normal key in every
* descendent (by default, false).
*/
requireNormalKey?: boolean;
}
/**
* A path-based cache for quick loops in nested data structures.
*/
interface IStringFilr<T> {
/**
* @returns The base library of stored information.
*/
getLibrary(): ILibrary<T>;
/**
* @returns The optional normal class String.
*/
getNormal(): string;
/**
* @returns The complete cache of previously completed lookups.
*/
getCache(): ICache<T>;
/**
* @returns A cached value, if it exists.
*/
getCached(key: string): T | ILibrary<T>;
/**
* Completely clears the lookup cache.
*/
clearCache(): void;
/**
* Clears the cached entry for a key.
*
* @param keyRaw The raw key whose lookup is to be cleared.
*/
clearCached(key: string): void;
/**
* Retrieves the deepest matching data in the library for a key.
*
* @param keyRaw The raw key for data to look up, in String form.
* @returns The deepest matching data in the library.
*/
get(keyRaw: string): T | ILibrary<T>;
}
/**
* A path-based cache for quick loops in nested data structures.
*/
class StringFilr<T> implements IStringFilr<T> {
/**
* The library of data.
*/
private library;
/**
* A cache of previously completed lookups.
*/
private cache;
/**
* Optional default index to check when no suitable option is found.
*/
private normal;
/**
* Whether to crash when a sub-object in reset has no normal child.
*/
private requireNormalKey;
/**
* Initializes a new instance of the StringFilr class.
*
* @param settings Settings to be used for initialization.
*/
constructor(settings: IStringFilrSettings<T>);
/**
* @returns The base library of stored information.
*/
getLibrary(): ILibrary<T>;
/**
* @returns The optional normal class String.
*/
getNormal(): string;
/**
* @returns The complete cache of previously completed lookups.
*/
getCache(): ICache<T>;
/**
* @returns A cached value, if it exists.
*/
getCached(key: string): any;
/**
* Completely clears the lookup cache.
*/
clearCache(): void;
/**
* Clears the cached entry for a key.
*
* @param keyRaw The raw key whose lookup is to be cleared.
*/
clearCached(keyRaw: string): void;
/**
* Retrieves the deepest matching data in the library for a key.
*
* @param keyRaw The raw key for data to look up, in String form.
* @returns The deepest matching data in the library.
*/
get(keyRaw: string): T | ILibrary<T>;
/**
* Utility Function to follow a path into the library (this is the driver
* for searching into the library). For each available key, if it matches
* a key in current, it is removed from keys and recursion happens on the
* sub-directory in current.
*
* @param keys The currently available keys to search within.
* @param current The current location being searched within the library.
* @returns The most deeply matched part of the library.
*/
private followClass(keys, current);
}
}
declare var module: any;
-579
View File
File diff suppressed because it is too large Load Diff